Abstract selector of translator or host GL libs a bit more

This commit is contained in:
Simon Fels 2017-01-20 18:05:40 +01:00
commit 30c2186826
13 changed files with 130 additions and 57 deletions

View file

@ -42,12 +42,13 @@ LIST_RENDER_EGL_EXTENSIONS_FUNCTIONS(RENDER_EGL_DEFINE_TYPE)
// Define EGLDispatch structure.
struct EGLDispatch {
bool initialized = false;
LIST_RENDER_EGL_FUNCTIONS(RENDER_EGL_DECLARE_MEMBER)
LIST_RENDER_EGL_EXTENSIONS_FUNCTIONS(RENDER_EGL_DECLARE_MEMBER)
};
// Initialize EGLDispatch function. Return true on success, false on failure.
bool init_egl_dispatch();
bool init_egl_dispatch(const char *path);
// Global EGLDispatch instance. Call init_egl_dispatch() before using it.
extern EGLDispatch s_egl;

View file

@ -26,6 +26,7 @@
LIST_GLES1_FUNCTIONS(GLES1_DISPATCH_DEFINE_TYPE,GLES1_DISPATCH_DEFINE_TYPE)
struct GLESv1Dispatch {
bool initialized = false;
#define GLES1_DISPATCH_DECLARE_POINTER(return_type,func_name,signature,callargs) \
func_name ## _t func_name;
LIST_GLES1_FUNCTIONS(GLES1_DISPATCH_DECLARE_POINTER,
@ -35,7 +36,7 @@ struct GLESv1Dispatch {
#undef GLES1_DISPATCH_DECLARE_POINTER
#undef GLES1_DISPATCH_DEFINE_TYPE
bool gles1_dispatch_init(GLESv1Dispatch* dispatch_table);
bool gles1_dispatch_init(const char *path, GLESv1Dispatch* dispatch_table);
// Used to initialize the decoder.
void* gles1_dispatch_get_proc_func(const char* name, void* userData);

View file

@ -26,6 +26,7 @@
LIST_GLES2_FUNCTIONS(GLES2_DISPATCH_DEFINE_TYPE,GLES2_DISPATCH_DEFINE_TYPE)
struct GLESv2Dispatch {
bool initialized = false;
#define GLES2_DISPATCH_DECLARE_POINTER(return_type,func_name,signature,callargs) \
func_name ## _t func_name;
LIST_GLES2_FUNCTIONS(GLES2_DISPATCH_DECLARE_POINTER,
@ -35,7 +36,7 @@ struct GLESv2Dispatch {
#undef GLES2_DISPATCH_DECLARE_POINTER
#undef GLES2_DISPATCH_DEFINE_TYPE
bool gles2_dispatch_init(GLESv2Dispatch* dispatch_table);
bool gles2_dispatch_init(const char *path, GLESv2Dispatch* dispatch_table);
// Used to initialize the decoder.
void* gles2_dispatch_get_proc_func(const char* name, void* userData);