Check if gl->ctx_driver is non-NULL first in gl_frame

This commit is contained in:
twinaphex 2014-10-06 16:59:21 +02:00
parent 04fe800261
commit 8dc4f66c06

View File

@ -1493,6 +1493,7 @@ static bool gl_frame(void *data, const void *frame,
if (gl->should_resize)
{
gl->should_resize = false;
if (gl->ctx_driver)
gl->ctx_driver->set_resize(gl, gl->win_width, gl->win_height);
#ifdef HAVE_FBO
@ -1600,6 +1601,7 @@ static bool gl_frame(void *data, const void *frame,
gl_render_overlay(gl);
#endif
if (gl->ctx_driver)
gl->ctx_driver->update_window_title(gl);
RARCH_PERFORMANCE_STOP(frame_run);
@ -1643,10 +1645,12 @@ static bool gl_frame(void *data, const void *frame,
!driver.nonblock_state && !g_extern.is_slowmotion
&& !g_extern.is_paused)
{
if (gl->ctx_driver)
gl->ctx_driver->swap_buffers(gl);
glClear(GL_COLOR_BUFFER_BIT);
}
if (gl->ctx_driver)
gl->ctx_driver->swap_buffers(gl);
g_extern.frame_count++;