mirror of
https://github.com/libretro/RetroArch
synced 2025-04-01 04:20:27 +00:00
(GL) Start avoiding usage of video_driver_get_size
from within video drivers
This commit is contained in:
parent
efd6694ce8
commit
c3d624267b
@ -211,6 +211,9 @@ struct gl
|
|||||||
GLuint video_layout_white_texture;
|
GLuint video_layout_white_texture;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
unsigned video_width;
|
||||||
|
unsigned video_height;
|
||||||
|
|
||||||
unsigned tex_index; /* For use with PREV. */
|
unsigned tex_index; /* For use with PREV. */
|
||||||
unsigned textures;
|
unsigned textures;
|
||||||
unsigned fbo_feedback_pass;
|
unsigned fbo_feedback_pass;
|
||||||
|
@ -1111,7 +1111,8 @@ static void gl2_renderchain_init(
|
|||||||
if (!gl || shader_info.num == 0)
|
if (!gl || shader_info.num == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
video_driver_get_size(&width, &height);
|
width = gl->video_width;
|
||||||
|
height = gl->video_height;
|
||||||
|
|
||||||
scaler.idx = 1;
|
scaler.idx = 1;
|
||||||
scaler.scale = &scale;
|
scaler.scale = &scale;
|
||||||
@ -2286,11 +2287,12 @@ static void gl2_init_textures(gl_t *gl, const video_info_t *video)
|
|||||||
|
|
||||||
static INLINE void gl2_set_shader_viewports(gl_t *gl)
|
static INLINE void gl2_set_shader_viewports(gl_t *gl)
|
||||||
{
|
{
|
||||||
unsigned i, width, height;
|
unsigned i;
|
||||||
video_frame_info_t video_info;
|
video_frame_info_t video_info;
|
||||||
|
unsigned width = gl->video_width;
|
||||||
|
unsigned height = gl->video_height;
|
||||||
|
|
||||||
video_driver_build_info(&video_info);
|
video_driver_build_info(&video_info);
|
||||||
video_driver_get_size(&width, &height);
|
|
||||||
|
|
||||||
for (i = 0; i < 2; i++)
|
for (i = 0; i < 2; i++)
|
||||||
{
|
{
|
||||||
@ -3774,6 +3776,8 @@ static void *gl2_init(const video_info_t *video,
|
|||||||
video_driver_set_size(&temp_width, &temp_height);
|
video_driver_set_size(&temp_width, &temp_height);
|
||||||
|
|
||||||
video_driver_get_size(&temp_width, &temp_height);
|
video_driver_get_size(&temp_width, &temp_height);
|
||||||
|
gl->video_width = temp_width;
|
||||||
|
gl->video_height = temp_height;
|
||||||
|
|
||||||
RARCH_LOG("[GL]: Using resolution %ux%u\n", temp_width, temp_height);
|
RARCH_LOG("[GL]: Using resolution %ux%u\n", temp_width, temp_height);
|
||||||
|
|
||||||
@ -3940,16 +3944,13 @@ error:
|
|||||||
|
|
||||||
static bool gl2_alive(void *data)
|
static bool gl2_alive(void *data)
|
||||||
{
|
{
|
||||||
unsigned temp_width = 0;
|
|
||||||
unsigned temp_height = 0;
|
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
bool quit = false;
|
bool quit = false;
|
||||||
bool resize = false;
|
bool resize = false;
|
||||||
gl_t *gl = (gl_t*)data;
|
gl_t *gl = (gl_t*)data;
|
||||||
bool is_shutdown = rarch_ctl(RARCH_CTL_IS_SHUTDOWN, NULL);
|
bool is_shutdown = rarch_ctl(RARCH_CTL_IS_SHUTDOWN, NULL);
|
||||||
|
unsigned temp_width = gl->video_width;
|
||||||
/* Needed because some context drivers don't track their sizes */
|
unsigned temp_height = gl->video_height;
|
||||||
video_driver_get_size(&temp_width, &temp_height);
|
|
||||||
|
|
||||||
gl->ctx_driver->check_window(gl->ctx_data,
|
gl->ctx_driver->check_window(gl->ctx_data,
|
||||||
&quit, &resize, &temp_width, &temp_height, is_shutdown);
|
&quit, &resize, &temp_width, &temp_height, is_shutdown);
|
||||||
@ -3962,7 +3963,11 @@ static bool gl2_alive(void *data)
|
|||||||
ret = !gl->quitting;
|
ret = !gl->quitting;
|
||||||
|
|
||||||
if (temp_width != 0 && temp_height != 0)
|
if (temp_width != 0 && temp_height != 0)
|
||||||
|
{
|
||||||
video_driver_set_size(&temp_width, &temp_height);
|
video_driver_set_size(&temp_width, &temp_height);
|
||||||
|
gl->video_width = temp_width;
|
||||||
|
gl->video_height = temp_height;
|
||||||
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -4127,11 +4132,10 @@ error:
|
|||||||
|
|
||||||
static void gl2_viewport_info(void *data, struct video_viewport *vp)
|
static void gl2_viewport_info(void *data, struct video_viewport *vp)
|
||||||
{
|
{
|
||||||
unsigned width, height;
|
|
||||||
unsigned top_y, top_dist;
|
unsigned top_y, top_dist;
|
||||||
gl_t *gl = (gl_t*)data;
|
gl_t *gl = (gl_t*)data;
|
||||||
|
unsigned width = gl->video_width;
|
||||||
video_driver_get_size(&width, &height);
|
unsigned height = gl->video_height;
|
||||||
|
|
||||||
*vp = gl->vp;
|
*vp = gl->vp;
|
||||||
vp->full_width = width;
|
vp->full_width = width;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user