|
|
@ -27,15 +27,18 @@ |
|
|
|
#define PLATFORM_HAS_EGL 0 |
|
|
|
#define PLATFORM_HAS_EGL 0 |
|
|
|
#define PLATFORM_HAS_GLX 0 |
|
|
|
#define PLATFORM_HAS_GLX 0 |
|
|
|
#define PLATFORM_HAS_WGL 1 |
|
|
|
#define PLATFORM_HAS_WGL 1 |
|
|
|
#define EPOXYAPIENTRY __declspec(dllexport) __stdcall |
|
|
|
#define EPOXYCALL __stdcall |
|
|
|
|
|
|
|
#define EPOXYAPIENTRY __declspec(dllexport) EPOXYCALL |
|
|
|
#elif defined(__APPLE__) |
|
|
|
#elif defined(__APPLE__) |
|
|
|
#define PLATFORM_HAS_EGL 0 |
|
|
|
#define PLATFORM_HAS_EGL 0 |
|
|
|
#define PLATFORM_HAS_GLX 1 |
|
|
|
#define PLATFORM_HAS_GLX 1 |
|
|
|
#define PLATFORM_HAS_WGL 0 |
|
|
|
#define PLATFORM_HAS_WGL 0 |
|
|
|
|
|
|
|
#define EPOXYCALL |
|
|
|
#else |
|
|
|
#else |
|
|
|
#define PLATFORM_HAS_EGL 1 |
|
|
|
#define PLATFORM_HAS_EGL 1 |
|
|
|
#define PLATFORM_HAS_GLX 1 |
|
|
|
#define PLATFORM_HAS_GLX 1 |
|
|
|
#define PLATFORM_HAS_WGL 0 |
|
|
|
#define PLATFORM_HAS_WGL 0 |
|
|
|
|
|
|
|
#define EPOXYCALL |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#include "epoxy/gl.h" |
|
|
|
#include "epoxy/gl.h" |
|
|
@ -73,6 +76,76 @@ |
|
|
|
#define WRAPPER_VISIBILITY static GLAPIENTRY |
|
|
|
#define WRAPPER_VISIBILITY static GLAPIENTRY |
|
|
|
#define WRAPPER(x) x ## _wrapped |
|
|
|
#define WRAPPER(x) x ## _wrapped |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if USING_DISPATCH_TABLE |
|
|
|
|
|
|
|
#define GEN_GLOBAL_REWRITE_PTR(name, args, passthrough) |
|
|
|
|
|
|
|
#define GEN_GLOBAL_REWRITE_PTR_RET(ret, name, args, passthrough) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define GEN_DISPATCH_TABLE_REWRITE_PTR(name, args, passthrough) \ |
|
|
|
|
|
|
|
static EPOXYCALL void \
|
|
|
|
|
|
|
|
name##_dispatch_table_rewrite_ptr args \
|
|
|
|
|
|
|
|
{ \
|
|
|
|
|
|
|
|
struct dispatch_table *dispatch_table = get_dispatch_table(); \
|
|
|
|
|
|
|
|
\
|
|
|
|
|
|
|
|
dispatch_table->name = (void *)name##_resolver(); \
|
|
|
|
|
|
|
|
dispatch_table->name passthrough; \
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define GEN_DISPATCH_TABLE_REWRITE_PTR_RET(ret, name, args, passthrough) \ |
|
|
|
|
|
|
|
static EPOXYCALL ret \
|
|
|
|
|
|
|
|
name##_dispatch_table_rewrite_ptr args \
|
|
|
|
|
|
|
|
{ \
|
|
|
|
|
|
|
|
struct dispatch_table *dispatch_table = get_dispatch_table(); \
|
|
|
|
|
|
|
|
\
|
|
|
|
|
|
|
|
dispatch_table->name = (void *)name##_resolver(); \
|
|
|
|
|
|
|
|
return dispatch_table->name passthrough; \
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define GEN_DISPATCH_TABLE_THUNK(name, args, passthrough) \ |
|
|
|
|
|
|
|
static EPOXYCALL void \
|
|
|
|
|
|
|
|
name##_dispatch_table_thunk args \
|
|
|
|
|
|
|
|
{ \
|
|
|
|
|
|
|
|
get_dispatch_table()->name passthrough; \
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define GEN_DISPATCH_TABLE_THUNK_RET(ret, name, args, passthrough) \ |
|
|
|
|
|
|
|
static EPOXYCALL ret \
|
|
|
|
|
|
|
|
name##_dispatch_table_thunk args \
|
|
|
|
|
|
|
|
{ \
|
|
|
|
|
|
|
|
return get_dispatch_table()->name passthrough; \
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#else |
|
|
|
|
|
|
|
#define GEN_GLOBAL_REWRITE_PTR(name, args, passthrough) \ |
|
|
|
|
|
|
|
static EPOXYCALL void \
|
|
|
|
|
|
|
|
name##_global_rewrite_ptr args \
|
|
|
|
|
|
|
|
{ \
|
|
|
|
|
|
|
|
name = (void *)name##_resolver(); \
|
|
|
|
|
|
|
|
name passthrough; \
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define GEN_GLOBAL_REWRITE_PTR_RET(ret, name, args, passthrough) \ |
|
|
|
|
|
|
|
static EPOXYCALL ret \
|
|
|
|
|
|
|
|
name##_global_rewrite_ptr args \
|
|
|
|
|
|
|
|
{ \
|
|
|
|
|
|
|
|
name = (void *)name##_resolver(); \
|
|
|
|
|
|
|
|
return name passthrough; \
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
#define GEN_DISPATCH_TABLE_REWRITE_PTR(name, args, passthrough) |
|
|
|
|
|
|
|
#define GEN_DISPATCH_TABLE_REWRITE_PTR_RET(ret, name, args, passthrough) |
|
|
|
|
|
|
|
#define GEN_DISPATCH_TABLE_THUNK(name, args, passthrough) |
|
|
|
|
|
|
|
#define GEN_DISPATCH_TABLE_THUNK_RET(ret, name, args, passthrough) |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define GEN_THUNKS(name, args, passthrough) \ |
|
|
|
|
|
|
|
GEN_GLOBAL_REWRITE_PTR(name, args, passthrough) \
|
|
|
|
|
|
|
|
GEN_DISPATCH_TABLE_REWRITE_PTR(name, args, passthrough) \
|
|
|
|
|
|
|
|
GEN_DISPATCH_TABLE_THUNK(name, args, passthrough) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define GEN_THUNKS_RET(ret, name, args, passthrough) \ |
|
|
|
|
|
|
|
GEN_GLOBAL_REWRITE_PTR_RET(ret, name, args, passthrough) \
|
|
|
|
|
|
|
|
GEN_DISPATCH_TABLE_REWRITE_PTR_RET(ret, name, args, passthrough) \
|
|
|
|
|
|
|
|
GEN_DISPATCH_TABLE_THUNK_RET(ret, name, args, passthrough) |
|
|
|
|
|
|
|
|
|
|
|
void *epoxy_egl_dlsym(const char *name); |
|
|
|
void *epoxy_egl_dlsym(const char *name); |
|
|
|
void *epoxy_glx_dlsym(const char *name); |
|
|
|
void *epoxy_glx_dlsym(const char *name); |
|
|
|
void *epoxy_gl_dlsym(const char *name); |
|
|
|
void *epoxy_gl_dlsym(const char *name); |
|
|
@ -96,16 +169,22 @@ void epoxy_print_failure_reasons(const char *name, |
|
|
|
|
|
|
|
|
|
|
|
bool epoxy_extension_in_string(const char *extension_list, const char *ext); |
|
|
|
bool epoxy_extension_in_string(const char *extension_list, const char *ext); |
|
|
|
|
|
|
|
|
|
|
|
extern void UNWRAPPED_PROTO(epoxy_glBegin_unwrapped)(GLenum primtype); |
|
|
|
#define glBegin_unwrapped epoxy_glBegin_unwrapped |
|
|
|
extern void UNWRAPPED_PROTO(epoxy_glEnd_unwrapped)(void); |
|
|
|
#define glEnd_unwrapped epoxy_glEnd_unwrapped |
|
|
|
|
|
|
|
extern void UNWRAPPED_PROTO(glBegin_unwrapped)(GLenum primtype); |
|
|
|
|
|
|
|
extern void UNWRAPPED_PROTO(glEnd_unwrapped)(void); |
|
|
|
|
|
|
|
|
|
|
|
#if USING_DISPATCH_TABLE |
|
|
|
#if USING_DISPATCH_TABLE |
|
|
|
void gl_init_dispatch_table(void); |
|
|
|
void gl_init_dispatch_table(void); |
|
|
|
void wgl_init_dispatch_table(void); |
|
|
|
void wgl_init_dispatch_table(void); |
|
|
|
extern uint32_t gl_tls_index, gl_tls_size; |
|
|
|
extern uint32_t gl_tls_index, gl_tls_size; |
|
|
|
extern uint32_t wgl_tls_index, wgl_tls_size; |
|
|
|
extern uint32_t wgl_tls_index, wgl_tls_size; |
|
|
|
extern BOOL UNWRAPPED_PROTO(epoxy_wglMakeCurrent_unwrapped)(HDC hdc, HGLRC hglrc); |
|
|
|
#define wglMakeCurrent_unwrapped epoxy_wglMakeCurrent_unwrapped |
|
|
|
extern BOOL UNWRAPPED_PROTO(epoxy_wglMakeContextCurrentARB_unwrapped)(HDC hDrawDC, HDC hReadDC, HGLRC hglrc); |
|
|
|
#define wglMakeContextCurrentARB_unwrapped epoxy_wglMakeContextCurrentARB_unwrapped |
|
|
|
extern BOOL UNWRAPPED_PROTO(epoxy_wglMakeContextCurrentEXT_unwrapped)(HDC hDrawDC, HDC hReadDC, HGLRC hglrc); |
|
|
|
#define wglMakeContextCurrentEXT_unwrapped epoxy_wglMakeContextCurrentEXT_unwrapped |
|
|
|
extern BOOL UNWRAPPED_PROTO(epoxy_wglMakeAssociatedContextCurrentAMD_unwrapped)(HGLRC hglrc); |
|
|
|
#define wglMakeAssociatedContextCurrentAMD_unwrapped epoxy_wglMakeAssociatedContextCurrentAMD_unwrapped |
|
|
|
|
|
|
|
extern BOOL UNWRAPPED_PROTO(wglMakeCurrent_unwrapped)(HDC hdc, HGLRC hglrc); |
|
|
|
|
|
|
|
extern BOOL UNWRAPPED_PROTO(wglMakeContextCurrentARB_unwrapped)(HDC hDrawDC, HDC hReadDC, HGLRC hglrc); |
|
|
|
|
|
|
|
extern BOOL UNWRAPPED_PROTO(wglMakeContextCurrentEXT_unwrapped)(HDC hDrawDC, HDC hReadDC, HGLRC hglrc); |
|
|
|
|
|
|
|
extern BOOL UNWRAPPED_PROTO(wglMakeAssociatedContextCurrentAMD_unwrapped)(HGLRC hglrc); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|