mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-24 08:30:16 +00:00
(video context driver) has_Windowed can be degraded to a simple
boolean variable
This commit is contained in:
parent
dfc85f5908
commit
453cc3dcbd
@ -654,7 +654,7 @@ const gfx_ctx_driver_t gfx_ctx_android = {
|
||||
android_gfx_ctx_set_resize,
|
||||
android_gfx_ctx_has_focus,
|
||||
android_gfx_ctx_suppress_screensaver,
|
||||
NULL, /* has_windowed */
|
||||
false, /* has_windowed */
|
||||
android_gfx_ctx_swap_buffers,
|
||||
android_gfx_ctx_input_driver,
|
||||
android_gfx_ctx_get_proc_address,
|
||||
|
@ -367,7 +367,7 @@ const gfx_ctx_driver_t gfx_ctx_cgl = {
|
||||
NULL, /* set_resize */
|
||||
gfx_ctx_cgl_has_focus,
|
||||
gfx_ctx_cgl_suppress_screensaver,
|
||||
NULL, /* has_windowed */
|
||||
false, /* has_windowed */
|
||||
gfx_ctx_cgl_swap_buffers,
|
||||
gfx_ctx_cgl_input_driver,
|
||||
gfx_ctx_cgl_get_proc_address,
|
||||
|
@ -454,13 +454,6 @@ static bool cocoagl_gfx_ctx_suppress_screensaver(void *data, bool enable)
|
||||
return false;
|
||||
}
|
||||
|
||||
#if !defined(HAVE_COCOATOUCH)
|
||||
static bool cocoagl_gfx_ctx_has_windowed(void *data)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void cocoagl_gfx_ctx_input_driver(void *data,
|
||||
const char *name,
|
||||
const input_driver_t **input, void **input_data)
|
||||
@ -918,9 +911,9 @@ const gfx_ctx_driver_t gfx_ctx_cocoagl = {
|
||||
cocoagl_gfx_ctx_has_focus,
|
||||
cocoagl_gfx_ctx_suppress_screensaver,
|
||||
#if defined(HAVE_COCOATOUCH)
|
||||
NULL,
|
||||
false,
|
||||
#else
|
||||
cocoagl_gfx_ctx_has_windowed,
|
||||
true,
|
||||
#endif
|
||||
cocoagl_gfx_ctx_swap_buffers,
|
||||
cocoagl_gfx_ctx_input_driver,
|
||||
|
@ -967,7 +967,7 @@ const gfx_ctx_driver_t gfx_ctx_drm = {
|
||||
NULL, /* set_resize */
|
||||
gfx_ctx_drm_has_focus,
|
||||
gfx_ctx_drm_suppress_screensaver,
|
||||
NULL, /* has_windowed */
|
||||
false, /* has_windowed */
|
||||
gfx_ctx_drm_swap_buffers,
|
||||
gfx_ctx_drm_input_driver,
|
||||
gfx_ctx_drm_get_proc_address,
|
||||
|
@ -306,14 +306,6 @@ static bool gfx_ctx_emscripten_suppress_screensaver(void *data, bool enable)
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool gfx_ctx_emscripten_has_windowed(void *data)
|
||||
{
|
||||
(void)data;
|
||||
|
||||
/* TODO -verify. */
|
||||
return true;
|
||||
}
|
||||
|
||||
static float gfx_ctx_emscripten_translate_aspect(void *data,
|
||||
unsigned width, unsigned height)
|
||||
{
|
||||
@ -387,7 +379,7 @@ const gfx_ctx_driver_t gfx_ctx_emscripten = {
|
||||
NULL, /* set_resize */
|
||||
gfx_ctx_emscripten_has_focus,
|
||||
gfx_ctx_emscripten_suppress_screensaver,
|
||||
gfx_ctx_emscripten_has_windowed,
|
||||
false,
|
||||
gfx_ctx_emscripten_swap_buffers,
|
||||
gfx_ctx_emscripten_input_driver,
|
||||
gfx_ctx_emscripten_get_proc_address,
|
||||
|
@ -288,13 +288,6 @@ static bool gfx_ctx_gdi_suppress_screensaver(void *data, bool enable)
|
||||
return win32_suppress_screensaver(data, enable);
|
||||
}
|
||||
|
||||
static bool gfx_ctx_gdi_has_windowed(void *data)
|
||||
{
|
||||
(void)data;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool gfx_ctx_gdi_get_metrics(void *data,
|
||||
enum display_metric_types type, float *value)
|
||||
{
|
||||
@ -379,7 +372,7 @@ const gfx_ctx_driver_t gfx_ctx_gdi = {
|
||||
gfx_ctx_gdi_set_resize,
|
||||
gfx_ctx_gdi_has_focus,
|
||||
gfx_ctx_gdi_suppress_screensaver,
|
||||
gfx_ctx_gdi_has_windowed,
|
||||
true, /* has_windowed */
|
||||
gfx_ctx_gdi_swap_buffers,
|
||||
gfx_ctx_gdi_input_driver,
|
||||
NULL,
|
||||
|
@ -151,7 +151,7 @@ const gfx_ctx_driver_t gfx_ctx_null = {
|
||||
NULL, /* set_resize */
|
||||
gfx_ctx_null_has_focus,
|
||||
gfx_ctx_null_suppress_screensaver,
|
||||
NULL, /* has_windowed */
|
||||
false, /* has_windowed */
|
||||
gfx_ctx_null_swap_buffers,
|
||||
gfx_ctx_null_input_driver,
|
||||
NULL,
|
||||
|
@ -315,7 +315,7 @@ const gfx_ctx_driver_t gfx_ctx_khr_display = {
|
||||
gfx_ctx_khr_display_set_resize,
|
||||
gfx_ctx_khr_display_has_focus,
|
||||
gfx_ctx_khr_display_suppress_screensaver,
|
||||
NULL, /* has_windowed */
|
||||
false, /* has_windowed */
|
||||
gfx_ctx_khr_display_swap_buffers,
|
||||
gfx_ctx_khr_display_input_driver,
|
||||
gfx_ctx_khr_display_get_proc_address,
|
||||
|
@ -344,7 +344,7 @@ const gfx_ctx_driver_t gfx_ctx_mali_fbdev = {
|
||||
NULL, /* set_resize */
|
||||
gfx_ctx_mali_fbdev_has_focus,
|
||||
gfx_ctx_mali_fbdev_suppress_screensaver,
|
||||
NULL, /* has_windowed */
|
||||
false, /* has_windowed */
|
||||
gfx_ctx_mali_fbdev_swap_buffers,
|
||||
gfx_ctx_mali_fbdev_input_driver,
|
||||
gfx_ctx_mali_fbdev_get_proc_address,
|
||||
|
@ -284,7 +284,7 @@ const gfx_ctx_driver_t gfx_ctx_opendingux_fbdev = {
|
||||
NULL, /* set_resize */
|
||||
gfx_ctx_opendingux_has_focus,
|
||||
gfx_ctx_opendingux_suppress_screensaver,
|
||||
NULL, /* has_windowed */
|
||||
false, /* has_windowed */
|
||||
gfx_ctx_opendingux_swap_buffers,
|
||||
gfx_ctx_opendingux_input_driver,
|
||||
gfx_ctx_opendingux_get_proc_address,
|
||||
|
@ -326,7 +326,7 @@ const gfx_ctx_driver_t orbis_ctx = {
|
||||
NULL, /* set_resize */
|
||||
orbis_ctx_has_focus,
|
||||
orbis_ctx_suppress_screensaver,
|
||||
NULL, /* has_windowed */
|
||||
false, /* has_windowed */
|
||||
orbis_ctx_swap_buffers,
|
||||
orbis_ctx_input_driver,
|
||||
orbis_ctx_get_proc_address,
|
||||
|
@ -340,12 +340,6 @@ static bool osmesa_ctx_suppress_screensaver(void *data, bool enable)
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool osmesa_ctx_has_windowed(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return true;
|
||||
}
|
||||
|
||||
static void osmesa_ctx_swap_buffers(void *data, void *data2)
|
||||
{
|
||||
gfx_ctx_osmesa_data_t *osmesa = (gfx_ctx_osmesa_data_t*)data;
|
||||
@ -410,7 +404,7 @@ const gfx_ctx_driver_t gfx_ctx_osmesa =
|
||||
NULL, /* set_resize */
|
||||
osmesa_ctx_has_focus,
|
||||
osmesa_ctx_suppress_screensaver,
|
||||
osmesa_ctx_has_windowed,
|
||||
true, /* has_windowed */
|
||||
osmesa_ctx_swap_buffers,
|
||||
osmesa_ctx_input_driver,
|
||||
osmesa_ctx_get_proc_address,
|
||||
|
@ -457,7 +457,7 @@ const gfx_ctx_driver_t gfx_ctx_ps3 = {
|
||||
NULL, /* set_resize */
|
||||
gfx_ctx_ps3_has_focus,
|
||||
gfx_ctx_ps3_suppress_screensaver,
|
||||
NULL, /* has_windowed */
|
||||
false, /* has_windowed */
|
||||
gfx_ctx_ps3_swap_buffers,
|
||||
gfx_ctx_ps3_input_driver,
|
||||
NULL,
|
||||
|
@ -482,7 +482,7 @@ const gfx_ctx_driver_t gfx_ctx_qnx = {
|
||||
NULL, /* set_resize */
|
||||
gfx_ctx_qnx_has_focus,
|
||||
gfx_ctx_qnx_suppress_screensaver,
|
||||
NULL, /* has_windowed */
|
||||
false, /* has_windowed */
|
||||
gfx_ctx_qnx_swap_buffers,
|
||||
gfx_ctx_qnx_input_driver,
|
||||
gfx_ctx_qnx_get_proc_address,
|
||||
|
@ -366,12 +366,6 @@ static bool sdl_ctx_suppress_screensaver(void *data, bool enable)
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool sdl_ctx_has_windowed(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return true;
|
||||
}
|
||||
|
||||
static void sdl_ctx_swap_buffers(void *data, void *data2)
|
||||
{
|
||||
#ifdef HAVE_SDL2
|
||||
@ -434,7 +428,7 @@ const gfx_ctx_driver_t gfx_ctx_sdl_gl =
|
||||
NULL, /* set_resize */
|
||||
sdl_ctx_has_focus,
|
||||
sdl_ctx_suppress_screensaver,
|
||||
sdl_ctx_has_windowed,
|
||||
true, /* has_windowed */
|
||||
sdl_ctx_swap_buffers,
|
||||
sdl_ctx_input_driver,
|
||||
sdl_ctx_get_proc_address,
|
||||
|
@ -135,13 +135,6 @@ static bool gfx_ctx_sixel_suppress_screensaver(void *data, bool enable)
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool gfx_ctx_sixel_has_windowed(void *data)
|
||||
{
|
||||
(void)data;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool gfx_ctx_sixel_get_metrics(void *data,
|
||||
enum display_metric_types type, float *value)
|
||||
{
|
||||
@ -209,7 +202,7 @@ const gfx_ctx_driver_t gfx_ctx_sixel = {
|
||||
gfx_ctx_sixel_set_resize,
|
||||
gfx_ctx_sixel_has_focus,
|
||||
gfx_ctx_sixel_suppress_screensaver,
|
||||
gfx_ctx_sixel_has_windowed,
|
||||
true, /* has_windowed */
|
||||
gfx_ctx_sixel_swap_buffers,
|
||||
gfx_ctx_sixel_input_driver,
|
||||
NULL,
|
||||
|
@ -333,7 +333,7 @@ const gfx_ctx_driver_t switch_ctx = {
|
||||
NULL, /* set_resize */
|
||||
switch_ctx_has_focus,
|
||||
switch_ctx_suppress_screensaver,
|
||||
NULL, /* has_windowed */
|
||||
false, /* has_windowed */
|
||||
switch_ctx_swap_buffers,
|
||||
switch_ctx_input_driver,
|
||||
switch_ctx_get_proc_address,
|
||||
|
@ -725,7 +725,7 @@ const gfx_ctx_driver_t gfx_ctx_videocore = {
|
||||
NULL, /* set_resize */
|
||||
gfx_ctx_vc_has_focus,
|
||||
gfx_ctx_vc_suppress_screensaver,
|
||||
NULL, /* has_windowed */
|
||||
false, /* has_windowed */
|
||||
gfx_ctx_vc_swap_buffers,
|
||||
gfx_ctx_vc_input_driver,
|
||||
gfx_ctx_vc_get_proc_address,
|
||||
|
@ -291,7 +291,7 @@ const gfx_ctx_driver_t gfx_ctx_vivante_fbdev = {
|
||||
NULL, /* set_resize */
|
||||
gfx_ctx_vivante_has_focus,
|
||||
gfx_ctx_vivante_suppress_screensaver,
|
||||
NULL, /* has_windowed */
|
||||
false, /* has_windowed */
|
||||
gfx_ctx_vivante_swap_buffers,
|
||||
gfx_ctx_vivante_input_driver,
|
||||
gfx_ctx_vivante_get_proc_address,
|
||||
|
@ -1818,12 +1818,6 @@ static bool gfx_ctx_wl_suppress_screensaver(void *data, bool state)
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool gfx_ctx_wl_has_windowed(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return true;
|
||||
}
|
||||
|
||||
static enum gfx_ctx_api gfx_ctx_wl_get_api(void *data)
|
||||
{
|
||||
return wl_api;
|
||||
@ -2053,7 +2047,7 @@ const gfx_ctx_driver_t gfx_ctx_wayland = {
|
||||
gfx_ctx_wl_set_resize,
|
||||
gfx_ctx_wl_has_focus,
|
||||
gfx_ctx_wl_suppress_screensaver,
|
||||
gfx_ctx_wl_has_windowed,
|
||||
true, /* has_windowed */
|
||||
gfx_ctx_wl_swap_buffers,
|
||||
gfx_ctx_wl_input_driver,
|
||||
gfx_ctx_wl_get_proc_address,
|
||||
|
@ -724,13 +724,6 @@ static bool gfx_ctx_wgl_suppress_screensaver(void *data, bool enable)
|
||||
return win32_suppress_screensaver(data, enable);
|
||||
}
|
||||
|
||||
static bool gfx_ctx_wgl_has_windowed(void *data)
|
||||
{
|
||||
(void)data;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool gfx_ctx_wgl_get_metrics(void *data,
|
||||
enum display_metric_types type, float *value)
|
||||
{
|
||||
@ -894,7 +887,7 @@ const gfx_ctx_driver_t gfx_ctx_wgl = {
|
||||
gfx_ctx_wgl_set_resize,
|
||||
gfx_ctx_wgl_has_focus,
|
||||
gfx_ctx_wgl_suppress_screensaver,
|
||||
gfx_ctx_wgl_has_windowed,
|
||||
true, /* has_windowed */
|
||||
gfx_ctx_wgl_swap_buffers,
|
||||
gfx_ctx_wgl_input_driver,
|
||||
gfx_ctx_wgl_get_proc_address,
|
||||
|
@ -1028,12 +1028,6 @@ static bool gfx_ctx_x_suppress_screensaver(void *data, bool enable)
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool gfx_ctx_x_has_windowed(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return true;
|
||||
}
|
||||
|
||||
static gfx_ctx_proc_t gfx_ctx_x_get_proc_address(const char *symbol)
|
||||
{
|
||||
switch (x_api)
|
||||
@ -1260,7 +1254,7 @@ const gfx_ctx_driver_t gfx_ctx_x = {
|
||||
gfx_ctx_x_set_resize,
|
||||
x11_has_focus,
|
||||
gfx_ctx_x_suppress_screensaver,
|
||||
gfx_ctx_x_has_windowed,
|
||||
true, /* has_windowed */
|
||||
gfx_ctx_x_swap_buffers,
|
||||
gfx_ctx_x_input_driver,
|
||||
gfx_ctx_x_get_proc_address,
|
||||
|
@ -476,14 +476,6 @@ static bool gfx_ctx_xegl_suppress_screensaver(void *data, bool enable)
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool gfx_ctx_xegl_has_windowed(void *data)
|
||||
{
|
||||
(void)data;
|
||||
|
||||
/* TODO - verify if this has windowed mode or not. */
|
||||
return true;
|
||||
}
|
||||
|
||||
static enum gfx_ctx_api gfx_ctx_xegl_get_api(void *data)
|
||||
{
|
||||
return xegl_api;
|
||||
@ -646,7 +638,7 @@ const gfx_ctx_driver_t gfx_ctx_x_egl =
|
||||
NULL, /* set_resize */
|
||||
x11_has_focus,
|
||||
gfx_ctx_xegl_suppress_screensaver,
|
||||
gfx_ctx_xegl_has_windowed,
|
||||
true, /* has_windowed */
|
||||
gfx_ctx_xegl_swap_buffers,
|
||||
gfx_ctx_xegl_input_driver,
|
||||
gfx_ctx_xegl_get_proc_address,
|
||||
|
@ -18982,8 +18982,8 @@ bool video_driver_has_windowed(void)
|
||||
#if !(defined(RARCH_CONSOLE) || defined(RARCH_MOBILE))
|
||||
if (video_driver_data && current_video->has_windowed)
|
||||
return current_video->has_windowed(video_driver_data);
|
||||
else if (video_context_data && current_video_context.has_windowed)
|
||||
return current_video_context.has_windowed(video_context_data);
|
||||
else if (video_context_data)
|
||||
return current_video_context.has_windowed;
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
@ -1282,7 +1282,7 @@ typedef struct gfx_ctx_driver
|
||||
bool (*suppress_screensaver)(void *data, bool enable);
|
||||
|
||||
/* Checks if context driver has windowed support. */
|
||||
bool (*has_windowed)(void*);
|
||||
bool has_windowed;
|
||||
|
||||
/* Swaps buffers. VBlank sync depends on
|
||||
* earlier calls to swap_interval. */
|
||||
|
Loading…
Reference in New Issue
Block a user