Uniquely name each static function for GLX context driver

This commit is contained in:
twinaphex 2014-10-08 18:12:18 +02:00
parent 8cbeeab39f
commit 1cee15a118
1 changed files with 43 additions and 38 deletions

View File

@ -83,10 +83,12 @@ static int nul_handler(Display *dpy, XErrorEvent *event)
return 0; return 0;
} }
static void gfx_ctx_get_video_size(void *data, unsigned *width, unsigned *height); static void gfx_ctx_glx_get_video_size(void *data,
static void gfx_ctx_destroy(void *data); unsigned *width, unsigned *height);
static void gfx_ctx_swap_interval(void *data, unsigned interval) static void gfx_ctx_glx_destroy(void *data);
static void gfx_ctx_glx_swap_interval(void *data, unsigned interval)
{ {
(void)data; (void)data;
g_interval = interval; g_interval = interval;
@ -104,13 +106,13 @@ static void gfx_ctx_swap_interval(void *data, unsigned interval)
} }
} }
static void gfx_ctx_check_window(void *data, bool *quit, static void gfx_ctx_glx_check_window(void *data, bool *quit,
bool *resize, unsigned *width, unsigned *height, unsigned frame_count) bool *resize, unsigned *width, unsigned *height, unsigned frame_count)
{ {
(void)frame_count; (void)frame_count;
unsigned new_width = *width, new_height = *height; unsigned new_width = *width, new_height = *height;
gfx_ctx_get_video_size(data, &new_width, &new_height); gfx_ctx_glx_get_video_size(data, &new_width, &new_height);
if (new_width != *width || new_height != *height) if (new_width != *width || new_height != *height)
{ {
@ -158,21 +160,22 @@ static void gfx_ctx_check_window(void *data, bool *quit,
*quit = g_quit; *quit = g_quit;
} }
static void gfx_ctx_swap_buffers(void *data) static void gfx_ctx_glx_swap_buffers(void *data)
{ {
(void)data; (void)data;
if (g_is_double) if (g_is_double)
glXSwapBuffers(g_dpy, g_glx_win); glXSwapBuffers(g_dpy, g_glx_win);
} }
static void gfx_ctx_set_resize(void *data, unsigned width, unsigned height) static void gfx_ctx_glx_set_resize(void *data,
unsigned width, unsigned height)
{ {
(void)data; (void)data;
(void)width; (void)width;
(void)height; (void)height;
} }
static void gfx_ctx_update_window_title(void *data) static void gfx_ctx_glx_update_window_title(void *data)
{ {
(void)data; (void)data;
char buf[128], buf_fps[128]; char buf[128], buf_fps[128];
@ -184,7 +187,8 @@ static void gfx_ctx_update_window_title(void *data)
msg_queue_push(g_extern.msg_queue, buf_fps, 1, 1); msg_queue_push(g_extern.msg_queue, buf_fps, 1, 1);
} }
static void gfx_ctx_get_video_size(void *data, unsigned *width, unsigned *height) static void gfx_ctx_glx_get_video_size(void *data,
unsigned *width, unsigned *height)
{ {
(void)data; (void)data;
@ -214,7 +218,7 @@ static void gfx_ctx_get_video_size(void *data, unsigned *width, unsigned *height
} }
} }
static bool gfx_ctx_init(void *data) static bool gfx_ctx_glx_init(void *data)
{ {
if (g_inited) if (g_inited)
return false; return false;
@ -282,11 +286,11 @@ static bool gfx_ctx_init(void *data)
return true; return true;
error: error:
gfx_ctx_destroy(data); gfx_ctx_glx_destroy(data);
return false; return false;
} }
static bool gfx_ctx_set_video_mode(void *data, static bool gfx_ctx_glx_set_video_mode(void *data,
unsigned width, unsigned height, unsigned width, unsigned height,
bool fullscreen) bool fullscreen)
{ {
@ -481,7 +485,7 @@ static bool gfx_ctx_set_video_mode(void *data,
else else
RARCH_WARN("[GLX]: Context is not double buffered!.\n"); RARCH_WARN("[GLX]: Context is not double buffered!.\n");
gfx_ctx_swap_interval(data, g_interval); gfx_ctx_glx_swap_interval(data, g_interval);
// This can blow up on some drivers. It's not fatal, so override errors for this call. // This can blow up on some drivers. It's not fatal, so override errors for this call.
old_handler = XSetErrorHandler(nul_handler); old_handler = XSetErrorHandler(nul_handler);
@ -507,11 +511,11 @@ error:
if (vi) if (vi)
XFree(vi); XFree(vi);
gfx_ctx_destroy(data); gfx_ctx_glx_destroy(data);
return false; return false;
} }
static void gfx_ctx_destroy(void *data) static void gfx_ctx_glx_destroy(void *data)
{ {
(void)data; (void)data;
x11_destroy_input_context(&g_xim, &g_xic); x11_destroy_input_context(&g_xim, &g_xic);
@ -581,7 +585,8 @@ static void gfx_ctx_destroy(void *data)
g_core = false; g_core = false;
} }
static void gfx_ctx_input_driver(void *data, const input_driver_t **input, void **input_data) static void gfx_ctx_glx_input_driver(void *data,
const input_driver_t **input, void **input_data)
{ {
(void)data; (void)data;
void *xinput = input_x.init(); void *xinput = input_x.init();
@ -589,7 +594,7 @@ static void gfx_ctx_input_driver(void *data, const input_driver_t **input, void
*input_data = xinput; *input_data = xinput;
} }
static bool gfx_ctx_has_focus(void *data) static bool gfx_ctx_glx_has_focus(void *data)
{ {
(void)data; (void)data;
if (!g_inited) if (!g_inited)
@ -602,18 +607,18 @@ static bool gfx_ctx_has_focus(void *data)
return (win == g_win && g_has_focus) || g_true_full; return (win == g_win && g_has_focus) || g_true_full;
} }
static bool gfx_ctx_has_windowed(void *data) static bool gfx_ctx_glx_has_windowed(void *data)
{ {
(void)data; (void)data;
return true; return true;
} }
static gfx_ctx_proc_t gfx_ctx_get_proc_address(const char *symbol) static gfx_ctx_proc_t gfx_ctx_glx_get_proc_address(const char *symbol)
{ {
return glXGetProcAddress((const GLubyte*)symbol); return glXGetProcAddress((const GLubyte*)symbol);
} }
static bool gfx_ctx_bind_api(void *data, enum gfx_ctx_api api, unsigned major, unsigned minor) static bool gfx_ctx_glx_bind_api(void *data, enum gfx_ctx_api api, unsigned major, unsigned minor)
{ {
(void)data; (void)data;
g_major = major; g_major = major;
@ -621,13 +626,13 @@ static bool gfx_ctx_bind_api(void *data, enum gfx_ctx_api api, unsigned major, u
return api == GFX_CTX_OPENGL_API; return api == GFX_CTX_OPENGL_API;
} }
static void gfx_ctx_show_mouse(void *data, bool state) static void gfx_ctx_glx_show_mouse(void *data, bool state)
{ {
(void)data; (void)data;
x11_show_mouse(g_dpy, g_win, state); x11_show_mouse(g_dpy, g_win, state);
} }
static void gfx_ctx_bind_hw_render(void *data, bool enable) static void gfx_ctx_glx_bind_hw_render(void *data, bool enable)
{ {
(void)data; (void)data;
g_use_hw_ctx = enable; g_use_hw_ctx = enable;
@ -640,28 +645,28 @@ static void gfx_ctx_bind_hw_render(void *data, bool enable)
} }
const gfx_ctx_driver_t gfx_ctx_glx = { const gfx_ctx_driver_t gfx_ctx_glx = {
gfx_ctx_init, gfx_ctx_glx_init,
gfx_ctx_destroy, gfx_ctx_glx_destroy,
gfx_ctx_bind_api, gfx_ctx_glx_bind_api,
gfx_ctx_swap_interval, gfx_ctx_glx_swap_interval,
gfx_ctx_set_video_mode, gfx_ctx_glx_set_video_mode,
gfx_ctx_get_video_size, gfx_ctx_glx_get_video_size,
NULL, NULL,
gfx_ctx_update_window_title, gfx_ctx_glx_update_window_title,
gfx_ctx_check_window, gfx_ctx_glx_check_window,
gfx_ctx_set_resize, gfx_ctx_glx_set_resize,
gfx_ctx_has_focus, gfx_ctx_glx_has_focus,
gfx_ctx_has_windowed, gfx_ctx_glx_has_windowed,
gfx_ctx_swap_buffers, gfx_ctx_glx_swap_buffers,
gfx_ctx_input_driver, gfx_ctx_glx_input_driver,
gfx_ctx_get_proc_address, gfx_ctx_glx_get_proc_address,
#ifdef HAVE_EGL #ifdef HAVE_EGL
NULL, NULL,
NULL, NULL,
#endif #endif
gfx_ctx_show_mouse, gfx_ctx_glx_show_mouse,
"glx", "glx",
gfx_ctx_bind_hw_render, gfx_ctx_glx_bind_hw_render,
}; };