mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-24 16:39:43 +00:00
(Context drivers) Add get_flags function
This commit is contained in:
parent
cc0f8160b5
commit
a0425dfb14
@ -537,6 +537,12 @@ static void *android_gfx_ctx_get_context_data(void *data)
|
||||
}
|
||||
#endif
|
||||
|
||||
static uint32_t android_gfx_ctx_get_flags(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return GFX_CTX_FLAGS_NONE;
|
||||
}
|
||||
|
||||
const gfx_ctx_driver_t gfx_ctx_android = {
|
||||
android_gfx_ctx_init,
|
||||
android_gfx_ctx_destroy,
|
||||
@ -562,6 +568,7 @@ const gfx_ctx_driver_t gfx_ctx_android = {
|
||||
NULL,
|
||||
NULL,
|
||||
"android",
|
||||
android_gfx_ctx_get_flags,
|
||||
android_gfx_ctx_bind_hw_render,
|
||||
#ifdef HAVE_VULKAN
|
||||
android_gfx_ctx_get_context_data
|
||||
|
@ -398,6 +398,12 @@ static void gfx_ctx_qnx_get_video_size(void *data,
|
||||
#endif
|
||||
}
|
||||
|
||||
static uint32_t gfx_ctx_qnx_get_flags(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return GFX_CTX_FLAGS_NONE;
|
||||
}
|
||||
|
||||
const gfx_ctx_driver_t gfx_ctx_bbqnx = {
|
||||
gfx_ctx_qnx_init,
|
||||
gfx_ctx_qnx_destroy,
|
||||
@ -423,5 +429,6 @@ const gfx_ctx_driver_t gfx_ctx_bbqnx = {
|
||||
NULL,
|
||||
NULL,
|
||||
"blackberry_qnx",
|
||||
gfx_ctx_qnx_bind_hw_render,
|
||||
gfx_ctx_qnx_get_flags,
|
||||
gfx_ctx_qnx_bind_hw_render
|
||||
};
|
||||
|
@ -340,6 +340,12 @@ error:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static uint32_t gfx_ctx_cgl_get_flags(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return GFX_CTX_FLAGS_NONE;
|
||||
}
|
||||
|
||||
const gfx_ctx_driver_t gfx_ctx_cgl = {
|
||||
gfx_ctx_cgl_init,
|
||||
gfx_ctx_cgl_destroy,
|
||||
@ -365,5 +371,6 @@ const gfx_ctx_driver_t gfx_ctx_cgl = {
|
||||
NULL,
|
||||
gfx_ctx_cgl_show_mouse,
|
||||
"cgl",
|
||||
gfx_ctx_cgl_get_flags,
|
||||
gfx_ctx_cgl_bind_hw_render,
|
||||
};
|
||||
|
@ -595,6 +595,12 @@ static void cocoagl_gfx_ctx_bind_hw_render(void *data, bool enable)
|
||||
[g_context makeCurrentContext];
|
||||
}
|
||||
|
||||
static uint32_t cocoagl_gfx_ctx_get_flags(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return GFX_CTX_FLAGS_NONE;
|
||||
}
|
||||
|
||||
const gfx_ctx_driver_t gfx_ctx_cocoagl = {
|
||||
cocoagl_gfx_ctx_init,
|
||||
cocoagl_gfx_ctx_destroy,
|
||||
@ -620,5 +626,6 @@ const gfx_ctx_driver_t gfx_ctx_cocoagl = {
|
||||
NULL,
|
||||
NULL,
|
||||
"cocoagl",
|
||||
cocoagl_gfx_ctx_get_flags,
|
||||
cocoagl_gfx_ctx_bind_hw_render,
|
||||
};
|
||||
|
@ -302,6 +302,12 @@ static bool gfx_ctx_d3d_get_metrics(void *data,
|
||||
return win32_get_metrics(data, type, value);
|
||||
}
|
||||
|
||||
static uint32_t gfx_ctx_d3d_get_flags(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return GFX_CTX_FLAGS_NONE;
|
||||
}
|
||||
|
||||
const gfx_ctx_driver_t gfx_ctx_d3d = {
|
||||
gfx_ctx_d3d_init,
|
||||
gfx_ctx_d3d_destroy,
|
||||
@ -327,4 +333,5 @@ const gfx_ctx_driver_t gfx_ctx_d3d = {
|
||||
NULL,
|
||||
gfx_ctx_d3d_show_mouse,
|
||||
"d3d",
|
||||
gfx_ctx_d3d_get_flags,
|
||||
};
|
||||
|
@ -870,6 +870,12 @@ static void gfx_ctx_drm_bind_hw_render(void *data, bool enable)
|
||||
}
|
||||
}
|
||||
|
||||
static uint32_t gfx_ctx_drm_get_flags(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return GFX_CTX_FLAGS_NONE;
|
||||
}
|
||||
|
||||
const gfx_ctx_driver_t gfx_ctx_drm = {
|
||||
gfx_ctx_drm_init,
|
||||
gfx_ctx_drm_destroy,
|
||||
@ -895,5 +901,6 @@ const gfx_ctx_driver_t gfx_ctx_drm = {
|
||||
NULL,
|
||||
NULL,
|
||||
"kms",
|
||||
gfx_ctx_drm_bind_hw_render,
|
||||
gfx_ctx_drm_get_flags,
|
||||
gfx_ctx_drm_bind_hw_render
|
||||
};
|
||||
|
@ -303,6 +303,12 @@ static void gfx_ctx_emscripten_bind_hw_render(void *data, bool enable)
|
||||
#endif
|
||||
}
|
||||
|
||||
static uint32_t gfx_ctx_emscripten_get_flags(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return GFX_CTX_FLAGS_NONE;
|
||||
}
|
||||
|
||||
const gfx_ctx_driver_t gfx_ctx_emscripten = {
|
||||
gfx_ctx_emscripten_init,
|
||||
gfx_ctx_emscripten_destroy,
|
||||
@ -328,5 +334,6 @@ const gfx_ctx_driver_t gfx_ctx_emscripten = {
|
||||
gfx_ctx_emscripten_write_egl_image,
|
||||
NULL,
|
||||
"emscripten",
|
||||
gfx_ctx_emscripten_bind_hw_render,
|
||||
gfx_ctx_emscripten_get_flags,
|
||||
gfx_ctx_emscripten_bind_hw_render
|
||||
};
|
||||
|
@ -133,6 +133,12 @@ static void *gfx_ctx_null_init(void *video_driver)
|
||||
return (void*)"null";
|
||||
}
|
||||
|
||||
static uint32_t gfx_ctx_null_get_flags(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return GFX_CTX_FLAGS_NONE;
|
||||
}
|
||||
|
||||
const gfx_ctx_driver_t gfx_ctx_null = {
|
||||
gfx_ctx_null_init,
|
||||
gfx_ctx_null_destroy,
|
||||
@ -158,6 +164,7 @@ const gfx_ctx_driver_t gfx_ctx_null = {
|
||||
NULL,
|
||||
gfx_ctx_null_show_mouse,
|
||||
"null",
|
||||
gfx_ctx_null_bind_hw_render,
|
||||
gfx_ctx_null_get_flags,
|
||||
gfx_ctx_null_bind_hw_render
|
||||
};
|
||||
|
||||
|
@ -291,6 +291,12 @@ static void gfx_ctx_mali_fbdev_bind_hw_render(void *data, bool enable)
|
||||
#endif
|
||||
}
|
||||
|
||||
static uint32_t gfx_ctx_mali_fbdev_get_flags(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return GFX_CTX_FLAGS_NONE;
|
||||
}
|
||||
|
||||
const gfx_ctx_driver_t gfx_ctx_mali_fbdev = {
|
||||
gfx_ctx_mali_fbdev_init,
|
||||
gfx_ctx_mali_fbdev_destroy,
|
||||
@ -316,6 +322,7 @@ const gfx_ctx_driver_t gfx_ctx_mali_fbdev = {
|
||||
NULL,
|
||||
NULL,
|
||||
"mali-fbdev",
|
||||
gfx_ctx_mali_fbdev_get_flags,
|
||||
gfx_ctx_mali_fbdev_bind_hw_render
|
||||
};
|
||||
|
||||
|
@ -267,6 +267,12 @@ static void gfx_ctx_opendingux_bind_hw_render(void *data, bool enable)
|
||||
#endif
|
||||
}
|
||||
|
||||
static uint32_t gfx_ctx_opendingux_get_flags(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return GFX_CTX_FLAGS_NONE;
|
||||
}
|
||||
|
||||
const gfx_ctx_driver_t gfx_ctx_opendingux_fbdev = {
|
||||
gfx_ctx_opendingux_init,
|
||||
gfx_ctx_opendingux_destroy,
|
||||
@ -292,5 +298,6 @@ const gfx_ctx_driver_t gfx_ctx_opendingux_fbdev = {
|
||||
NULL,
|
||||
NULL,
|
||||
"opendingux-fbdev",
|
||||
gfx_ctx_opendingux_get_flags,
|
||||
gfx_ctx_opendingux_bind_hw_render
|
||||
};
|
||||
|
@ -414,6 +414,12 @@ static void gfx_ctx_ps3_get_video_output_next(void *data)
|
||||
}
|
||||
}
|
||||
|
||||
static uint32_t gfx_ctx_ps3_get_flags(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return GFX_CTX_FLAGS_NONE;
|
||||
}
|
||||
|
||||
const gfx_ctx_driver_t gfx_ctx_ps3 = {
|
||||
gfx_ctx_ps3_init,
|
||||
gfx_ctx_ps3_destroy,
|
||||
@ -439,5 +445,6 @@ const gfx_ctx_driver_t gfx_ctx_ps3 = {
|
||||
NULL,
|
||||
NULL,
|
||||
"ps3",
|
||||
gfx_ctx_ps3_get_flags,
|
||||
};
|
||||
|
||||
|
@ -400,6 +400,12 @@ static void sdl_ctx_show_mouse(void *data, bool state)
|
||||
SDL_ShowCursor(state);
|
||||
}
|
||||
|
||||
static uint32_t sdl_ctx_get_flags(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return GFX_CTX_FLAGS_NONE;
|
||||
}
|
||||
|
||||
const gfx_ctx_driver_t gfx_ctx_sdl_gl =
|
||||
{
|
||||
sdl_ctx_init,
|
||||
@ -426,5 +432,6 @@ const gfx_ctx_driver_t gfx_ctx_sdl_gl =
|
||||
NULL,
|
||||
sdl_ctx_show_mouse,
|
||||
"sdl_gl",
|
||||
sdl_ctx_get_flags,
|
||||
NULL /* bind_hw_render */
|
||||
};
|
||||
|
@ -624,6 +624,12 @@ static gfx_ctx_proc_t gfx_ctx_vc_get_proc_address(const char *symbol)
|
||||
#endif
|
||||
}
|
||||
|
||||
static uint32_t gfx_ctx_vc_get_flags(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return GFX_CTX_FLAGS_NONE;
|
||||
}
|
||||
|
||||
const gfx_ctx_driver_t gfx_ctx_videocore = {
|
||||
gfx_ctx_vc_init,
|
||||
gfx_ctx_vc_destroy,
|
||||
@ -649,5 +655,6 @@ const gfx_ctx_driver_t gfx_ctx_videocore = {
|
||||
gfx_ctx_vc_image_buffer_write,
|
||||
NULL,
|
||||
"videocore",
|
||||
gfx_ctx_vc_bind_hw_render,
|
||||
gfx_ctx_vc_get_flags,
|
||||
gfx_ctx_vc_bind_hw_render
|
||||
};
|
||||
|
@ -261,6 +261,12 @@ static void gfx_ctx_vivante_swap_buffers(void *data)
|
||||
#endif
|
||||
}
|
||||
|
||||
static uint32_t gfx_ctx_vivante_get_flags(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return GFX_CTX_FLAGS_NONE;
|
||||
}
|
||||
|
||||
const gfx_ctx_driver_t gfx_ctx_vivante_fbdev = {
|
||||
gfx_ctx_vivante_init,
|
||||
gfx_ctx_vivante_destroy,
|
||||
@ -286,5 +292,6 @@ const gfx_ctx_driver_t gfx_ctx_vivante_fbdev = {
|
||||
NULL,
|
||||
NULL,
|
||||
"vivante-fbdev",
|
||||
gfx_ctx_vivante_bind_hw_render,
|
||||
gfx_ctx_vivante_get_flags,
|
||||
gfx_ctx_vivante_bind_hw_render
|
||||
};
|
||||
|
@ -1138,6 +1138,12 @@ static void gfx_ctx_wl_bind_hw_render(void *data, bool enable)
|
||||
}
|
||||
}
|
||||
|
||||
static uint32_t gfx_ctx_wl_get_flags(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return GFX_CTX_FLAGS_NONE;
|
||||
}
|
||||
|
||||
const gfx_ctx_driver_t gfx_ctx_wayland = {
|
||||
gfx_ctx_wl_init,
|
||||
gfx_ctx_wl_destroy,
|
||||
@ -1163,6 +1169,7 @@ const gfx_ctx_driver_t gfx_ctx_wayland = {
|
||||
NULL,
|
||||
NULL,
|
||||
"wayland",
|
||||
gfx_ctx_wl_get_flags,
|
||||
gfx_ctx_wl_bind_hw_render,
|
||||
#ifdef HAVE_VULKAN
|
||||
gfx_ctx_wl_get_context_data
|
||||
|
@ -448,6 +448,12 @@ static void gfx_ctx_wgl_bind_hw_render(void *data, bool enable)
|
||||
wglMakeCurrent(g_hdc, enable ? g_hw_hrc : g_hrc);
|
||||
}
|
||||
|
||||
static uint32_t gfx_ctx_wgl_get_flags(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return GFX_CTX_FLAGS_NONE;
|
||||
}
|
||||
|
||||
const gfx_ctx_driver_t gfx_ctx_wgl = {
|
||||
gfx_ctx_wgl_init,
|
||||
gfx_ctx_wgl_destroy,
|
||||
@ -473,6 +479,7 @@ const gfx_ctx_driver_t gfx_ctx_wgl = {
|
||||
NULL,
|
||||
gfx_ctx_wgl_show_mouse,
|
||||
"wgl",
|
||||
gfx_ctx_wgl_bind_hw_render,
|
||||
gfx_ctx_wgl_get_flags,
|
||||
gfx_ctx_wgl_bind_hw_render
|
||||
};
|
||||
|
||||
|
@ -886,6 +886,12 @@ static void *gfx_ctx_x_get_context_data(void *data)
|
||||
}
|
||||
#endif
|
||||
|
||||
static uint32_t gfx_ctx_x_get_flags(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return GFX_CTX_FLAGS_NONE;
|
||||
}
|
||||
|
||||
const gfx_ctx_driver_t gfx_ctx_x = {
|
||||
gfx_ctx_x_init,
|
||||
gfx_ctx_x_destroy,
|
||||
@ -911,6 +917,7 @@ const gfx_ctx_driver_t gfx_ctx_x = {
|
||||
NULL,
|
||||
gfx_ctx_x_show_mouse,
|
||||
"x",
|
||||
gfx_ctx_x_get_flags,
|
||||
|
||||
gfx_ctx_x_bind_hw_render,
|
||||
#ifdef HAVE_VULKAN
|
||||
|
@ -574,6 +574,12 @@ static gfx_ctx_proc_t gfx_ctx_xegl_get_proc_address(const char *symbol)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static uint32_t gfx_ctx_xegl_get_flags(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return GFX_CTX_FLAGS_NONE;
|
||||
}
|
||||
|
||||
const gfx_ctx_driver_t gfx_ctx_x_egl =
|
||||
{
|
||||
gfx_ctx_xegl_init,
|
||||
@ -600,5 +606,6 @@ const gfx_ctx_driver_t gfx_ctx_x_egl =
|
||||
NULL,
|
||||
gfx_ctx_xegl_show_mouse,
|
||||
"x-egl",
|
||||
gfx_ctx_xegl_bind_hw_render,
|
||||
gfx_ctx_xegl_get_flags,
|
||||
gfx_ctx_xegl_bind_hw_render
|
||||
};
|
||||
|
@ -52,6 +52,12 @@ enum display_metric_types
|
||||
DISPLAY_METRIC_DPI
|
||||
};
|
||||
|
||||
enum display_flags
|
||||
{
|
||||
GFX_CTX_FLAGS_NONE = 0,
|
||||
GFX_CTX_FLAGS_CORE_GL
|
||||
};
|
||||
|
||||
enum gfx_ctx_ctl_state
|
||||
{
|
||||
GFX_CTL_NONE = 0,
|
||||
@ -182,6 +188,8 @@ typedef struct gfx_ctx_driver
|
||||
/* Human readable string. */
|
||||
const char *ident;
|
||||
|
||||
uint32_t (*get_flags)(void *data);
|
||||
|
||||
/* Optional. Binds HW-render offscreen context. */
|
||||
void (*bind_hw_render)(void *data, bool enable);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user