mirror of
https://github.com/libretro/RetroArch
synced 2025-03-28 08:37:41 +00:00
Init gl handle early.
This commit is contained in:
parent
a61e52b419
commit
9aaf878908
20
gfx/gl.c
20
gfx/gl.c
@ -946,9 +946,16 @@ static void *gl_init(const video_info_t *video, const input_driver_t **input, vo
|
||||
gfx_set_dwm();
|
||||
#endif
|
||||
|
||||
if (!gfx_ctx_init())
|
||||
gl_t *gl = (gl_t*)calloc(1, sizeof(gl_t));
|
||||
if (!gl)
|
||||
return NULL;
|
||||
|
||||
if (!gfx_ctx_init())
|
||||
{
|
||||
free(gl);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
unsigned full_x = 0, full_y = 0;
|
||||
gfx_ctx_get_video_size(&full_x, &full_y);
|
||||
RARCH_LOG("Detecting desktop resolution %ux%u.\n", full_x, full_y);
|
||||
@ -965,7 +972,10 @@ static void *gl_init(const video_info_t *video, const input_driver_t **input, vo
|
||||
|
||||
if (!gfx_ctx_set_video_mode(win_width, win_height,
|
||||
g_settings.video.force_16bit ? 15 : 0, video->fullscreen))
|
||||
{
|
||||
free(gl);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
gfx_ctx_update_window_title(true);
|
||||
|
||||
@ -977,17 +987,11 @@ static void *gl_init(const video_info_t *video, const input_driver_t **input, vo
|
||||
if (!load_gl_proc())
|
||||
{
|
||||
gfx_ctx_destroy();
|
||||
free(gl);
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
gl_t *gl = (gl_t*)calloc(1, sizeof(gl_t));
|
||||
if (!gl)
|
||||
{
|
||||
gfx_ctx_destroy();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
gl->vsync = video->vsync;
|
||||
gl->fullscreen = video->fullscreen;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user