diff --git a/targets/platform/renderer/gl/GLRenderer.cpp b/targets/platform/renderer/gl/GLRenderer.cpp index 0a9b87b7d..f08174bb8 100644 --- a/targets/platform/renderer/gl/GLRenderer.cpp +++ b/targets/platform/renderer/gl/GLRenderer.cpp @@ -1406,44 +1406,6 @@ void glDeleteTextures_4J(int n, const unsigned int* textures) { ::glDeleteTextures(n, textures); } -void glBeginQuery_4J_Helper(unsigned int target, unsigned int id) { - typedef void (*PFNGLBEGINQUERYPROC)(unsigned int, unsigned int); - static PFNGLBEGINQUERYPROC fn = - (PFNGLBEGINQUERYPROC)dlsym(RTLD_DEFAULT, "glBeginQuery"); - if (fn) fn(target, id); -} - -void glEndQuery_4J_Helper(unsigned int target) { - typedef void (*PFNGLENDQUERYPROC)(unsigned int); - static PFNGLENDQUERYPROC fn = - (PFNGLENDQUERYPROC)dlsym(RTLD_DEFAULT, "glEndQuery"); - if (fn) fn(target); -} - -void glGenQueries_4J_Helper(unsigned int* id) { -#ifdef GLES - glGenQueries(1, id); -#else - typedef void (*PFNGLGENQUERIESPROC)(int, unsigned int*); - static PFNGLGENQUERIESPROC fn = - (PFNGLGENQUERIESPROC)dlsym(RTLD_DEFAULT, "glGenQueries"); - if (fn) fn(1, id); -#endif -} - -void glGetQueryObjectu_4J_Helper(unsigned int id, unsigned int pname, - unsigned int* val) { -#ifdef GLES - glGetQueryObjectuiv(id, pname, val); -#else - typedef void (*PFNGLGETQUERYOBJECTUIVPROC)(unsigned int, unsigned int, - unsigned int*); - static PFNGLGETQUERYOBJECTUIVPROC fn = - (PFNGLGETQUERYOBJECTUIVPROC)dlsym(RTLD_DEFAULT, "glGetQueryObjectuiv"); - if (fn) fn(id, pname, val); -#endif -} - // c hooks #undef glFogfv #undef glLightfv @@ -1578,54 +1540,9 @@ void glVertexPointer_4J(int, int, FloatBuffer*) {} void glEndList_4J(int) {} void glTexGen_4J(int, int, FloatBuffer*) {} -#include #include #include -static PFNGLGENQUERIESARBPROC _glGenQueriesARB = nullptr; -static PFNGLBEGINQUERYARBPROC _glBeginQueryARB = nullptr; -static PFNGLENDQUERYARBPROC _glEndQueryARB = nullptr; -static PFNGLGETQUERYOBJECTUIVARBPROC _glGetQueryObjectuivARB = nullptr; -static bool _queriesInitialized = false; - -static void initQueryFuncs() { - if (_queriesInitialized) return; - _queriesInitialized = true; - _glGenQueriesARB = - (PFNGLGENQUERIESARBPROC)dlsym(RTLD_DEFAULT, "glGenQueriesARB"); - _glBeginQueryARB = - (PFNGLBEGINQUERYARBPROC)dlsym(RTLD_DEFAULT, "glBeginQueryARB"); - _glEndQueryARB = (PFNGLENDQUERYARBPROC)dlsym(RTLD_DEFAULT, "glEndQueryARB"); - _glGetQueryObjectuivARB = (PFNGLGETQUERYOBJECTUIVARBPROC)dlsym( - RTLD_DEFAULT, "glGetQueryObjectuivARB"); -} - -void glGenQueriesARB_4J(IntBuffer* buf) { - initQueryFuncs(); - if (_glGenQueriesARB && buf) { - int n = buf->limit() - buf->position(); - if (n > 0) _glGenQueriesARB(n, (GLuint*)getIntPtr(buf)); - } -} - -void glBeginQueryARB_4J(int target, int id) { - initQueryFuncs(); - if (_glBeginQueryARB) _glBeginQueryARB((GLenum)target, (GLuint)id); -} - -void glEndQueryARB_4J(int target) { - initQueryFuncs(); - if (_glEndQueryARB) _glEndQueryARB((GLenum)target); -} - -void glGetQueryObjectuARB_4J(int id, int pname, IntBuffer* params) { - initQueryFuncs(); - if (_glGetQueryObjectuivARB && params) - // LWJGL does not change limits/positions during these calls, it - // reads/writes exactly at pointer!! - _glGetQueryObjectuivARB((GLuint)id, (GLenum)pname, - (GLuint*)getIntPtr(params)); -} void glGetFloat(int pname, FloatBuffer* params) { glGetFloat_4J(pname, params); } diff --git a/targets/platform/renderer/gl/gl_compat.h b/targets/platform/renderer/gl/gl_compat.h index ed9b6f06d..df64fed1a 100644 --- a/targets/platform/renderer/gl/gl_compat.h +++ b/targets/platform/renderer/gl/gl_compat.h @@ -574,12 +574,6 @@ inline void glReadPixels_4J(int x, int y, int width, int height, int format, ::glReadPixels(x, y, width, height, (unsigned int)format, (unsigned int)type, pixels->getBuffer()); } -void glBeginQuery_4J_Helper(unsigned int target, unsigned int id); -void glEndQuery_4J_Helper(unsigned int target); -void glGenQueries_4J_Helper(unsigned int* id); -void glGetQueryObjectu_4J_Helper(unsigned int id, unsigned int pname, - unsigned int* val); - // redirect the functions to my own implementation, no more 2.1 funcs #define glGenTextures(...) glGenTextures_4J(__VA_ARGS__) #define glDeleteTextures(...) glDeleteTextures_4J(__VA_ARGS__) diff --git a/targets/platform/renderer/meson.build b/targets/platform/renderer/meson.build index 0977323a7..cd9998ab1 100644 --- a/targets/platform/renderer/meson.build +++ b/targets/platform/renderer/meson.build @@ -1,5 +1,4 @@ platform_renderer_gl_dependencies = [ - dependency('dl'), dependency('sdl2'), dependency('glm'), dependency('stb'), diff --git a/targets/platform/stubs.h b/targets/platform/stubs.h index b99db20a1..114bb6fe3 100644 --- a/targets/platform/stubs.h +++ b/targets/platform/stubs.h @@ -34,11 +34,6 @@ void glEndList_4J(int vertexCount = 0); void glTexImage2D(int, int, int, int, int, int, int, int, ByteBuffer*); void glCallLists(IntBuffer*); -void glGenQueriesARB(IntBuffer*); -void glBeginQueryARB(int, int); -void glEndQueryARB(int); -void glGetQueryObjectuARB(int, int, IntBuffer*); -void glReadPixels(int, int, int, int, int, int, ByteBuffer*); class GL11 { public: