Add full screen mode to set_texture_enable.

This commit is contained in:
Themaister 2013-04-13 16:48:03 +02:00
parent 3ae5662dd2
commit c17714ffbb
6 changed files with 22 additions and 8 deletions

View File

@ -341,7 +341,7 @@ typedef struct video_poke_interface
#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_enable)(void *data, bool enable); // Enable/disable rendering.
void (*set_texture_enable)(void *data, bool enable, bool full_screen); // Enable/disable rendering.
#endif
void (*set_osd_msg)(void *data, const char *msg, void *userdata);

View File

@ -2163,13 +2163,13 @@ bool menu_iterate(void)
{
driver.video_poke->set_texture_frame(driver.video_data, menu_framebuf,
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();
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);

View File

@ -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);
}
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);
}
#endif

View File

@ -1286,7 +1286,16 @@ static inline void gl_draw_texture(void *data)
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
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);
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]);
}
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->rgui_texture_enable = state;
gl->rgui_texture_full_screen = full_screen;
}
#endif

View File

@ -278,6 +278,7 @@ typedef struct gl
#if defined(HAVE_RGUI) || defined(HAVE_RMENU)
GLuint rgui_texture;
bool rgui_texture_enable;
bool rgui_texture_full_screen;
GLfloat rgui_texture_alpha;
#endif

View File

@ -81,6 +81,7 @@ typedef struct thread_video
unsigned height;
float alpha;
bool enable;
bool full_screen;
} texture;
#endif
bool apply_state_changes;
@ -308,7 +309,7 @@ static void thread_loop(void *data)
}
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
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);
}
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;
slock_lock(thr->frame.lock);
thr->texture.enable = state;
thr->texture.full_screen = full_screen;
slock_unlock(thr->frame.lock);
}
#endif