From 9f1b7866d0167aaee0ddbded91eb3932a9148e03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Tue, 1 Sep 2015 13:34:36 -0700 Subject: [PATCH] Fixed OSX build. --- src/glimports.h | 4 ++-- src/renderer_gl.cpp | 14 ++++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/glimports.h b/src/glimports.h index 7e3e21b3..e7cc3fc6 100644 --- a/src/glimports.h +++ b/src/glimports.h @@ -301,8 +301,8 @@ GL_IMPORT______(true, PFNGLGETDEBUGMESSAGELOGPROC, glGetDebugMes GL_IMPORT______(false, PFNGLGETERRORPROC, glGetError); GL_IMPORT______(false, PFNGLGETFLOATVPROC, glGetFloatv); GL_IMPORT______(false, PFNGLGETINTEGERVPROC, glGetIntegerv); -GL_IMPORT______(false, PFNGLGETINTERNALFORMATIVPROC, glGetInternalformativ); -GL_IMPORT______(false, PFNGLGETINTERNALFORMATI64VPROC, glGetInternalformati64v); +GL_IMPORT______(true, PFNGLGETINTERNALFORMATIVPROC, glGetInternalformativ); +GL_IMPORT______(true, PFNGLGETINTERNALFORMATI64VPROC, glGetInternalformati64v); GL_IMPORT______(true, PFNGLGETOBJECTLABELPROC, glGetObjectLabel); GL_IMPORT______(true, PFNGLGETOBJECTPTRLABELPROC, glGetObjectPtrLabel); GL_IMPORT______(true, PFNGLGETPOINTERVPROC, glGetPointerv); diff --git a/src/renderer_gl.cpp b/src/renderer_gl.cpp index aaf28c65..a37ba9cb 100644 --- a/src/renderer_gl.cpp +++ b/src/renderer_gl.cpp @@ -1603,24 +1603,26 @@ namespace bgfx { namespace gl if (NULL != glGetInternalformativ) { GLint maxSamples; - GL_CHECK(glGetInternalformativ(GL_RENDERBUFFER + glGetInternalformativ(GL_RENDERBUFFER , s_textureFormat[ii].m_internalFmt , GL_SAMPLES , 1 , &maxSamples - ) ); - supported |= maxSamples > 0 + ); + GLenum err = glGetError(); + supported |= 0 == err && maxSamples > 0 ? BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA : BGFX_CAPS_FORMAT_TEXTURE_NONE ; - GL_CHECK(glGetInternalformativ(GL_TEXTURE_2D_MULTISAMPLE + glGetInternalformativ(GL_TEXTURE_2D_MULTISAMPLE , s_textureFormat[ii].m_internalFmt , GL_SAMPLES , 1 , &maxSamples - ) ); - supported |= maxSamples > 0 + ); + err = glGetError(); + supported |= 0 == err && maxSamples > 0 ? BGFX_CAPS_FORMAT_TEXTURE_MSAA : BGFX_CAPS_FORMAT_TEXTURE_NONE ;