From 95afdaf42d24c2874461d5e3dd4b9e8dcb0beba1 Mon Sep 17 00:00:00 2001 From: assiduous Date: Tue, 15 Sep 2020 19:53:07 -0700 Subject: Fixed Mac/Linux/iOS build issues --- Graphics/GraphicsEngineOpenGL/include/GLStubsAndroid.h | 3 +++ .../GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp | 18 +++++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) (limited to 'Graphics/GraphicsEngineOpenGL') diff --git a/Graphics/GraphicsEngineOpenGL/include/GLStubsAndroid.h b/Graphics/GraphicsEngineOpenGL/include/GLStubsAndroid.h index 41abe30a..2472f642 100644 --- a/Graphics/GraphicsEngineOpenGL/include/GLStubsAndroid.h +++ b/Graphics/GraphicsEngineOpenGL/include/GLStubsAndroid.h @@ -923,6 +923,9 @@ extern PFNGLMEMORYBARRIERPROC glMemoryBarrier; /* ------------------------------ GL_KHR_debug ----------------------------- */ +#infdef GL_KHR_debug +# define GL_KHR_debug 1 +#endif #ifndef GL_DEBUG_OUTPUT # define GL_DEBUG_OUTPUT 0x92E0 diff --git a/Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp index 0c7db58a..cad867a9 100644 --- a/Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp +++ b/Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp @@ -54,13 +54,14 @@ namespace Diligent { -static void APIENTRY openglCallbackFunction(GLenum source, - GLenum type, - GLuint id, - GLenum severity, - GLsizei length, - const GLchar* message, - const void* userParam) +#if GL_KHR_debug +static void openglCallbackFunction(GLenum source, + GLenum type, + GLuint id, + GLenum severity, + GLsizei length, + const GLchar* message, + const void* userParam) { auto* ShowDebugOutput = reinterpret_cast(userParam); if (*ShowDebugOutput == 0) @@ -121,6 +122,7 @@ static void APIENTRY openglCallbackFunction(GLenum source, LOG_INFO_MESSAGE(MessageSS.str().c_str()); } +#endif RenderDeviceGLImpl::RenderDeviceGLImpl(IReferenceCounters* pRefCounters, IMemoryAllocator& RawMemAllocator, @@ -165,6 +167,7 @@ RenderDeviceGLImpl::RenderDeviceGLImpl(IReferenceCounters* pRefCounters, m_ExtensionStrings.emplace(reinterpret_cast(CurrExtension)); } +#if GL_KHR_debug if (InitAttribs.CreateDebugContext && glDebugMessageCallback != nullptr) { glEnable(GL_DEBUG_OUTPUT); @@ -182,6 +185,7 @@ RenderDeviceGLImpl::RenderDeviceGLImpl(IReferenceCounters* pRefCounters, if (glGetError() != GL_NO_ERROR) LOG_ERROR_MESSAGE("Failed to enable debug messages"); } +#endif FlagSupportedTexFormats(); -- cgit v1.2.3