From 1a7e9a8ec4341271aa1dd6d5a898b8afafd97d11 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Mon, 13 Apr 2020 00:15:42 +0200 Subject: [PATCH] Rework the call queueing --- data/GServer.interface | 5 + include/GServer/video.h | 205 -------------- src/gserver.c | 596 +++++++++++++++++++++++----------------- src/video/glut.c | 372 ------------------------- src/video/glx.c | 372 ------------------------- src/video/sdl.c | 372 ------------------------- src/video/vesa.c | 16 -- 7 files changed, 344 insertions(+), 1594 deletions(-) diff --git a/data/GServer.interface b/data/GServer.interface index 139ec4c..ce414a6 100644 --- a/data/GServer.interface +++ b/data/GServer.interface @@ -219,6 +219,11 @@ arg2=UINT32 ret=BOOL arg1=UINT32 +#[call::glLightf] +#arg1=UINT32 +#arg2=UINT32 +#arg3=FLOAT + [call::glLightModeli] arg1=UINT32 arg2=INT32 diff --git a/include/GServer/video.h b/include/GServer/video.h index 29bb24b..34889a6 100644 --- a/include/GServer/video.h +++ b/include/GServer/video.h @@ -46,180 +46,6 @@ typedef enum _GServerVideoCall GSERVER_VIDEO_CALL_4s } GServerVideoCall; -typedef enum _GServerVideoCall0 -{ - GSERVER_VIDEO_CALL0_glEnd = 0, - GSERVER_VIDEO_CALL0_glEndList, - GSERVER_VIDEO_CALL0_glFlush, - GSERVER_VIDEO_CALL0_glLoadIdentity, - GSERVER_VIDEO_CALL0_SwapBuffers -} GServerVideoCall0; -# define GSERVER_VIDEO_CALL0_LAST GSERVER_VIDEO_CALL0_SwapBuffers -# define GSERVER_VIDEO_CALL0_COUNT (GSERVER_VIDEO_CALL0_LAST + 1) - -typedef enum _GServerVideoCall1d -{ - GSERVER_VIDEO_CALL1d_glClearDepth = 0 -} GServerVideoCall1d; -# define GSERVER_VIDEO_CALL1d_LAST GSERVER_VIDEO_CALL1d_glClearDepth -# define GSERVER_VIDEO_CALL1d_COUNT (GSERVER_VIDEO_CALL1d_LAST + 1) - -typedef enum _GServerVideoCall1f -{ - GSERVER_VIDEO_CALL1f_glClearIndex = 0, - GSERVER_VIDEO_CALL1f_glPointSize -} GServerVideoCall1f; -# define GSERVER_VIDEO_CALL1f_LAST GSERVER_VIDEO_CALL1f_glPointSize -# define GSERVER_VIDEO_CALL1f_COUNT (GSERVER_VIDEO_CALL1f_LAST + 1) - -typedef enum _GServerVideoCall1i -{ - GSERVER_VIDEO_CALL1i_glActiveTexture = 0, - GSERVER_VIDEO_CALL1i_glArrayElement, - GSERVER_VIDEO_CALL1i_glBegin, - GSERVER_VIDEO_CALL1i_glBlendEquation, - GSERVER_VIDEO_CALL1i_glCallList, - GSERVER_VIDEO_CALL1i_glClear, - GSERVER_VIDEO_CALL1i_glClearStencil, - GSERVER_VIDEO_CALL1i_glClientActiveTexture, -#if 0 - GSERVER_VIDEO_CALL1i_glCompileShader, -#endif - GSERVER_VIDEO_CALL1i_glDepthFunc, - GSERVER_VIDEO_CALL1i_glDisable, - GSERVER_VIDEO_CALL1i_glDisableClientState, - GSERVER_VIDEO_CALL1i_glEnable, - GSERVER_VIDEO_CALL1i_glEnableClientState, - GSERVER_VIDEO_CALL1i_glIsEnabled, - GSERVER_VIDEO_CALL1i_glShadeModel -} GServerVideoCall1i; -# define GSERVER_VIDEO_CALL1i_LAST GSERVER_VIDEO_CALL1i_glShadeModel -# define GSERVER_VIDEO_CALL1i_COUNT (GSERVER_VIDEO_CALL1i_LAST + 1) - -typedef enum _GServerVideoCall2f -{ - GSERVER_VIDEO_CALL2f_glPolygonOffset = 0, - GSERVER_VIDEO_CALL2f_glTexCoord2f -} GServerVideoCall2f; -# define GSERVER_VIDEO_CALL2f_LAST GSERVER_VIDEO_CALL2f_glTexCoord2f -# define GSERVER_VIDEO_CALL2f_COUNT (GSERVER_VIDEO_CALL2f_LAST + 1) - -typedef enum _GServerVideoCall2i -{ -#if 0 - GSERVER_VIDEO_CALL2i_glAttachShader = 0, - GSERVER_VIDEO_CALL2i_glBeginQuery, - GSERVER_VIDEO_CALL2i_glBindBuffer, - GSERVER_VIDEO_CALL2i_glBindTexture, - GSERVER_VIDEO_CALL2i_glBlendEquationSeparate, -#else - GSERVER_VIDEO_CALL2i_glBindTexture = 0, -#endif - GSERVER_VIDEO_CALL2i_glBlendFunc, - GSERVER_VIDEO_CALL2i_glColorMaterial, - GSERVER_VIDEO_CALL2i_glFogi, - GSERVER_VIDEO_CALL2i_glHint, - GSERVER_VIDEO_CALL2i_glLightModeli, - GSERVER_VIDEO_CALL2i_glVertex2i -} GServerVideoCall2i; -# define GSERVER_VIDEO_CALL2i_LAST GSERVER_VIDEO_CALL2i_glVertex2i -# define GSERVER_VIDEO_CALL2i_COUNT (GSERVER_VIDEO_CALL1i_LAST + 1) - -typedef enum _GServerVideoCall3b -{ - GSERVER_VIDEO_CALL3b_glColor3b = 0, - GSERVER_VIDEO_CALL3b_glColor3ub -} GServerVideoCall3b; -# define GSERVER_VIDEO_CALL3b_LAST GSERVER_VIDEO_CALL3b_glColor3ub -# define GSERVER_VIDEO_CALL3b_COUNT (GSERVER_VIDEO_CALL3b_LAST + 1) - -typedef enum _GServerVideoCall3d -{ - GSERVER_VIDEO_CALL3d_glColor3d = 0, - GSERVER_VIDEO_CALL3d_glTranslated -} GServerVideoCall3d; -# define GSERVER_VIDEO_CALL3d_LAST GSERVER_VIDEO_CALL3d_glTranslated -# define GSERVER_VIDEO_CALL3d_COUNT (GSERVER_VIDEO_CALL3d_LAST + 1) - -typedef enum _GServerVideoCall3f -{ - GSERVER_VIDEO_CALL3f_glColor3f = 0, - GSERVER_VIDEO_CALL3f_glNormal3f, - GSERVER_VIDEO_CALL3f_glTranslatef, - GSERVER_VIDEO_CALL3f_glVertex3f -} GServerVideoCall3f; -# define GSERVER_VIDEO_CALL3f_LAST GSERVER_VIDEO_CALL3f_glVertex3f -# define GSERVER_VIDEO_CALL3f_COUNT (GSERVER_VIDEO_CALL3f_LAST + 1) - -typedef enum _GServerVideoCall3i -{ - GSERVER_VIDEO_CALL3i_glColor3i = 0, - GSERVER_VIDEO_CALL3i_glColor3ui, - GSERVER_VIDEO_CALL3i_glDrawArrays, - GSERVER_VIDEO_CALL3i_glLighti, - GSERVER_VIDEO_CALL3i_glTexGeni, - GSERVER_VIDEO_CALL3i_glTexParameteri, - GSERVER_VIDEO_CALL3i_glVertex3i -} GServerVideoCall3i; -# define GSERVER_VIDEO_CALL3i_LAST GSERVER_VIDEO_CALL3i_glVertex3i -# define GSERVER_VIDEO_CALL3i_COUNT (GSERVER_VIDEO_CALL3i_LAST + 1) - -typedef enum _GServerVideoCall3s -{ - GSERVER_VIDEO_CALL3s_glColor3s = 0, - GSERVER_VIDEO_CALL3s_glColor3us -} GServerVideoCall3s; -# define GSERVER_VIDEO_CALL3s_LAST GSERVER_VIDEO_CALL3s_glColor3us -# define GSERVER_VIDEO_CALL3s_COUNT (GSERVER_VIDEO_CALL3s_LAST + 1) - -typedef enum _GServerVideoCall4b -{ - GSERVER_VIDEO_CALL4b_glColor4b = 0, - GSERVER_VIDEO_CALL4b_glColor4ub -} GServerVideoCall4b; -# define GSERVER_VIDEO_CALL4b_LAST GSERVER_VIDEO_CALL4b_glColor4ub -# define GSERVER_VIDEO_CALL4b_COUNT (GSERVER_VIDEO_CALL4b_LAST + 1) - -typedef enum _GServerVideoCall4d -{ - GSERVER_VIDEO_CALL4d_glColor4d = 0 -} GServerVideoCall4d; -# define GSERVER_VIDEO_CALL4d_LAST GSERVER_VIDEO_CALL4d_glColor4d -# define GSERVER_VIDEO_CALL4d_COUNT (GSERVER_VIDEO_CALL4d_LAST + 1) - -typedef enum _GServerVideoCall4f -{ - GSERVER_VIDEO_CALL4f_glClearAccum = 0, - GSERVER_VIDEO_CALL4f_glClearColor, - GSERVER_VIDEO_CALL4f_glColor4f, - GSERVER_VIDEO_CALL4f_glRotatef -} GServerVideoCall4f; -# define GSERVER_VIDEO_CALL4f_LAST GSERVER_VIDEO_CALL4f_glRotatef -# define GSERVER_VIDEO_CALL4f_COUNT (GSERVER_VIDEO_CALL4f_LAST + 1) - -typedef enum _GServerVideoCall4i -{ -#if 0 - GSERVER_VIDEO_CALL4i_glBlendFuncSeparate = 0, - GSERVER_VIDEO_CALL4i_glColor4i, -#else - GSERVER_VIDEO_CALL4i_glColor4i = 0, -#endif - GSERVER_VIDEO_CALL4i_glColor4ui, - GSERVER_VIDEO_CALL4i_glColorMask, - GSERVER_VIDEO_CALL4i_glScissor, - GSERVER_VIDEO_CALL4i_glViewport -} GServerVideoCall4i; -# define GSERVER_VIDEO_CALL4i_LAST GSERVER_VIDEO_CALL4i_glViewport -# define GSERVER_VIDEO_CALL4i_COUNT (GSERVER_VIDEO_CALL4i_LAST + 1) - -typedef enum _GServerVideoCall4s -{ - GSERVER_VIDEO_CALL4s_glColor4s = 0, - GSERVER_VIDEO_CALL4s_glColor4us -} GServerVideoCall4s; -# define GSERVER_VIDEO_CALL4s_LAST GSERVER_VIDEO_CALL4s_glColor4us -# define GSERVER_VIDEO_CALL4s_COUNT (GSERVER_VIDEO_CALL4s_LAST + 1) /* GServerVideoPlugin */ typedef struct _GServerVideoPlugin GServerVideoPlugin; @@ -240,37 +66,6 @@ struct _GServerVideoPlugin char const * name; int (*init)(GServerVideoPlugin * plugin); void (*destroy)(GServerVideoPlugin * plugin); - void (*call0)(GServerVideoPlugin * plugin, GServerVideoCall0 func); - void (*call1d)(GServerVideoPlugin * plugin, GServerVideoCall1d func, - double x); - void (*call1f)(GServerVideoPlugin * plugin, GServerVideoCall1f func, - float x); - void (*call1i)(GServerVideoPlugin * plugin, GServerVideoCall1i func, - uint32_t x); - void (*call2f)(GServerVideoPlugin * plugin, GServerVideoCall2f func, - float x, float y); - void (*call2i)(GServerVideoPlugin * plugin, GServerVideoCall2i func, - uint32_t x, uint32_t y); - void (*call3b)(GServerVideoPlugin * plugin, GServerVideoCall3b func, - uint8_t x, uint8_t y, uint8_t z); - void (*call3d)(GServerVideoPlugin * plugin, GServerVideoCall3d func, - double x, double y, double z); - void (*call3f)(GServerVideoPlugin * plugin, GServerVideoCall3f func, - float x, float y, float z); - void (*call3i)(GServerVideoPlugin * plugin, GServerVideoCall3i func, - uint32_t x, uint32_t y, uint32_t z); - void (*call3s)(GServerVideoPlugin * plugin, GServerVideoCall3s func, - uint16_t x, uint16_t y, uint16_t z); - void (*call4b)(GServerVideoPlugin * plugin, GServerVideoCall4b func, - uint8_t x, uint8_t y, uint8_t z, uint8_t t); - void (*call4d)(GServerVideoPlugin * plugin, GServerVideoCall4d func, - double x, double y, double z, double t); - void (*call4f)(GServerVideoPlugin * plugin, GServerVideoCall4f func, - float x, float y, float z, float t); - void (*call4i)(GServerVideoPlugin * plugin, GServerVideoCall4i func, - uint32_t x, uint32_t y, uint32_t z, uint32_t t); - void (*call4s)(GServerVideoPlugin * plugin, GServerVideoCall4s func, - uint16_t x, uint16_t y, uint16_t z, uint16_t t); void * priv; }; diff --git a/src/gserver.c b/src/gserver.c index 9104a31..cf9b520 100644 --- a/src/gserver.c +++ b/src/gserver.c @@ -20,6 +20,7 @@ #include #include #include +#include #include "GServer/video.h" #include "../data/GServer.h" #include "platform.h" @@ -90,6 +91,7 @@ struct _App int event_own; AppServer * appserver; int loop; + MarshallCallback * calls; /* plugins */ /* video */ @@ -105,99 +107,17 @@ struct _App struct _GServerCall { GServerVideoCall type; - unsigned int func; - union - { - struct - { - double x; - } _1d; - struct - { - float x; - } _1f; - struct - { - uint32_t x; - } _1i; - struct - { - float x; - float y; - } _2f; - struct - { - uint32_t x; - uint32_t y; - } _2i; - struct - { - uint8_t x; - uint8_t y; - uint8_t z; - } _3b; - struct - { - double x; - double y; - double z; - } _3d; - struct - { - float x; - float y; - float z; - } _3f; - struct - { - uint32_t x; - uint32_t y; - uint32_t z; - } _3i; - struct - { - uint16_t x; - uint16_t y; - uint16_t z; - } _3s; - struct - { - uint8_t x; - uint8_t y; - uint8_t z; - uint8_t t; - } _4b; - struct - { - double x; - double y; - double z; - double t; - } _4d; - struct - { - float x; - float y; - float z; - float t; - } _4f; - struct - { - uint32_t x; - uint32_t y; - uint32_t z; - uint32_t t; - } _4i; - struct - { - uint16_t x; - uint16_t y; - uint16_t z; - uint16_t t; - } _4s; - } args; + MarshallCallback callback; + Variable ** args; + size_t args_cnt; }; +typedef struct _GServerOpenGLCall +{ + String const * name; + GServerVideoCall type; +} GServerOpenGLCall; + struct _GServerClient { AppServerClient * asc; @@ -206,17 +126,77 @@ struct _GServerClient }; -/* variables */ -static GServer * _gserver = NULL; +/* constants */ +const GServerOpenGLCall _gserver_calls[] = +{ + /* GSERVER_VIDEO_CALL0 */ + { "glEnd", GSERVER_VIDEO_CALL_0 }, + { "glEndList", GSERVER_VIDEO_CALL_0 }, + { "glFlush", GSERVER_VIDEO_CALL_0 }, + { "glLoadIdentity", GSERVER_VIDEO_CALL_0 }, + { "SwapBuffers", GSERVER_VIDEO_CALL_0 }, + /* GSERVER_VIDEO_CALL1d */ + { "glClearDepth", GSERVER_VIDEO_CALL_1d }, + /* GSERVER_VIDEO_CALL1f */ + { "glClearIndex", GSERVER_VIDEO_CALL_1f }, + { "glPointSize", GSERVER_VIDEO_CALL_1f }, + /* GSERVER_VIDEO_CALL1i */ + { "glActiveTexture", GSERVER_VIDEO_CALL_1i }, + { "glArrayElement", GSERVER_VIDEO_CALL_1i }, + { "glBegin", GSERVER_VIDEO_CALL_1i }, + { "glBlendEquation", GSERVER_VIDEO_CALL_1i }, + { "glCallList", GSERVER_VIDEO_CALL_1i }, + { "glClear", GSERVER_VIDEO_CALL_1i }, + { "glClearStencil", GSERVER_VIDEO_CALL_1i }, + { "glClientActiveTexture",GSERVER_VIDEO_CALL_1i }, +#if 0 + { "glCompileShader", GSERVER_VIDEO_CALL_1i }, +#endif + { "glDepthFunc", GSERVER_VIDEO_CALL_1i }, + { "glDisable", GSERVER_VIDEO_CALL_1i }, + { "glDisableClientState",GSERVER_VIDEO_CALL_1i }, + { "glEnable", GSERVER_VIDEO_CALL_1i }, + { "glEnableClientState",GSERVER_VIDEO_CALL_1i }, + { "glIsEnabled", GSERVER_VIDEO_CALL_1i }, + { "glShadeModel", GSERVER_VIDEO_CALL_1i }, + /* GSERVER_VIDEO_CALL2f */ + { "glPolygonOffset", GSERVER_VIDEO_CALL_2f }, + { "glTexCoord2f", GSERVER_VIDEO_CALL_2f }, + /* GSERVER_VIDEO_CALL2i */ + { "glAttachShader", GSERVER_VIDEO_CALL_2i }, + { "glBeginQuery", GSERVER_VIDEO_CALL_2i }, + { "glBindBuffer", GSERVER_VIDEO_CALL_2i }, + { "glBindTexture", GSERVER_VIDEO_CALL_2i }, + { "glBlendEquationSeparate",GSERVER_VIDEO_CALL_2i }, +#if 0 + { "glBindTexture", GSERVER_VIDEO_CALL_2i }, +#endif + { "glBlendFunc", GSERVER_VIDEO_CALL_2i }, + { "glColorMaterial", GSERVER_VIDEO_CALL_2i }, + { "glFogi", GSERVER_VIDEO_CALL_2i }, + { "glHint", GSERVER_VIDEO_CALL_2i }, + { "glLightModeli", GSERVER_VIDEO_CALL_2i }, + { "glVertex2i", GSERVER_VIDEO_CALL_2i }, +#if 0 + { "", GSERVER_VIDEO_CALL_ }, +#endif +}; /* prototypes */ -static void _gserver_client_calls(GServer * gserver, GServerClient * client); +/* accessors */ static GServerClient * _gserver_get_client(GServer * gserver, void * id); +static MarshallCallback _gserver_get_call(GServer * gserver, + String const * name); + +/* useful */ +static int _gserver_call(GServer * gserver, Variable * ret, + char const * name, size_t args_cnt, Variable ** args); +static void _gserver_client_calls(GServer * gserver, GServerClient * client); /* queue */ static int _gserver_queue(GServer * gserver, AppServerClient * asc, - GServerVideoCall type, unsigned int func, ...); + GServerVideoCall type, char const * name, ...); /* public */ @@ -224,7 +204,8 @@ static int _gserver_queue(GServer * gserver, AppServerClient * asc, /* gserver_new */ static int _new_init(AppServerOptions options, GServer * gserver, Event * event); -static int _init_video(GServer * gserver); +static int _new_init_opengl(GServer * gserver); +static int _new_init_video(GServer * gserver); GServer * gserver_new(AppServerOptions options, Event * event) { @@ -232,7 +213,6 @@ GServer * gserver_new(AppServerOptions options, Event * event) if((gserver = object_new(sizeof(*gserver))) == NULL) return NULL; - _gserver = gserver; if(_new_init(options, gserver, event) != 0) { object_delete(gserver); @@ -258,6 +238,7 @@ static int _new_init(AppServerOptions options, GServer * gserver, Event * event) } else gserver->event_own = 1; + gserver->calls = NULL; gserver->video_helper.gserver = gserver; gserver->video_helper.get_event = gserver_get_event; gserver->video_helper.get_platform = gserver_get_platform; @@ -265,11 +246,14 @@ static int _new_init(AppServerOptions options, GServer * gserver, Event * event) if((gserver->appserver = appserver_new_event(gserver, options, "GServer", NULL, gserver->event)) != NULL - && _init_video(gserver) == 0) + && _new_init_video(gserver) == 0 + && _new_init_opengl(gserver) == 0) { gserver->loop = 1; return 0; } + if(gserver->calls != NULL) + object_delete(gserver->calls); if(gserver->appserver != NULL) appserver_delete(gserver->appserver); if(gserver->event_own != 0) @@ -278,7 +262,26 @@ static int _new_init(AppServerOptions options, GServer * gserver, Event * event) return -1; } -static int _init_video(GServer * gserver) +static int _new_init_opengl(GServer * gserver) +{ + Plugin * plugin; + const size_t cnt = sizeof(_gserver_calls) / sizeof(*_gserver_calls); + size_t i; + + if((gserver->calls = object_new(cnt * sizeof(*gserver->calls))) == NULL) + return -1; + if((plugin = plugin_new_self()) == NULL) + return -1; + for(i = 0; i < cnt; i++) + if((gserver->calls[i] = (MarshallCallback)plugin_lookup( + plugin, _gserver_calls[i].name)) + == NULL) + break; + plugin_delete(plugin); + return (i == cnt) ? 0 : -1; +} + +static int _new_init_video(GServer * gserver) { String const subsystem[] = "video"; GServerPlatform * platform = gserver->platform; @@ -305,9 +308,9 @@ static void _delete_video(GServer * gserver); void gserver_delete(GServer * gserver) { - if(_gserver == gserver) - _gserver = NULL; _delete_video(gserver); + if(gserver->calls != NULL) + object_delete(gserver->calls); if(gserver->appserver != NULL) appserver_delete(gserver->appserver); if(gserver->event != NULL) @@ -357,19 +360,18 @@ int gserver_loop(GServer * gserver) void gserver_refresh(GServer * gserver) { size_t i; + uint32_t u = GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT; + Variable * v; #ifdef DEBUG fprintf(stderr, "DEBUG: %s()\n", __func__); #endif - gserver->video_plugin->call1i(gserver->video_plugin, - GSERVER_VIDEO_CALL1i_glClear, - GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - gserver->video_plugin->call0(gserver->video_plugin, - GSERVER_VIDEO_CALL0_glLoadIdentity); + v = variable_new(VT_UINT32, &u); + _gserver_call(gserver, NULL, "glClear", 1, &v); + _gserver_call(gserver, NULL, "glLoadIdentity", 0, NULL); for(i = 0; i < gserver->clients_cnt; i++) _gserver_client_calls(gserver, &gserver->clients[i]); - gserver->video_plugin->call0(gserver->video_plugin, - GSERVER_VIDEO_CALL0_SwapBuffers); + _gserver_call(gserver, NULL, "SwapBuffers", 0, NULL); } @@ -379,7 +381,7 @@ void gserver_refresh(GServer * gserver) { \ DEBUG_INTERFACE(); \ _gserver_queue(gserver, asc, GSERVER_VIDEO_CALL_0, \ - GSERVER_VIDEO_CALL0_ ## func); \ + "" # func); \ } #define GSERVER_PROTO1d(type, func) \ type GServer_ ## func(GServer * gserver, AppServerClient * asc, \ @@ -387,7 +389,7 @@ void gserver_refresh(GServer * gserver) { \ DEBUG_INTERFACE(); \ _gserver_queue(gserver, asc, GSERVER_VIDEO_CALL_1d, \ - GSERVER_VIDEO_CALL1d_ ## func, x); \ + "" # func, x); \ } #define GSERVER_PROTO1f(type, func) \ type GServer_ ## func(GServer * gserver, AppServerClient * asc, \ @@ -395,7 +397,7 @@ void gserver_refresh(GServer * gserver) { \ DEBUG_INTERFACE(); \ _gserver_queue(gserver, asc, GSERVER_VIDEO_CALL_1f, \ - GSERVER_VIDEO_CALL1f_ ## func, x); \ + "" # func, x); \ } #define GSERVER_PROTO1i(type, func, type1) \ type GServer_ ## func (GServer * gserver, AppServerClient * asc, \ @@ -403,7 +405,7 @@ void gserver_refresh(GServer * gserver) { \ DEBUG_INTERFACE1i(x); \ _gserver_queue(gserver, asc, GSERVER_VIDEO_CALL_1i, \ - GSERVER_VIDEO_CALL1i_ ## func, x); \ + "" # func, x); \ } #define GSERVER_PROTO2f(type, func) \ type GServer_ ## func (GServer * gserver, AppServerClient * asc, \ @@ -411,7 +413,7 @@ void gserver_refresh(GServer * gserver) { \ DEBUG_INTERFACE2f(x, y); \ _gserver_queue(gserver, asc, GSERVER_VIDEO_CALL_2f, \ - GSERVER_VIDEO_CALL2f_ ## func, x, y); \ + "" # func, x, y); \ } #define GSERVER_PROTO2i(type, func, type1, type2) \ type GServer_ ## func (GServer * gserver, AppServerClient * asc, \ @@ -419,7 +421,7 @@ void gserver_refresh(GServer * gserver) { \ DEBUG_INTERFACE2i(x, y); \ _gserver_queue(gserver, asc, GSERVER_VIDEO_CALL_2i, \ - GSERVER_VIDEO_CALL2i_ ## func, x, y); \ + "" # func, x, y); \ } #define GSERVER_PROTO3b(type, func, type1, type2, type3) \ type GServer_ ## func (GServer * gserver, AppServerClient * asc, \ @@ -427,7 +429,7 @@ void gserver_refresh(GServer * gserver) { \ DEBUG_INTERFACE3b(x, y, z); \ _gserver_queue(gserver, asc, GSERVER_VIDEO_CALL_3b, \ - GSERVER_VIDEO_CALL3b_ ## func, x, y, z); \ + "" # func, x, y, z); \ } #define GSERVER_PROTO3d(type, func) \ type GServer_ ## func (GServer * gserver, AppServerClient * asc, \ @@ -435,7 +437,7 @@ void gserver_refresh(GServer * gserver) { \ DEBUG_INTERFACE3d(x, y, z); \ _gserver_queue(gserver, asc, GSERVER_VIDEO_CALL_3d, \ - GSERVER_VIDEO_CALL3d_ ## func, x, y, z); \ + "" # func, x, y, z); \ } #define GSERVER_PROTO3f(type, func) \ type GServer_ ## func (GServer * gserver, AppServerClient * asc, \ @@ -443,7 +445,7 @@ void gserver_refresh(GServer * gserver) { \ DEBUG_INTERFACE3f(x, y, z); \ _gserver_queue(gserver, asc, GSERVER_VIDEO_CALL_3f, \ - GSERVER_VIDEO_CALL3f_ ## func, x, y, z); \ + "" # func, x, y, z); \ } #define GSERVER_PROTO3i(type, func, type1, type2, type3) \ type GServer_ ## func (GServer * gserver, AppServerClient * asc, \ @@ -451,7 +453,7 @@ void gserver_refresh(GServer * gserver) { \ DEBUG_INTERFACE3i(x, y, z); \ _gserver_queue(gserver, asc, GSERVER_VIDEO_CALL_3i, \ - GSERVER_VIDEO_CALL3i_ ## func, x, y, z); \ + "" # func, x, y, z); \ } #define GSERVER_PROTO3s(type, func, type1, type2, type3) \ type GServer_ ## func (GServer * gserver, AppServerClient * asc, \ @@ -459,7 +461,7 @@ void gserver_refresh(GServer * gserver) { \ DEBUG_INTERFACE3s(x, y, z); \ _gserver_queue(gserver, asc, GSERVER_VIDEO_CALL_3s, \ - GSERVER_VIDEO_CALL3s_ ## func, x, y, z); \ + "" # func, x, y, z); \ } #define GSERVER_PROTO4b(type, func, type1, type2, type3, type4) \ type GServer_ ## func (GServer * gserver, AppServerClient * asc, \ @@ -467,7 +469,7 @@ void gserver_refresh(GServer * gserver) { \ DEBUG_INTERFACE4b(x, y, z, t); \ _gserver_queue(gserver, asc, GSERVER_VIDEO_CALL_4b, \ - GSERVER_VIDEO_CALL4b_ ## func, x, y, z, t); \ + "" # func, x, y, z, t); \ } #define GSERVER_PROTO4d(type, func) \ type GServer_ ## func (GServer * gserver, AppServerClient * asc, \ @@ -475,7 +477,7 @@ void gserver_refresh(GServer * gserver) { \ DEBUG_INTERFACE4d(x, y, z, t); \ _gserver_queue(gserver, asc, GSERVER_VIDEO_CALL_4d, \ - GSERVER_VIDEO_CALL4d_ ## func, x, y, z, t); \ + "" # func, x, y, z, t); \ } #define GSERVER_PROTO4f(type, func) \ type GServer_ ## func (GServer * gserver, AppServerClient * asc, \ @@ -483,7 +485,7 @@ void gserver_refresh(GServer * gserver) { \ DEBUG_INTERFACE4f(x, y, z, t); \ _gserver_queue(gserver, asc, GSERVER_VIDEO_CALL_4f, \ - GSERVER_VIDEO_CALL4f_ ## func, x, y, z, t); \ + "" # func, x, y, z, t); \ } #define GSERVER_PROTO4i(type, func, type1, type2, type3, type4) \ type GServer_ ## func (GServer * gserver, AppServerClient * asc, \ @@ -491,7 +493,7 @@ void gserver_refresh(GServer * gserver) { \ DEBUG_INTERFACE4i(x, y, z, t); \ _gserver_queue(gserver, asc, GSERVER_VIDEO_CALL_4i, \ - GSERVER_VIDEO_CALL4i_ ## func, x, y, z, t); \ + "" # func, x, y, z, t); \ } #define GSERVER_PROTO4s(type, func, type1, type2, type3, type4) \ type GServer_ ## func (GServer * gserver, AppServerClient * asc, \ @@ -499,7 +501,7 @@ void gserver_refresh(GServer * gserver) { \ DEBUG_INTERFACE4s(x, y, z, t); \ _gserver_queue(gserver, asc, GSERVER_VIDEO_CALL_4s, \ - GSERVER_VIDEO_CALL4s_ ## func, x, y, z, t); \ + "" # func, x, y, z, t); \ } /* proto0 */ @@ -616,95 +618,18 @@ GSERVER_PROTO4s(void, glColor4us, uint16_t, uint16_t, uint16_t, uint16_t) /* private */ /* functions */ -/* gserver_client_calls */ -static void _gserver_client_calls(GServer * gserver, GServerClient * client) +/* accessors */ +static MarshallCallback _gserver_get_call(GServer * gserver, + String const * name) { + const size_t cnt = sizeof(_gserver_calls) / sizeof(*_gserver_calls); size_t i; - GServerCall * call; - GServerVideoPlugin * vp = gserver->video_plugin; - for(i = 0; i < client->calls_cnt; i++) - { - call = &client->calls[i]; - switch(call->type) - { - case GSERVER_VIDEO_CALL_0: - vp->call0(vp, call->func); - break; - case GSERVER_VIDEO_CALL_1d: - vp->call1d(vp, call->func, call->args._1d.x); - break; - case GSERVER_VIDEO_CALL_1f: - vp->call1f(vp, call->func, call->args._1f.x); - break; - case GSERVER_VIDEO_CALL_1i: - vp->call1i(vp, call->func, call->args._1i.x); - break; - case GSERVER_VIDEO_CALL_2f: - vp->call2f(vp, call->func, call->args._2f.x, - call->args._3f.y); - break; - case GSERVER_VIDEO_CALL_2i: - vp->call2i(vp, call->func, call->args._2i.x, - call->args._2i.y); - break; - case GSERVER_VIDEO_CALL_3b: - vp->call3b(vp, call->func, call->args._3b.x, - call->args._3b.y, - call->args._3b.z); - break; - case GSERVER_VIDEO_CALL_3d: - vp->call3d(vp, call->func, call->args._3d.x, - call->args._3d.y, - call->args._3d.z); - break; - case GSERVER_VIDEO_CALL_3f: - vp->call3f(vp, call->func, call->args._3f.x, - call->args._3f.y, - call->args._3f.z); - break; - case GSERVER_VIDEO_CALL_3i: - vp->call3i(vp, call->func, call->args._3i.x, - call->args._3i.y, - call->args._3i.z); - break; - case GSERVER_VIDEO_CALL_3s: - vp->call3s(vp, call->func, call->args._3s.x, - call->args._3s.y, - call->args._3s.z); - break; - case GSERVER_VIDEO_CALL_4b: - vp->call4b(vp, call->func, call->args._4b.x, - call->args._4b.y, - call->args._4b.z, - call->args._4b.t); - break; - case GSERVER_VIDEO_CALL_4d: - vp->call4d(vp, call->func, call->args._4d.x, - call->args._4d.y, - call->args._4d.z, - call->args._4d.t); - break; - case GSERVER_VIDEO_CALL_4f: - vp->call4f(vp, call->func, call->args._4f.x, - call->args._4f.y, - call->args._4f.z, - call->args._4f.t); - break; - case GSERVER_VIDEO_CALL_4i: - vp->call4i(vp, call->func, call->args._4i.x, - call->args._4i.y, - call->args._4i.z, - call->args._4i.t); - break; - case GSERVER_VIDEO_CALL_4s: - vp->call4s(vp, call->func, call->args._4s.x, - call->args._4s.y, - call->args._4s.z, - call->args._4s.t); - break; - } - } + for(i = 0; i < cnt; i++) + if(strcmp(_gserver_calls[i].name, name) == 0) + return gserver->calls[i]; + /* XXX report the error */ + return NULL; } @@ -730,17 +655,55 @@ static GServerClient * _gserver_get_client(GServer * gserver, } +/* useful */ +/* gserver_call */ +static int _gserver_call(GServer * gserver, Variable * ret, + char const * name, size_t args_cnt, Variable ** args) +{ + MarshallCallback callback; + + if((callback = _gserver_get_call(gserver, name)) != NULL) + return marshall_call(ret, callback, args_cnt, args); + return -1; +} + + +/* gserver_client_calls */ +static void _gserver_client_calls(GServer * gserver, GServerClient * client) +{ + size_t i; + GServerCall * call; + + /* FIXME place the calls in context (windows...) */ + for(i = 0; i < client->calls_cnt; i++) + { + call = &client->calls[i]; + marshall_call(NULL, call->callback, call->args_cnt, call->args); + } +} + + +/* queue */ /* gserver_queue */ +static int _queue_error(GServerCall * call); + static int _gserver_queue(GServer * gserver, AppServerClient * asc, - GServerVideoCall type, unsigned int func, ...) + GServerVideoCall type, char const * name, ...) { va_list ap; GServerCall * call; GServerClient * gsc; + size_t i = 0; + Variable * v; + bool b; + double d; + float f; + uint16_t u16; + uint32_t u32; #ifdef DEBUG fprintf(stderr, "DEBUG: %s(%p, %u, %u)\n", __func__, (void *)gserver, - type, func); + type, name); #endif if((gsc = _gserver_get_client(gserver, asc)) == NULL) return -1; @@ -748,91 +711,210 @@ static int _gserver_queue(GServer * gserver, AppServerClient * asc, == NULL) return -1; gsc->calls = call; - call = &gsc->calls[gsc->calls_cnt++]; + call = &gsc->calls[gsc->calls_cnt]; call->type = type; - call->func = func; + call->callback = _gserver_get_call(gserver, name); #if 0 /* XXX probably hurts performance without protecting anything */ memset(&gsc->args, 0, sizeof(gsc->args)); #endif - va_start(ap, func); + va_start(ap, name); switch(type) { case GSERVER_VIDEO_CALL_0: /* FIXME intercept SwapBuffers() and glClear() */ + call->args_cnt = 0; + call->args = NULL; break; case GSERVER_VIDEO_CALL_1d: - call->args._1d.x = va_arg(ap, double); + call->args_cnt = 1; + if((call->args = object_new(sizeof(v) * call->args_cnt)) + == NULL) + return _queue_error(call); + d = va_arg(ap, double); + call->args[i++] = variable_new(VT_DOUBLE, &d); break; case GSERVER_VIDEO_CALL_1f: - call->args._1f.x = va_arg(ap, double); + call->args_cnt = 1; + if((call->args = object_new(sizeof(v) * call->args_cnt)) + == NULL) + return _queue_error(call); + f = va_arg(ap, double); + call->args[i++] = variable_new(VT_FLOAT, &f); break; case GSERVER_VIDEO_CALL_1i: - call->args._1i.x = va_arg(ap, uint32_t); + call->args_cnt = 1; + if((call->args = object_new(sizeof(v) * call->args_cnt)) + == NULL) + return _queue_error(call); + u32 = va_arg(ap, uint32_t); + call->args[i++] = variable_new(VT_UINT32, &u32); break; case GSERVER_VIDEO_CALL_2f: - call->args._2f.x = va_arg(ap, double); - call->args._2f.y = va_arg(ap, double); + call->args_cnt = 2; + if((call->args = object_new(sizeof(v) * call->args_cnt)) + == NULL) + return _queue_error(call); + f = va_arg(ap, double); + call->args[i++] = variable_new(VT_FLOAT, &f); + f = va_arg(ap, double); + call->args[i++] = variable_new(VT_FLOAT, &f); break; case GSERVER_VIDEO_CALL_2i: - call->args._2i.x = va_arg(ap, uint32_t); - call->args._2i.y = va_arg(ap, uint32_t); + call->args_cnt = 2; + if((call->args = object_new(sizeof(v) * call->args_cnt)) + == NULL) + return _queue_error(call); + u32 = va_arg(ap, uint32_t); + call->args[i++] = variable_new(VT_UINT32, &u32); + u32 = va_arg(ap, uint32_t); + call->args[i++] = variable_new(VT_UINT32, &u32); break; case GSERVER_VIDEO_CALL_3b: - call->args._3b.x = va_arg(ap, uint32_t); - call->args._3b.y = va_arg(ap, uint32_t); - call->args._3b.z = va_arg(ap, uint32_t); + call->args_cnt = 3; + if((call->args = object_new(sizeof(v) * call->args_cnt)) + == NULL) + return _queue_error(call); + b = va_arg(ap, uint32_t); + call->args[i++] = variable_new(VT_BOOL, &b); + b = va_arg(ap, uint32_t); + call->args[i++] = variable_new(VT_BOOL, &b); + b = va_arg(ap, uint32_t); + call->args[i++] = variable_new(VT_BOOL, &b); break; case GSERVER_VIDEO_CALL_3d: - call->args._3d.x = va_arg(ap, double); - call->args._3d.y = va_arg(ap, double); - call->args._3d.z = va_arg(ap, double); + call->args_cnt = 3; + if((call->args = object_new(sizeof(v) * call->args_cnt)) + == NULL) + return _queue_error(call); + d = va_arg(ap, double); + call->args[i++] = variable_new(VT_DOUBLE, &d); + d = va_arg(ap, double); + call->args[i++] = variable_new(VT_DOUBLE, &d); + d = va_arg(ap, double); + call->args[i++] = variable_new(VT_DOUBLE, &d); break; case GSERVER_VIDEO_CALL_3f: - call->args._3f.x = va_arg(ap, double); - call->args._3f.y = va_arg(ap, double); - call->args._3f.z = va_arg(ap, double); + call->args_cnt = 3; + if((call->args = object_new(sizeof(v) * call->args_cnt)) + == NULL) + return _queue_error(call); + f = va_arg(ap, double); + call->args[i++] = variable_new(VT_DOUBLE, &f); + f = va_arg(ap, double); + call->args[i++] = variable_new(VT_DOUBLE, &f); + f = va_arg(ap, double); + call->args[i++] = variable_new(VT_DOUBLE, &f); break; case GSERVER_VIDEO_CALL_3i: - call->args._3i.x = va_arg(ap, uint32_t); - call->args._3i.y = va_arg(ap, uint32_t); - call->args._3i.z = va_arg(ap, uint32_t); + call->args_cnt = 3; + if((call->args = object_new(sizeof(v) * call->args_cnt)) + == NULL) + return _queue_error(call); + u32 = va_arg(ap, uint32_t); + call->args[i++] = variable_new(VT_UINT32, &u32); + u32 = va_arg(ap, uint32_t); + call->args[i++] = variable_new(VT_UINT32, &u32); + u32 = va_arg(ap, uint32_t); + call->args[i++] = variable_new(VT_UINT32, &u32); break; case GSERVER_VIDEO_CALL_3s: - call->args._3s.x = va_arg(ap, uint32_t); - call->args._3s.y = va_arg(ap, uint32_t); - call->args._3s.z = va_arg(ap, uint32_t); + call->args_cnt = 3; + if((call->args = object_new(sizeof(v) * call->args_cnt)) + == NULL) + return _queue_error(call); + u16 = va_arg(ap, uint32_t); + call->args[i++] = variable_new(VT_UINT16, &u16); + u16 = va_arg(ap, uint32_t); + call->args[i++] = variable_new(VT_UINT16, &u16); + u16 = va_arg(ap, uint32_t); + call->args[i++] = variable_new(VT_UINT16, &u16); break; case GSERVER_VIDEO_CALL_4b: - call->args._4b.x = va_arg(ap, uint32_t); - call->args._4b.y = va_arg(ap, uint32_t); - call->args._4b.z = va_arg(ap, uint32_t); - call->args._4b.t = va_arg(ap, uint32_t); + call->args_cnt = 4; + if((call->args = object_new(sizeof(v) * call->args_cnt)) + == NULL) + return _queue_error(call); + b = va_arg(ap, uint32_t); + call->args[i++] = variable_new(VT_BOOL, &b); + b = va_arg(ap, uint32_t); + call->args[i++] = variable_new(VT_BOOL, &b); + b = va_arg(ap, uint32_t); + call->args[i++] = variable_new(VT_BOOL, &b); + b = va_arg(ap, uint32_t); + call->args[i++] = variable_new(VT_BOOL, &b); break; case GSERVER_VIDEO_CALL_4d: - call->args._4d.x = va_arg(ap, double); - call->args._4d.y = va_arg(ap, double); - call->args._4d.z = va_arg(ap, double); - call->args._4d.t = va_arg(ap, double); + call->args_cnt = 4; + if((call->args = object_new(sizeof(v) * call->args_cnt)) + == NULL) + return _queue_error(call); + d = va_arg(ap, double); + call->args[i++] = variable_new(VT_DOUBLE, &d); + d = va_arg(ap, double); + call->args[i++] = variable_new(VT_DOUBLE, &d); + d = va_arg(ap, double); + call->args[i++] = variable_new(VT_DOUBLE, &d); + d = va_arg(ap, double); + call->args[i++] = variable_new(VT_DOUBLE, &d); break; case GSERVER_VIDEO_CALL_4f: - call->args._4f.x = va_arg(ap, double); - call->args._4f.y = va_arg(ap, double); - call->args._4f.z = va_arg(ap, double); - call->args._4f.t = va_arg(ap, double); + call->args_cnt = 4; + if((call->args = object_new(sizeof(v) * call->args_cnt)) + == NULL) + return _queue_error(call); + f = va_arg(ap, double); + call->args[i++] = variable_new(VT_DOUBLE, &f); + f = va_arg(ap, double); + call->args[i++] = variable_new(VT_DOUBLE, &f); + f = va_arg(ap, double); + call->args[i++] = variable_new(VT_DOUBLE, &f); + f = va_arg(ap, double); + call->args[i++] = variable_new(VT_DOUBLE, &f); break; case GSERVER_VIDEO_CALL_4i: - call->args._4i.x = va_arg(ap, uint32_t); - call->args._4i.y = va_arg(ap, uint32_t); - call->args._4i.z = va_arg(ap, uint32_t); - call->args._4i.t = va_arg(ap, uint32_t); + call->args_cnt = 4; + if((call->args = object_new(sizeof(v) * call->args_cnt)) + == NULL) + return _queue_error(call); + u32 = va_arg(ap, uint32_t); + call->args[i++] = variable_new(VT_UINT32, &u32); + u32 = va_arg(ap, uint32_t); + call->args[i++] = variable_new(VT_UINT32, &u32); + u32 = va_arg(ap, uint32_t); + call->args[i++] = variable_new(VT_UINT32, &u32); + u32 = va_arg(ap, uint32_t); + call->args[i++] = variable_new(VT_UINT32, &u32); break; case GSERVER_VIDEO_CALL_4s: - call->args._4s.x = va_arg(ap, uint32_t); - call->args._4s.y = va_arg(ap, uint32_t); - call->args._4s.z = va_arg(ap, uint32_t); - call->args._4s.t = va_arg(ap, uint32_t); + call->args_cnt = 4; + if((call->args = object_new(sizeof(v) * call->args_cnt)) + == NULL) + return _queue_error(call); + u16 = va_arg(ap, uint32_t); + call->args[i++] = variable_new(VT_UINT16, &u16); + u16 = va_arg(ap, uint32_t); + call->args[i++] = variable_new(VT_UINT16, &u16); + u16 = va_arg(ap, uint32_t); + call->args[i++] = variable_new(VT_UINT16, &u16); + u16 = va_arg(ap, uint32_t); + call->args[i++] = variable_new(VT_UINT16, &u16); break; } va_end(ap); + for(i = 0; i < call->args_cnt; i++) + if(call->args[i] == NULL) + return _queue_error(call); + gsc->calls_cnt++; return 0; } + +static int _queue_error(GServerCall * call) +{ + size_t i; + + for(i = 0; i < call->args_cnt; i++) + if(call->args[i] != NULL) + variable_delete(call->args[i]); + object_delete(call->args); + return -1; +} diff --git a/src/video/glut.c b/src/video/glut.c index ee9ab2b..ff2d904 100644 --- a/src/video/glut.c +++ b/src/video/glut.c @@ -41,191 +41,6 @@ static void _glut_destroy(GServerVideoPlugin * plugin); static void _glut_display(void); static void _glut_idle(void); -static void _glut_call0(GServerVideoPlugin * plugin, GServerVideoCall0 func); -static void _glut_call1d(GServerVideoPlugin * plugin, GServerVideoCall1d func, - double x); -static void _glut_call1f(GServerVideoPlugin * plugin, GServerVideoCall1f func, - float x); -static void _glut_call1i(GServerVideoPlugin * plugin, GServerVideoCall1i func, - uint32_t x); -static void _glut_call2f(GServerVideoPlugin * plugin, GServerVideoCall2f func, - float x, float y); -static void _glut_call2i(GServerVideoPlugin * plugin, GServerVideoCall2i func, - uint32_t x, uint32_t y); -static void _glut_call3b(GServerVideoPlugin * plugin, GServerVideoCall3b func, - uint8_t x, uint8_t y, uint8_t z); -static void _glut_call3d(GServerVideoPlugin * plugin, GServerVideoCall3d func, - double x, double y, double z); -static void _glut_call3f(GServerVideoPlugin * plugin, GServerVideoCall3f func, - float x, float y, float z); -static void _glut_call3i(GServerVideoPlugin * plugin, GServerVideoCall3i func, - uint32_t x, uint32_t y, uint32_t z); -static void _glut_call3s(GServerVideoPlugin * plugin, GServerVideoCall3s func, - uint16_t x, uint16_t y, uint16_t z); -static void _glut_call4b(GServerVideoPlugin * plugin, GServerVideoCall4b func, - uint8_t x, uint8_t y, uint8_t z, uint8_t t); -static void _glut_call4d(GServerVideoPlugin * plugin, GServerVideoCall4d func, - double x, double y, double z, double t); -static void _glut_call4f(GServerVideoPlugin * plugin, GServerVideoCall4f func, - float x, float y, float z, float t); -static void _glut_call4i(GServerVideoPlugin * plugin, GServerVideoCall4i func, - uint32_t x, uint32_t y, uint32_t z, uint32_t t); -static void _glut_call4s(GServerVideoPlugin * plugin, GServerVideoCall4s func, - uint16_t x, uint16_t y, uint16_t z, uint16_t t); - -static void _glut_swap_buffers(void); - - -/* variables */ -static void (*_glut_func0[GSERVER_VIDEO_CALL0_COUNT])(void) = -{ - glEnd, - glEndList, - glFlush, - glLoadIdentity, - _glut_swap_buffers -}; - -static void (*_glut_func1d[GSERVER_VIDEO_CALL1d_COUNT])(double) = -{ - glClearDepth -}; - -static void (*_glut_func1f[GSERVER_VIDEO_CALL1f_COUNT])(float) = -{ - glClearIndex, - glPointSize -}; - -static void (*_glut_func1i[GSERVER_VIDEO_CALL1i_COUNT])(uint32_t) = -{ - glActiveTexture, - glArrayElement, - glBegin, - glBlendEquation, - glCallList, - glClear, - glClearStencil, - glClientActiveTexture, -#if 0 - glCompileShader, -#endif - glDepthFunc, - glDisable, - glDisableClientState, - glEnable, - glEnableClientState, - glIsEnabled, - glShadeModel -}; - -static void (*_glut_func2f[GSERVER_VIDEO_CALL2f_COUNT])(float, float) = -{ - glPolygonOffset, - glTexCoord2f -}; - -static void (*_glut_func2i[GSERVER_VIDEO_CALL2i_COUNT])(uint32_t, uint32_t) = -{ -#if 0 - glAttachShader, - glBeginQuery, - glBindBuffer, -#endif - glBindTexture, -#if 0 - glBlendEquationSeparate, -#endif - glBlendFunc, - glColorMaterial, - glFogi, - glHint, - glLightModeli, - glVertex2i -}; - -static void (*_glut_func3b[GSERVER_VIDEO_CALL3b_COUNT])(uint8_t, uint8_t, - uint8_t) = -{ - glColor3b, - glColor3ub -}; - -static void (*_glut_func3d[GSERVER_VIDEO_CALL3d_COUNT])(double, double, - double) = -{ - glColor3d, - glTranslated -}; - -static void (*_glut_func3f[GSERVER_VIDEO_CALL3f_COUNT])(float, float, float) = -{ - glColor3f, - glNormal3f, - glTranslatef, - glVertex3f -}; - -static void (*_glut_func3i[GSERVER_VIDEO_CALL3i_COUNT])(uint32_t, uint32_t, - uint32_t) = -{ - glColor3i, - glColor3ui, - glDrawArrays, - glLighti, - glTexGeni, - glTexParameteri, - glVertex3i -}; - -static void (*_glut_func3s[GSERVER_VIDEO_CALL3s_COUNT])(uint16_t, uint16_t, - uint16_t) = -{ - glColor3s, - glColor3us -}; - -static void (*_glut_func4b[GSERVER_VIDEO_CALL4b_COUNT])(uint8_t, uint8_t, - uint8_t, uint8_t) = -{ - glColor4b, - glColor4ub -}; - -static void (*_glut_func4d[GSERVER_VIDEO_CALL4d_COUNT])(double, double, double, - double) = -{ - glColor4d -}; - -static void (*_glut_func4f[GSERVER_VIDEO_CALL4f_COUNT])(float, float, float, - float) = -{ - glClearAccum, - glClearColor, - glRotatef -}; - -static void (*_glut_func4i[GSERVER_VIDEO_CALL4i_COUNT])(uint32_t, uint32_t, - uint32_t, uint32_t) = -{ -#if 0 - glBlendFuncSeparate, -#endif - glColor4i, - glColor4ui, - glColorMask, - glScissor, - glViewport -}; - -static void (*_glut_func4s[GSERVER_VIDEO_CALL4s_COUNT])(uint16_t, uint16_t, - uint16_t, uint16_t) = -{ - glColor4s, - glColor4us -}; - /* public */ /* variables */ @@ -235,22 +50,6 @@ GServerVideoPlugin video_plugin = "GLUT", _glut_init, _glut_destroy, - _glut_call0, - _glut_call1d, - _glut_call1f, - _glut_call1i, - _glut_call2f, - _glut_call2i, - _glut_call3b, - _glut_call3d, - _glut_call3f, - _glut_call3i, - _glut_call3s, - _glut_call4b, - _glut_call4d, - _glut_call4f, - _glut_call4i, - _glut_call4s, NULL }; @@ -351,174 +150,3 @@ static int _idle_timeout(void * data) event_loop_quit(event); return 1; } - - -/* glut_call0 */ -static void _glut_call0(GServerVideoPlugin * plugin, GServerVideoCall0 func) -{ - (void) plugin; - - if(func == GSERVER_VIDEO_CALL0_SwapBuffers) - { - glutSwapBuffers(); - return; - } - _glut_func0[func](); -} - - -/* glut_call1d */ -static void _glut_call1d(GServerVideoPlugin * plugin, GServerVideoCall1d func, - double x) -{ - (void) plugin; - - _glut_func1d[func](x); -} - - -/* glut_call1f */ -static void _glut_call1f(GServerVideoPlugin * plugin, GServerVideoCall1f func, - float x) -{ - (void) plugin; - - _glut_func1f[func](x); -} - - -/* glut_call1i */ -static void _glut_call1i(GServerVideoPlugin * plugin, GServerVideoCall1i func, - uint32_t x) -{ - (void) plugin; - - _glut_func1i[func](x); -} - - -/* glut_call2f */ -static void _glut_call2f(GServerVideoPlugin * plugin, GServerVideoCall2f func, - float x, float y) -{ - (void) plugin; - - _glut_func2f[func](x, y); -} - - -/* glut_call2i */ -static void _glut_call2i(GServerVideoPlugin * plugin, GServerVideoCall2i func, - uint32_t x, uint32_t y) -{ - (void) plugin; - - _glut_func2i[func](x, y); -} - - -/* glut_call3b */ -static void _glut_call3b(GServerVideoPlugin * plugin, GServerVideoCall3b func, - uint8_t x, uint8_t y, uint8_t z) -{ - (void) plugin; - - _glut_func3b[func](x, y, z); -} - - -/* glut_call3d */ -static void _glut_call3d(GServerVideoPlugin * plugin, GServerVideoCall3d func, - double x, double y, double z) -{ - (void) plugin; - - _glut_func3d[func](x, y, z); -} - - -/* glut_call3f */ -static void _glut_call3f(GServerVideoPlugin * plugin, GServerVideoCall3f func, - float x, float y, float z) -{ - (void) plugin; - - _glut_func3f[func](x, y, z); -} - - -/* glut_call3i */ -static void _glut_call3i(GServerVideoPlugin * plugin, GServerVideoCall3i func, - uint32_t x, uint32_t y, uint32_t z) -{ - (void) plugin; - - _glut_func3i[func](x, y, z); -} - - -/* glut_call3s */ -static void _glut_call3s(GServerVideoPlugin * plugin, GServerVideoCall3s func, - uint16_t x, uint16_t y, uint16_t z) -{ - (void) plugin; - - _glut_func3s[func](x, y, z); -} - - -/* glut_call4b */ -static void _glut_call4b(GServerVideoPlugin * plugin, GServerVideoCall4b func, - uint8_t x, uint8_t y, uint8_t z, uint8_t t) -{ - (void) plugin; - - _glut_func4b[func](x, y, z, t); -} - - -/* glut_call4d */ -static void _glut_call4d(GServerVideoPlugin * plugin, GServerVideoCall4d func, - double x, double y, double z, double t) -{ - (void) plugin; - - _glut_func4d[func](x, y, z, t); -} - - -/* glut_call4f */ -static void _glut_call4f(GServerVideoPlugin * plugin, GServerVideoCall4f func, - float x, float y, float z, float t) -{ - (void) plugin; - - _glut_func4f[func](x, y, z, t); -} - - -/* glut_call4i */ -static void _glut_call4i(GServerVideoPlugin * plugin, GServerVideoCall4i func, - uint32_t x, uint32_t y, uint32_t z, uint32_t t) -{ - (void) plugin; - - _glut_func4i[func](x, y, z, t); -} - - -/* glut_call4s */ -static void _glut_call4s(GServerVideoPlugin * plugin, GServerVideoCall4s func, - uint16_t x, uint16_t y, uint16_t z, uint16_t t) -{ - (void) plugin; - - _glut_func4s[func](x, y, z, t); -} - - -/* glut_swap_buffers */ -static void _glut_swap_buffers(void) -{ - /* no need to do anything */ -} diff --git a/src/video/glx.c b/src/video/glx.c index 1361200..b90c014 100644 --- a/src/video/glx.c +++ b/src/video/glx.c @@ -44,193 +44,9 @@ typedef struct _GLXVideo static int _glx_init(GServerVideoPlugin * plugin); static void _glx_destroy(GServerVideoPlugin * plugin); -static void _glx_call0(GServerVideoPlugin * plugin, GServerVideoCall0 func); -static void _glx_call1d(GServerVideoPlugin * plugin, GServerVideoCall1d func, - double x); -static void _glx_call1f(GServerVideoPlugin * plugin, GServerVideoCall1f func, - float x); -static void _glx_call1i(GServerVideoPlugin * plugin, GServerVideoCall1i func, - uint32_t x); -static void _glx_call2f(GServerVideoPlugin * plugin, GServerVideoCall2f func, - float x, float y); -static void _glx_call2i(GServerVideoPlugin * plugin, GServerVideoCall2i func, - uint32_t x, uint32_t y); -static void _glx_call3b(GServerVideoPlugin * plugin, GServerVideoCall3b func, - uint8_t x, uint8_t y, uint8_t z); -static void _glx_call3d(GServerVideoPlugin * plugin, GServerVideoCall3d func, - double x, double y, double z); -static void _glx_call3f(GServerVideoPlugin * plugin, GServerVideoCall3f func, - float x, float y, float z); -static void _glx_call3i(GServerVideoPlugin * plugin, GServerVideoCall3i func, - uint32_t x, uint32_t y, uint32_t z); -static void _glx_call3s(GServerVideoPlugin * plugin, GServerVideoCall3s func, - uint16_t x, uint16_t y, uint16_t z); -static void _glx_call4b(GServerVideoPlugin * plugin, GServerVideoCall4b func, - uint8_t x, uint8_t y, uint8_t z, uint8_t t); -static void _glx_call4d(GServerVideoPlugin * plugin, GServerVideoCall4d func, - double x, double y, double z, double t); -static void _glx_call4f(GServerVideoPlugin * plugin, GServerVideoCall4f func, - float x, float y, float z, float t); -static void _glx_call4i(GServerVideoPlugin * plugin, GServerVideoCall4i func, - uint32_t x, uint32_t y, uint32_t z, uint32_t t); -static void _glx_call4s(GServerVideoPlugin * plugin, GServerVideoCall4s func, - uint16_t x, uint16_t y, uint16_t z, uint16_t t); - -static void _glx_swap_buffers(void); static int _glx_timeout(void * data); -/* variables */ -static void (*_glx_func0[GSERVER_VIDEO_CALL0_COUNT])(void) = -{ - glEnd, - glEndList, - glFlush, - glLoadIdentity, - _glx_swap_buffers -}; - -static void (*_glx_func1d[GSERVER_VIDEO_CALL1d_COUNT])(double) = -{ - glClearDepth -}; - -static void (*_glx_func1f[GSERVER_VIDEO_CALL1f_COUNT])(float) = -{ - glClearIndex, - glPointSize -}; - -static void (*_glx_func1i[GSERVER_VIDEO_CALL1i_COUNT])(uint32_t) = -{ - glActiveTexture, - glArrayElement, - glBegin, - glBlendEquation, - glCallList, - glClear, - glClearStencil, - glClientActiveTexture, -#if 0 - glCompileShader, -#endif - glDepthFunc, - glDisable, - glDisableClientState, - glEnable, - glEnableClientState, - glIsEnabled, - glShadeModel -}; - -static void (*_glx_func2f[GSERVER_VIDEO_CALL2f_COUNT])(float, float) = -{ - glPolygonOffset, - glTexCoord2f -}; - -static void (*_glx_func2i[GSERVER_VIDEO_CALL2i_COUNT])(uint32_t, uint32_t) = -{ -#if 0 - glAttachShader, - glBeginQuery, - glBindBuffer, -#endif - glBindTexture, -#if 0 - glBlendEquationSeparate, -#endif - glBlendFunc, - glColorMaterial, - glFogi, - glHint, - glLightModeli, - glVertex2i -}; - -static void (*_glx_func3b[GSERVER_VIDEO_CALL3b_COUNT])(uint8_t, uint8_t, - uint8_t) = -{ - glColor3b, - glColor3ub -}; - -static void (*_glx_func3d[GSERVER_VIDEO_CALL3d_COUNT])(double, double, - double) = -{ - glColor3d, - glTranslated -}; - -static void (*_glx_func3f[GSERVER_VIDEO_CALL3f_COUNT])(float, float, float) = -{ - glColor3f, - glNormal3f, - glTranslatef, - glVertex3f -}; - -static void (*_glx_func3i[GSERVER_VIDEO_CALL3i_COUNT])(uint32_t, uint32_t, - uint32_t) = -{ - glColor3i, - glColor3ui, - glDrawArrays, - glLighti, - glTexGeni, - glTexParameteri, - glVertex3i -}; - -static void (*_glx_func3s[GSERVER_VIDEO_CALL3s_COUNT])(uint16_t, uint16_t, - uint16_t) = -{ - glColor3s, - glColor3us -}; - -static void (*_glx_func4b[GSERVER_VIDEO_CALL4b_COUNT])(uint8_t, uint8_t, - uint8_t, uint8_t) = -{ - glColor4b, - glColor4ub -}; - -static void (*_glx_func4d[GSERVER_VIDEO_CALL4d_COUNT])(double, double, double, - double) = -{ - glColor4d -}; - -static void (*_glx_func4f[GSERVER_VIDEO_CALL4f_COUNT])(float, float, float, - float) = -{ - glClearAccum, - glClearColor, - glRotatef -}; - -static void (*_glx_func4i[GSERVER_VIDEO_CALL4i_COUNT])(uint32_t, uint32_t, - uint32_t, uint32_t) = -{ -#if 0 - glBlendFuncSeparate, -#endif - glColor4i, - glColor4ui, - glColorMask, - glScissor, - glViewport -}; - -static void (*_glx_func4s[GSERVER_VIDEO_CALL4s_COUNT])(uint16_t, uint16_t, - uint16_t, uint16_t) = -{ - glColor4s, - glColor4us -}; - - /* public */ /* variables */ GServerVideoPlugin video_plugin = @@ -239,22 +55,6 @@ GServerVideoPlugin video_plugin = "GLX", _glx_init, _glx_destroy, - _glx_call0, - _glx_call1d, - _glx_call1f, - _glx_call1i, - _glx_call2f, - _glx_call2i, - _glx_call3b, - _glx_call3d, - _glx_call3f, - _glx_call3i, - _glx_call3s, - _glx_call4b, - _glx_call4d, - _glx_call4f, - _glx_call4i, - _glx_call4s, NULL }; @@ -376,178 +176,6 @@ static void _glx_destroy(GServerVideoPlugin * plugin) /* functions */ -/* glx_call0 */ -static void _glx_call0(GServerVideoPlugin * plugin, GServerVideoCall0 func) -{ - GLXVideo * glx = plugin->priv; - - if(func == GSERVER_VIDEO_CALL0_SwapBuffers) - { - if(glx->double_buffered != 0) - glXSwapBuffers(glx->display, glx->window); - return; - } - _glx_func0[func](); -} - - -/* glx_call1d */ -static void _glx_call1d(GServerVideoPlugin * plugin, GServerVideoCall1d func, - double x) -{ - (void) plugin; - - _glx_func1d[func](x); -} - - -/* glx_call1f */ -static void _glx_call1f(GServerVideoPlugin * plugin, GServerVideoCall1f func, - float x) -{ - (void) plugin; - - _glx_func1f[func](x); -} - - -/* glx_call1i */ -static void _glx_call1i(GServerVideoPlugin * plugin, GServerVideoCall1i func, - uint32_t x) -{ - (void) plugin; - - _glx_func1i[func](x); -} - - -/* glx_call2f */ -static void _glx_call2f(GServerVideoPlugin * plugin, GServerVideoCall2f func, - float x, float y) -{ - (void) plugin; - - _glx_func2f[func](x, y); -} - - -/* glx_call2i */ -static void _glx_call2i(GServerVideoPlugin * plugin, GServerVideoCall2i func, - uint32_t x, uint32_t y) -{ - (void) plugin; - - _glx_func2i[func](x, y); -} - - -/* glx_call3b */ -static void _glx_call3b(GServerVideoPlugin * plugin, GServerVideoCall3b func, - uint8_t x, uint8_t y, uint8_t z) -{ - (void) plugin; - - _glx_func3b[func](x, y, z); -} - - -/* glx_call3d */ -static void _glx_call3d(GServerVideoPlugin * plugin, GServerVideoCall3d func, - double x, double y, double z) -{ - (void) plugin; - - _glx_func3d[func](x, y, z); -} - - -/* glx_call3f */ -static void _glx_call3f(GServerVideoPlugin * plugin, GServerVideoCall3f func, - float x, float y, float z) -{ - (void) plugin; - - _glx_func3f[func](x, y, z); -} - - -/* glx_call3i */ -static void _glx_call3i(GServerVideoPlugin * plugin, GServerVideoCall3i func, - uint32_t x, uint32_t y, uint32_t z) -{ - (void) plugin; - - _glx_func3i[func](x, y, z); -} - - -/* glx_call3s */ -static void _glx_call3s(GServerVideoPlugin * plugin, GServerVideoCall3s func, - uint16_t x, uint16_t y, uint16_t z) -{ - (void) plugin; - - _glx_func3s[func](x, y, z); -} - - -/* glx_call4b */ -static void _glx_call4b(GServerVideoPlugin * plugin, GServerVideoCall4b func, - uint8_t x, uint8_t y, uint8_t z, uint8_t t) -{ - (void) plugin; - - _glx_func4b[func](x, y, z, t); -} - - -/* glx_call4d */ -static void _glx_call4d(GServerVideoPlugin * plugin, GServerVideoCall4d func, - double x, double y, double z, double t) -{ - (void) plugin; - - _glx_func4d[func](x, y, z, t); -} - - -/* glx_call4f */ -static void _glx_call4f(GServerVideoPlugin * plugin, GServerVideoCall4f func, - float x, float y, float z, float t) -{ - (void) plugin; - - _glx_func4f[func](x, y, z, t); -} - - -/* glx_call4i */ -static void _glx_call4i(GServerVideoPlugin * plugin, GServerVideoCall4i func, - uint32_t x, uint32_t y, uint32_t z, uint32_t t) -{ - (void) plugin; - - _glx_func4i[func](x, y, z, t); -} - - -/* glx_call4s */ -static void _glx_call4s(GServerVideoPlugin * plugin, GServerVideoCall4s func, - uint16_t x, uint16_t y, uint16_t z, uint16_t t) -{ - (void) plugin; - - _glx_func4s[func](x, y, z, t); -} - - -/* glx_swap_buffers */ -static void _glx_swap_buffers(void) -{ - /* no need to do anything */ -} - - /* glx_timeout */ static int _glx_timeout(void * data) { diff --git a/src/video/sdl.c b/src/video/sdl.c index 62c2050..5332544 100644 --- a/src/video/sdl.c +++ b/src/video/sdl.c @@ -41,190 +41,6 @@ typedef struct _SDLVideo static int _sdl_init(GServerVideoPlugin * plugin); static void _sdl_destroy(GServerVideoPlugin * plugin); -static void _sdl_call0(GServerVideoPlugin * plugin, GServerVideoCall0 func); -static void _sdl_call1d(GServerVideoPlugin * plugin, GServerVideoCall1d func, - double x); -static void _sdl_call1f(GServerVideoPlugin * plugin, GServerVideoCall1f func, - float x); -static void _sdl_call1i(GServerVideoPlugin * plugin, GServerVideoCall1i func, - uint32_t x); -static void _sdl_call2f(GServerVideoPlugin * plugin, GServerVideoCall2f func, - float x, float y); -static void _sdl_call2i(GServerVideoPlugin * plugin, GServerVideoCall2i func, - uint32_t x, uint32_t y); -static void _sdl_call3b(GServerVideoPlugin * plugin, GServerVideoCall3b func, - uint8_t x, uint8_t y, uint8_t z); -static void _sdl_call3d(GServerVideoPlugin * plugin, GServerVideoCall3d func, - double x, double y, double z); -static void _sdl_call3f(GServerVideoPlugin * plugin, GServerVideoCall3f func, - float x, float y, float z); -static void _sdl_call3i(GServerVideoPlugin * plugin, GServerVideoCall3i func, - uint32_t x, uint32_t y, uint32_t z); -static void _sdl_call3s(GServerVideoPlugin * plugin, GServerVideoCall3s func, - uint16_t x, uint16_t y, uint16_t z); -static void _sdl_call4b(GServerVideoPlugin * plugin, GServerVideoCall4b func, - uint8_t x, uint8_t y, uint8_t z, uint8_t t); -static void _sdl_call4d(GServerVideoPlugin * plugin, GServerVideoCall4d func, - double x, double y, double z, double t); -static void _sdl_call4f(GServerVideoPlugin * plugin, GServerVideoCall4f func, - float x, float y, float z, float t); -static void _sdl_call4i(GServerVideoPlugin * plugin, GServerVideoCall4i func, - uint32_t x, uint32_t y, uint32_t z, uint32_t t); -static void _sdl_call4s(GServerVideoPlugin * plugin, GServerVideoCall4s func, - uint16_t x, uint16_t y, uint16_t z, uint16_t t); - -static void _sdl_swap_buffers(void); - - -/* variables */ -static void (*_sdl_func0[GSERVER_VIDEO_CALL0_COUNT])(void) = -{ - glEnd, - glFlush, - glLoadIdentity, - _sdl_swap_buffers -}; - -static void (*_sdl_func1d[GSERVER_VIDEO_CALL1d_COUNT])(double) = -{ - glClearDepth -}; - -static void (*_sdl_func1f[GSERVER_VIDEO_CALL1f_COUNT])(float) = -{ - glClearIndex, - glPointSize -}; - -static void (*_sdl_func1i[GSERVER_VIDEO_CALL1i_COUNT])(uint32_t) = -{ - glActiveTexture, - glArrayElement, - glBegin, - glBlendEquation, - glCallList, - glClear, - glClearStencil, - glClientActiveTexture, -#if 0 - glCompileShader, -#endif - glDepthFunc, - glDisable, - glDisableClientState, - glEnable, - glEnableClientState, - glIsEnabled, - glShadeModel -}; - -static void (*_sdl_func2f[GSERVER_VIDEO_CALL2f_COUNT])(float, float) = -{ - glPolygonOffset, - glTexCoord2f -}; - -static void (*_sdl_func2i[GSERVER_VIDEO_CALL2i_COUNT])(uint32_t, uint32_t) = -{ -#if 0 - glAttachShader, - glBeginQuery, - glBindBuffer, -#endif - glBindTexture, -#if 0 - glBlendEquationSeparate, -#endif - glBlendFunc, - glColorMaterial, - glFogi, - glHint, - glLightModeli, - glVertex2i -}; - -static void (*_sdl_func3b[GSERVER_VIDEO_CALL3b_COUNT])(uint8_t, uint8_t, - uint8_t) = -{ - glColor3b, - glColor3ub -}; - -static void (*_sdl_func3d[GSERVER_VIDEO_CALL3d_COUNT])(double, double, - double) = -{ - glColor3d, - glTranslated -}; - -static void (*_sdl_func3f[GSERVER_VIDEO_CALL3f_COUNT])(float, float, float) = -{ - glColor3f, - glNormal3f, - glTranslatef, - glVertex3f -}; - -static void (*_sdl_func3i[GSERVER_VIDEO_CALL3i_COUNT])(uint32_t, uint32_t, - uint32_t) = -{ - glColor3i, - glColor3ui, - glDrawArrays, - glLighti, - glTexGeni, - glTexParameteri, - glVertex3i -}; - -static void (*_sdl_func3s[GSERVER_VIDEO_CALL3s_COUNT])(uint16_t, uint16_t, - uint16_t) = -{ - glColor3s, - glColor3us -}; - -static void (*_sdl_func4b[GSERVER_VIDEO_CALL4b_COUNT])(uint8_t, uint8_t, - uint8_t, uint8_t) = -{ - glColor4b, - glColor4ub -}; - -static void (*_sdl_func4d[GSERVER_VIDEO_CALL4d_COUNT])(double, double, double, - double) = -{ - glColor4d -}; - -static void (*_sdl_func4f[GSERVER_VIDEO_CALL4f_COUNT])(float, float, float, - float) = -{ - glClearAccum, - glClearColor, - glRotatef -}; - -static void (*_sdl_func4i[GSERVER_VIDEO_CALL4i_COUNT])(uint32_t, uint32_t, - uint32_t, uint32_t) = -{ -#if 0 - glBlendFuncSeparate, -#endif - glColor4i, - glColor4ui, - glColorMask, - glScissor, - glViewport -}; - -static void (*_sdl_func4s[GSERVER_VIDEO_CALL4s_COUNT])(uint16_t, uint16_t, - uint16_t, uint16_t) = -{ - glColor4s, - glColor4us -}; - /* public */ /* variables */ @@ -234,22 +50,6 @@ GServerVideoPlugin video_plugin = "SDL", _sdl_init, _sdl_destroy, - _sdl_call0, - _sdl_call1d, - _sdl_call1f, - _sdl_call1i, - _sdl_call2f, - _sdl_call2i, - _sdl_call3b, - _sdl_call3d, - _sdl_call3f, - _sdl_call3i, - _sdl_call3s, - _sdl_call4b, - _sdl_call4d, - _sdl_call4f, - _sdl_call4i, - _sdl_call4s, NULL }; @@ -326,175 +126,3 @@ static void _sdl_destroy(GServerVideoPlugin * plugin) SDL_Quit(); object_delete(sdl); } - - -/* functions */ -/* sdl_call0 */ -static void _sdl_call0(GServerVideoPlugin * plugin, GServerVideoCall0 func) -{ - (void) plugin; - - if(func == GSERVER_VIDEO_CALL0_SwapBuffers) - { - SDL_GL_SwapBuffers(); - return; - } - _sdl_func0[func](); -} - - -/* sdl_call1f */ -static void _sdl_call1f(GServerVideoPlugin * plugin, GServerVideoCall1f func, - float x) -{ - (void) plugin; - - _sdl_func1f[func](x); -} - - -/* sdl_call1d */ -static void _sdl_call1d(GServerVideoPlugin * plugin, GServerVideoCall1d func, - double x) -{ - (void) plugin; - - _sdl_func1d[func](x); -} - - -/* sdl_call1i */ -static void _sdl_call1i(GServerVideoPlugin * plugin, GServerVideoCall1i func, - uint32_t x) -{ - (void) plugin; - - _sdl_func1i[func](x); -} - - -/* sdl_call2f */ -static void _sdl_call2f(GServerVideoPlugin * plugin, GServerVideoCall2f func, - float x, float y) -{ - (void) plugin; - - _sdl_func2f[func](x, y); -} - - -/* sdl_call2i */ -static void _sdl_call2i(GServerVideoPlugin * plugin, GServerVideoCall2i func, - uint32_t x, uint32_t y) -{ - (void) plugin; - - _sdl_func2i[func](x, y); -} - - -/* sdl_call3b */ -static void _sdl_call3b(GServerVideoPlugin * plugin, GServerVideoCall3b func, - uint8_t x, uint8_t y, uint8_t z) -{ - (void) plugin; - - _sdl_func3b[func](x, y, z); -} - - -/* sdl_call3d */ -static void _sdl_call3d(GServerVideoPlugin * plugin, GServerVideoCall3d func, - double x, double y, double z) -{ - (void) plugin; - - _sdl_func3d[func](x, y, z); -} - - -/* sdl_call3f */ -static void _sdl_call3f(GServerVideoPlugin * plugin, GServerVideoCall3f func, - float x, float y, float z) -{ - (void) plugin; - - _sdl_func3f[func](x, y, z); -} - - -/* sdl_call3i */ -static void _sdl_call3i(GServerVideoPlugin * plugin, GServerVideoCall3i func, - uint32_t x, uint32_t y, uint32_t z) -{ - (void) plugin; - - _sdl_func3i[func](x, y, z); -} - - -/* sdl_call3s */ -static void _sdl_call3s(GServerVideoPlugin * plugin, GServerVideoCall3s func, - uint16_t x, uint16_t y, uint16_t z) -{ - (void) plugin; - - _sdl_func3s[func](x, y, z); -} - - -/* sdl_call4b */ -static void _sdl_call4b(GServerVideoPlugin * plugin, GServerVideoCall4b func, - uint8_t x, uint8_t y, uint8_t z, uint8_t t) -{ - (void) plugin; - - _sdl_func4b[func](x, y, z, t); -} - - -/* sdl_call4d */ -static void _sdl_call4d(GServerVideoPlugin * plugin, GServerVideoCall4d func, - double x, double y, double z, double t) -{ - (void) plugin; - - _sdl_func4d[func](x, y, z, t); -} - - -/* sdl_call4f */ -static void _sdl_call4f(GServerVideoPlugin * plugin, GServerVideoCall4f func, - float x, float y, float z, float t) -{ - (void) plugin; - - _sdl_func4f[func](x, y, z, t); -} - - -/* sdl_call4i */ -static void _sdl_call4i(GServerVideoPlugin * plugin, GServerVideoCall4i func, - uint32_t x, uint32_t y, uint32_t z, uint32_t t) -{ - (void) plugin; - - _sdl_func4i[func](x, y, z, t); -} - - -/* sdl_call4s */ -static void _sdl_call4s(GServerVideoPlugin * plugin, GServerVideoCall4s func, - uint16_t x, uint16_t y, uint16_t z, uint16_t t) -{ - (void) plugin; - - _sdl_func4s[func](x, y, z, t); -} - - -/* sdl_swap_buffers */ -static void _sdl_swap_buffers(void) -{ - /* no need to do anything */ -} diff --git a/src/video/vesa.c b/src/video/vesa.c index 7532601..0378cc5 100644 --- a/src/video/vesa.c +++ b/src/video/vesa.c @@ -43,21 +43,5 @@ GServerVideoPlugin video_plugin = "VESA", _vesa_init, _vesa_destroy, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, NULL };