Assert that there is only one backend renderer

This commit is contained in:
Aaron Culliney 2015-06-22 22:21:27 -07:00
parent 5b7afea0b4
commit c4397123cb
2 changed files with 4 additions and 0 deletions

View File

@ -893,6 +893,8 @@ __attribute__((constructor(CTOR_PRIORITY_EARLY)))
static void _init_glvideo(void) {
LOG("Initializing OpenGL renderer");
assert((video_backend == NULL) && "there can only be one!");
glvideo_backend.init = &gldriver_init;
glvideo_backend.main_loop = &gldriver_main_loop;
glvideo_backend.reshape = &gldriver_reshape;

View File

@ -942,6 +942,8 @@ __attribute__((constructor(CTOR_PRIORITY_EARLY)))
static void _init_xvideo(void) {
LOG("Initializing X11 renderer");
assert((video_backend == NULL) && "there can only be one!");
xvideo_backend.init = &xdriver_init;
xvideo_backend.main_loop = &xdriver_main_loop;
xvideo_backend.reshape = &xdriver_reshape;