mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-01-18 00:32:46 +00:00
Add set_blend to video_poke interface
This commit is contained in:
parent
76b62788be
commit
59ff094b3b
1
driver.h
1
driver.h
@ -230,6 +230,7 @@ typedef struct video_overlay_interface
|
||||
// Only used by RGUI atm.
|
||||
typedef struct video_poke_interface
|
||||
{
|
||||
void (*set_blend)(void *data, bool enable);
|
||||
void (*set_filtering)(void *data, unsigned index, bool smooth);
|
||||
void (*set_fbo_state)(void *data, unsigned state);
|
||||
void (*set_aspect_ratio)(void *data, unsigned aspectratio_index);
|
||||
|
@ -2710,7 +2710,10 @@ bool menu_iterate(void)
|
||||
else
|
||||
{
|
||||
if (g_extern.lifecycle_mode_state & (1ULL << MODE_MENU_DRAW))
|
||||
device_ptr->ctx_driver->set_blend(true);
|
||||
{
|
||||
if (driver.video_poke->set_blend)
|
||||
driver.video_poke->set_blend(driver.video_data, true);
|
||||
}
|
||||
|
||||
rarch_render_cached_frame();
|
||||
}
|
||||
@ -2749,7 +2752,10 @@ bool menu_iterate(void)
|
||||
device_ptr->ctx_driver->swap_buffers();
|
||||
|
||||
if (g_extern.lifecycle_mode_state & (1ULL << MODE_MENU_DRAW))
|
||||
device_ptr->ctx_driver->set_blend(false);
|
||||
{
|
||||
if (driver.video_poke->set_blend)
|
||||
driver.video_poke->set_blend(driver.video_data, false);
|
||||
}
|
||||
|
||||
if (g_extern.lifecycle_mode_state & (1ULL << MODE_MENU_INGAME_EXIT) &&
|
||||
g_extern.lifecycle_mode_state & (1ULL << MODE_MENU_INGAME))
|
||||
|
@ -281,17 +281,6 @@ static void gfx_ctx_swap_buffers(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
static void gfx_ctx_set_blend(bool enable)
|
||||
{
|
||||
if(enable)
|
||||
{
|
||||
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glEnable(GL_BLEND);
|
||||
}
|
||||
else
|
||||
glDisable(GL_BLEND);
|
||||
}
|
||||
|
||||
static void gfx_ctx_set_resize(unsigned width, unsigned height) { }
|
||||
|
||||
void texture_image_border_load(const char *path)
|
||||
@ -518,7 +507,7 @@ const gfx_ctx_driver_t gfx_ctx_ps3 = {
|
||||
NULL,
|
||||
"ps3",
|
||||
#ifdef HAVE_RMENU
|
||||
gfx_ctx_set_blend,
|
||||
NULL,
|
||||
NULL,
|
||||
gfx_ctx_get_available_resolutions,
|
||||
gfx_ctx_check_resolution,
|
||||
|
@ -87,18 +87,6 @@ unsigned m_menuMainRomListPos_x;
|
||||
unsigned m_menuMainRomListPos_y;
|
||||
#endif
|
||||
|
||||
static void gfx_ctx_xdk_set_blend(bool enable)
|
||||
{
|
||||
xdk_d3d_video_t *d3d = (xdk_d3d_video_t*)driver.video_data;
|
||||
|
||||
if(enable)
|
||||
{
|
||||
d3d->d3d_render_device->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_ONE);
|
||||
d3d->d3d_render_device->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);
|
||||
}
|
||||
d3d->d3d_render_device->SetRenderState(D3DRS_ALPHABLENDENABLE, enable);
|
||||
}
|
||||
|
||||
static void gfx_ctx_xdk_set_swap_interval(unsigned interval)
|
||||
{
|
||||
xdk_d3d_video_t *d3d = (xdk_d3d_video_t*)driver.video_data;
|
||||
|
12
gfx/gl.c
12
gfx/gl.c
@ -2275,7 +2275,19 @@ static void gl_set_aspect_ratio(void *data, unsigned aspectratio_index)
|
||||
gl->should_resize = true;
|
||||
}
|
||||
|
||||
static void gl_set_blend(void *data, bool enable)
|
||||
{
|
||||
if (enable)
|
||||
{
|
||||
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glEnable(GL_BLEND);
|
||||
}
|
||||
else
|
||||
glDisable(GL_BLEND);
|
||||
}
|
||||
|
||||
static const video_poke_interface_t gl_poke_interface = {
|
||||
gl_set_blend,
|
||||
gl_set_filtering,
|
||||
gl_set_fbo_state,
|
||||
gl_set_aspect_ratio,
|
||||
|
@ -1027,6 +1027,7 @@ static bool gx_set_shader(void *data, enum rarch_shader_type type, const char *p
|
||||
}
|
||||
|
||||
static const video_poke_interface_t gx_poke_interface = {
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
gx_set_aspect_ratio,
|
||||
|
@ -959,7 +959,20 @@ static void xdk_d3d_set_fbo_state(void *data, unsigned mode)
|
||||
|
||||
static void xdk_d3d_set_filtering(void *data, unsigned index, bool set_smooth) { }
|
||||
|
||||
static void xdk_d3d_set_blend(void *data, bool enable)
|
||||
{
|
||||
xdk_d3d_video_t *d3d = (xdk_d3d_video_t*)data;
|
||||
|
||||
if(enable)
|
||||
{
|
||||
d3d->d3d_render_device->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_ONE);
|
||||
d3d->d3d_render_device->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);
|
||||
}
|
||||
d3d->d3d_render_device->SetRenderState(D3DRS_ALPHABLENDENABLE, enable);
|
||||
}
|
||||
|
||||
static const video_poke_interface_t d3d_poke_interface = {
|
||||
xdk_d3d_set_blend,
|
||||
xdk_d3d_set_filtering,
|
||||
xdk_d3d_set_fbo_state,
|
||||
xdk_d3d_set_aspect_ratio,
|
||||
|
Loading…
x
Reference in New Issue
Block a user