(video_context_driver.c) Simplifications

This commit is contained in:
twinaphex 2016-11-20 14:52:50 +01:00
parent 205e7cf272
commit 06c86f0852
1 changed files with 21 additions and 22 deletions

View File

@ -332,10 +332,8 @@ bool video_context_driver_bind_hw_render(bool *enable)
void video_context_driver_make_current(bool release) void video_context_driver_make_current(bool release)
{ {
if (!current_video_context || !current_video_context->make_current) if (current_video_context && current_video_context->make_current)
return; current_video_context->make_current(release);
current_video_context->make_current(release);
} }
bool video_context_driver_set(const gfx_ctx_driver_t *data) bool video_context_driver_set(const gfx_ctx_driver_t *data)
@ -353,27 +351,30 @@ void video_context_driver_destroy(void)
bool video_context_driver_update_window_title(void) bool video_context_driver_update_window_title(void)
{ {
if (!current_video_context || !current_video_context->update_window_title) if (current_video_context && current_video_context->update_window_title)
return false; {
current_video_context->update_window_title(video_context_data); current_video_context->update_window_title(video_context_data);
return true; return true;
}
return false;
} }
bool video_context_driver_swap_buffers(void) bool video_context_driver_swap_buffers(void)
{ {
if (!current_video_context || !current_video_context->swap_buffers) if (current_video_context && current_video_context->swap_buffers)
return false; {
current_video_context->swap_buffers(video_context_data); current_video_context->swap_buffers(video_context_data);
return true; return true;
}
return false;
} }
bool video_context_driver_focus(void) bool video_context_driver_focus(void)
{ {
if (!video_context_data || !current_video_context->has_focus) if (video_context_data && current_video_context->has_focus &&
return false; current_video_context->has_focus(video_context_data))
if (!current_video_context->has_focus(video_context_data)) return true;
return false; return false;
return true;
} }
bool video_context_driver_translate_aspect(gfx_ctx_aspect_t *aspect) bool video_context_driver_translate_aspect(gfx_ctx_aspect_t *aspect)
@ -389,11 +390,9 @@ bool video_context_driver_translate_aspect(gfx_ctx_aspect_t *aspect)
bool video_context_driver_has_windowed(void) bool video_context_driver_has_windowed(void)
{ {
if (!video_context_data) if (video_context_data && current_video_context->has_windowed(video_context_data))
return false; return true;
if (!current_video_context->has_windowed(video_context_data)) return false;
return false;
return true;
} }
void video_context_driver_free(void) void video_context_driver_free(void)