mirror of
https://github.com/libretro/RetroArch
synced 2025-02-28 03:39:59 +00:00
Add full screen mode to set_texture_enable.
This commit is contained in:
parent
3ae5662dd2
commit
c17714ffbb
2
driver.h
2
driver.h
@ -341,7 +341,7 @@ typedef struct video_poke_interface
|
|||||||
|
|
||||||
#if defined(HAVE_RGUI) || defined(HAVE_RMENU)
|
#if defined(HAVE_RGUI) || defined(HAVE_RMENU)
|
||||||
void (*set_texture_frame)(void *data, const void *frame, bool rgb32, unsigned width, unsigned height, float alpha); // Update texture.
|
void (*set_texture_frame)(void *data, const void *frame, bool rgb32, unsigned width, unsigned height, float alpha); // Update texture.
|
||||||
void (*set_texture_enable)(void *data, bool enable); // Enable/disable rendering.
|
void (*set_texture_enable)(void *data, bool enable, bool full_screen); // Enable/disable rendering.
|
||||||
#endif
|
#endif
|
||||||
void (*set_osd_msg)(void *data, const char *msg, void *userdata);
|
void (*set_osd_msg)(void *data, const char *msg, void *userdata);
|
||||||
|
|
||||||
|
@ -2163,13 +2163,13 @@ bool menu_iterate(void)
|
|||||||
{
|
{
|
||||||
driver.video_poke->set_texture_frame(driver.video_data, menu_framebuf,
|
driver.video_poke->set_texture_frame(driver.video_data, menu_framebuf,
|
||||||
false, RGUI_WIDTH, RGUI_HEIGHT, 1.0f);
|
false, RGUI_WIDTH, RGUI_HEIGHT, 1.0f);
|
||||||
driver.video_poke->set_texture_enable(driver.video_data, true);
|
driver.video_poke->set_texture_enable(driver.video_data, true, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
rarch_render_cached_frame();
|
rarch_render_cached_frame();
|
||||||
|
|
||||||
if (driver.video_poke && driver.video_poke->set_texture_enable)
|
if (driver.video_poke && driver.video_poke->set_texture_enable)
|
||||||
driver.video_poke->set_texture_enable(driver.video_data, false);
|
driver.video_poke->set_texture_enable(driver.video_data, false, false);
|
||||||
|
|
||||||
input_process_ret = menu_input_process(NULL, NULL);
|
input_process_ret = menu_input_process(NULL, NULL);
|
||||||
|
|
||||||
|
@ -1436,8 +1436,9 @@ static void d3d9_set_rgui_texture_frame(void *data,
|
|||||||
reinterpret_cast<D3DVideo*>(data)->set_rgui_texture_frame(frame, rgb32, width, height, alpha);
|
reinterpret_cast<D3DVideo*>(data)->set_rgui_texture_frame(frame, rgb32, width, height, alpha);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void d3d9_set_rgui_texture_enable(void *data, bool state)
|
static void d3d9_set_rgui_texture_enable(void *data, bool state, bool full_screen)
|
||||||
{
|
{
|
||||||
|
(void)full_screen; // Ignore for now.
|
||||||
reinterpret_cast<D3DVideo*>(data)->set_rgui_texture_enable(state);
|
reinterpret_cast<D3DVideo*>(data)->set_rgui_texture_enable(state);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
14
gfx/gl.c
14
gfx/gl.c
@ -1286,7 +1286,16 @@ static inline void gl_draw_texture(void *data)
|
|||||||
|
|
||||||
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
|
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
glEnable(GL_BLEND);
|
glEnable(GL_BLEND);
|
||||||
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
|
|
||||||
|
if (gl->rgui_texture_full_screen)
|
||||||
|
{
|
||||||
|
glViewport(0, 0, gl->win_width, gl->win_height);
|
||||||
|
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
|
||||||
|
glViewport(gl->vp.x, gl->vp.y, gl->vp.width, gl->vp.height);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
|
||||||
|
|
||||||
glDisable(GL_BLEND);
|
glDisable(GL_BLEND);
|
||||||
|
|
||||||
gl->coords.tex_coord = gl->tex_coords;
|
gl->coords.tex_coord = gl->tex_coords;
|
||||||
@ -2345,10 +2354,11 @@ static void gl_set_texture_frame(void *data,
|
|||||||
glBindTexture(GL_TEXTURE_2D, gl->texture[gl->tex_index]);
|
glBindTexture(GL_TEXTURE_2D, gl->texture[gl->tex_index]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gl_set_texture_enable(void *data, bool state)
|
static void gl_set_texture_enable(void *data, bool state, bool full_screen)
|
||||||
{
|
{
|
||||||
gl_t *gl = (gl_t*)data;
|
gl_t *gl = (gl_t*)data;
|
||||||
gl->rgui_texture_enable = state;
|
gl->rgui_texture_enable = state;
|
||||||
|
gl->rgui_texture_full_screen = full_screen;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -278,6 +278,7 @@ typedef struct gl
|
|||||||
#if defined(HAVE_RGUI) || defined(HAVE_RMENU)
|
#if defined(HAVE_RGUI) || defined(HAVE_RMENU)
|
||||||
GLuint rgui_texture;
|
GLuint rgui_texture;
|
||||||
bool rgui_texture_enable;
|
bool rgui_texture_enable;
|
||||||
|
bool rgui_texture_full_screen;
|
||||||
GLfloat rgui_texture_alpha;
|
GLfloat rgui_texture_alpha;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -81,6 +81,7 @@ typedef struct thread_video
|
|||||||
unsigned height;
|
unsigned height;
|
||||||
float alpha;
|
float alpha;
|
||||||
bool enable;
|
bool enable;
|
||||||
|
bool full_screen;
|
||||||
} texture;
|
} texture;
|
||||||
#endif
|
#endif
|
||||||
bool apply_state_changes;
|
bool apply_state_changes;
|
||||||
@ -308,7 +309,7 @@ static void thread_loop(void *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (thr->poke && thr->poke->set_texture_enable)
|
if (thr->poke && thr->poke->set_texture_enable)
|
||||||
thr->poke->set_texture_enable(thr->driver_data, thr->texture.enable);
|
thr->poke->set_texture_enable(thr->driver_data, thr->texture.enable, thr->texture.full_screen);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (thr->apply_state_changes)
|
if (thr->apply_state_changes)
|
||||||
@ -655,12 +656,13 @@ static void thread_set_texture_frame(void *data, const void *frame,
|
|||||||
slock_unlock(thr->frame.lock);
|
slock_unlock(thr->frame.lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void thread_set_texture_enable(void *data, bool state)
|
static void thread_set_texture_enable(void *data, bool state, bool full_screen)
|
||||||
{
|
{
|
||||||
thread_video_t *thr = (thread_video_t*)data;
|
thread_video_t *thr = (thread_video_t*)data;
|
||||||
|
|
||||||
slock_lock(thr->frame.lock);
|
slock_lock(thr->frame.lock);
|
||||||
thr->texture.enable = state;
|
thr->texture.enable = state;
|
||||||
|
thr->texture.full_screen = full_screen;
|
||||||
slock_unlock(thr->frame.lock);
|
slock_unlock(thr->frame.lock);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user