diff --git a/sources/Renderer/OpenGL/GLCoreProfile/GLCoreExtensions.cpp b/sources/Renderer/OpenGL/GLCoreProfile/GLCoreExtensions.cpp index ffcd6a42d4..db561ac33e 100644 --- a/sources/Renderer/OpenGL/GLCoreProfile/GLCoreExtensions.cpp +++ b/sources/Renderer/OpenGL/GLCoreProfile/GLCoreExtensions.cpp @@ -12,12 +12,13 @@ namespace LLGL { -#define LLGL_DEF_GL_EXT_PROCS +#define DECL_GLPROC(PFNTYPE, NAME, RTYPE, ARGS) \ + PFNTYPE NAME = nullptr // Include inline header for object definitions #include "GLCoreExtensionsDecl.inl" -#undef LLGL_DEF_GL_EXT_PROCS +#undef DECL_GLPROC } // /namespace LLGL diff --git a/sources/Renderer/OpenGL/GLCoreProfile/GLCoreExtensions.h b/sources/Renderer/OpenGL/GLCoreProfile/GLCoreExtensions.h index 37bfbcc07c..f8fc02f739 100644 --- a/sources/Renderer/OpenGL/GLCoreProfile/GLCoreExtensions.h +++ b/sources/Renderer/OpenGL/GLCoreProfile/GLCoreExtensions.h @@ -17,9 +17,15 @@ namespace LLGL { + +#define DECL_GLPROC(PFNTYPE, NAME, RTYPE, ARGS) \ + extern PFNTYPE NAME + // Include inline header for object declarations #include "GLCoreExtensionsDecl.inl" +#undef DECL_GLPROC + } // /namespace LLGL diff --git a/sources/Renderer/OpenGL/GLCoreProfile/GLCoreExtensionsDecl.inl b/sources/Renderer/OpenGL/GLCoreProfile/GLCoreExtensionsDecl.inl index 54a364ee4b..ac09cd42a6 100644 --- a/sources/Renderer/OpenGL/GLCoreProfile/GLCoreExtensionsDecl.inl +++ b/sources/Renderer/OpenGL/GLCoreProfile/GLCoreExtensionsDecl.inl @@ -7,41 +7,11 @@ // THIS FILE MUST NOT HAVE A HEADER GUARD -/* -All OpenGL extension functions are declared here. -Depending on the following macros being defined, the respective implementation is enabled: -- LLGL_DEF_GL_PROXY_PROCS: defines the proxy functions for potentially unsupported GL extensions -- LLGL_DECL_GL_PROXY_PROCS: declares the proxy functions for potentially unsupported GL extensions -- LLGL_DEF_GL_EXT_PROCS: defines the global function pointer for GL extensions -- None: declares the global function pointer for GL extensions -*/ - #ifndef __APPLE__ -#if defined LLGL_DEF_GL_PROXY_PROCS - -#define DECL_GLPROC(PFNTYPE, NAME, RTYPE, ARGS) \ - RTYPE APIENTRY Proxy_##NAME ARGS \ - { \ - ErrUnsupportedGLProc(#NAME); \ - } - -#elif defined LLGL_DECL_GL_PROXY_PROCS - -#define DECL_GLPROC(PFNTYPE, NAME, RTYPE, ARGS) \ - RTYPE APIENTRY Proxy_##NAME ARGS - -#elif defined LLGL_DEF_GL_EXT_PROCS - -#define DECL_GLPROC(PFNTYPE, NAME, RTYPE, ARGS) \ - PFNTYPE NAME = nullptr - -#else - -#define DECL_GLPROC(PFNTYPE, NAME, RTYPE, ARGS) \ - extern PFNTYPE NAME - +#ifndef DECL_GLPROC +#error Missing definition of macro DECL_GLPROC(PFNTYPE, NAME, RTYPE, ARGS) #endif /* Platform specific GL extensions */ diff --git a/sources/Renderer/OpenGL/GLCoreProfile/GLCoreExtensionsProxy.cpp b/sources/Renderer/OpenGL/GLCoreProfile/GLCoreExtensionsProxy.cpp index 5b3999721c..d799f2c653 100644 --- a/sources/Renderer/OpenGL/GLCoreProfile/GLCoreExtensionsProxy.cpp +++ b/sources/Renderer/OpenGL/GLCoreProfile/GLCoreExtensionsProxy.cpp @@ -16,12 +16,16 @@ namespace LLGL { -#define LLGL_DEF_GL_PROXY_PROCS +#define DECL_GLPROC(PFNTYPE, NAME, RTYPE, ARGS) \ + RTYPE APIENTRY Proxy_##NAME ARGS \ + { \ + ErrUnsupportedGLProc(#NAME); \ + } // Include inline header for proxy function definitions #include "GLCoreExtensionsDecl.inl" -#undef LLGL_DEF_GL_PROXY_PROCS +#undef DECL_GLPROC } // /namespace LLGL diff --git a/sources/Renderer/OpenGL/GLCoreProfile/GLCoreExtensionsProxy.h b/sources/Renderer/OpenGL/GLCoreProfile/GLCoreExtensionsProxy.h index 9c4fbe7e64..ce0de0b775 100644 --- a/sources/Renderer/OpenGL/GLCoreProfile/GLCoreExtensionsProxy.h +++ b/sources/Renderer/OpenGL/GLCoreProfile/GLCoreExtensionsProxy.h @@ -12,12 +12,13 @@ namespace LLGL { -#define LLGL_DECL_GL_PROXY_PROCS +#define DECL_GLPROC(PFNTYPE, NAME, RTYPE, ARGS) \ + RTYPE APIENTRY Proxy_##NAME ARGS // Include inline header for proxy function declarations #include "GLCoreExtensionsDecl.inl" -#undef LLGL_DECL_GL_PROXY_PROCS +#undef DECL_GLPROC } // /namespace LLGL