summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/render/bgfxutil.h
blob: aa108a6fb3be98435b4b89c335021a7499322a45 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// license:BSD-3-Clause
// copyright-holders:Ryan Holtz
#ifndef RENDER_BGFX_UTIL
#define RENDER_BGFX_UTIL

#pragma once

#include <bgfx/bgfx.h>

#include "palette.h"

#include <cstdint>

/* sdl_info is the information about SDL for the current screen */
class bgfx_util
{
public:
	static const bgfx::Memory* mame_texture_data_to_bgfx_texture_data(bgfx::TextureFormat::Enum &dst_format, uint32_t format, int rowpixels, int width_margin, int height, const rgb_t *palette, void *base, uint16_t &out_pitch, int &width_div_factor, int &width_mul_factor);
	static const bgfx::Memory* mame_texture_data_to_bgra32(uint32_t src_format, int width, int height, int rowpixels, const rgb_t *palette, void *base);
	static uint64_t get_blend_state(uint32_t blend);
	static void find_prescale_factor(uint16_t width, uint16_t height, uint16_t max_prescale_size, uint16_t &xprescale, uint16_t &yprescale);
};

#endif // RENDER_BGFX_UTIL