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