(GLCore) Don't use video_driver_get_size
This commit is contained in:
parent
c0bfbd1ae8
commit
e43c55bef3
|
@ -103,6 +103,9 @@ typedef struct gl_core
|
||||||
struct gl_core_buffer_locations bokeh_loc;
|
struct gl_core_buffer_locations bokeh_loc;
|
||||||
} pipelines;
|
} pipelines;
|
||||||
|
|
||||||
|
unsigned video_width;
|
||||||
|
unsigned video_height;
|
||||||
|
|
||||||
GLuint *overlay_tex;
|
GLuint *overlay_tex;
|
||||||
float *overlay_vertex_coord;
|
float *overlay_vertex_coord;
|
||||||
float *overlay_tex_coord;
|
float *overlay_tex_coord;
|
||||||
|
|
|
@ -1083,6 +1083,8 @@ static void *gl_core_init(const video_info_t *video,
|
||||||
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);
|
||||||
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("[GLCore]: Using resolution %ux%u\n", temp_width, temp_height);
|
RARCH_LOG("[GLCore]: Using resolution %ux%u\n", temp_width, temp_height);
|
||||||
|
|
||||||
|
@ -1325,16 +1327,13 @@ static void gl_core_free(void *data)
|
||||||
|
|
||||||
static bool gl_core_alive(void *data)
|
static bool gl_core_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_core_t *gl = (gl_core_t*)data;
|
gl_core_t *gl = (gl_core_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);
|
||||||
|
@ -1347,7 +1346,11 @@ static bool gl_core_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;
|
||||||
}
|
}
|
||||||
|
@ -1428,11 +1431,11 @@ static void gl_core_set_rotation(void *data, unsigned rotation)
|
||||||
|
|
||||||
static void gl_core_viewport_info(void *data, struct video_viewport *vp)
|
static void gl_core_viewport_info(void *data, struct video_viewport *vp)
|
||||||
{
|
{
|
||||||
unsigned width, height;
|
|
||||||
unsigned top_y, top_dist;
|
unsigned top_y, top_dist;
|
||||||
gl_core_t *gl = (gl_core_t*)data;
|
gl_core_t *gl = (gl_core_t*)data;
|
||||||
|
unsigned width = gl->video_width;
|
||||||
|
unsigned height = gl->video_height;
|
||||||
|
|
||||||
video_driver_get_size(&width, &height);
|
|
||||||
|
|
||||||
*vp = gl->vp;
|
*vp = gl->vp;
|
||||||
vp->full_width = width;
|
vp->full_width = width;
|
||||||
|
|
Loading…
Reference in New Issue