diff --git a/src/glcontext_nsgl.mm b/src/glcontext_nsgl.mm index 0973a131..ccc9413d 100755 --- a/src/glcontext_nsgl.mm +++ b/src/glcontext_nsgl.mm @@ -26,8 +26,16 @@ namespace bgfx NSWindow* nsWindow = (NSWindow*)g_bgfxNSWindow; + NSOpenGLPixelFormatAttribute profile = +#if BGFX_CONFIG_RENDERER_OPENGL >= 31 + NSOpenGLProfileVersion3_2Core +#else + NSOpenGLProfileVersionLegacy +#endif // BGFX_CONFIG_RENDERER_OPENGL >= 31 + ; + NSOpenGLPixelFormatAttribute pixelFormatAttributes[] = { - NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersionLegacy, // NSOpenGLProfileVersion3_2Core, + NSOpenGLPFAOpenGLProfile, profile, NSOpenGLPFAColorSize, 24, NSOpenGLPFAAlphaSize, 8, NSOpenGLPFADepthSize, 24, diff --git a/src/renderer_gl.cpp b/src/renderer_gl.cpp index 053bc2d3..a25c821d 100644 --- a/src/renderer_gl.cpp +++ b/src/renderer_gl.cpp @@ -457,7 +457,10 @@ namespace bgfx void invalidateCache() { - m_vaoCache.invalidate(); + if (m_vaoSupport) + { + m_vaoCache.invalidate(); + } } void updateCapture() @@ -2258,12 +2261,13 @@ namespace bgfx for (GLint ii = 0; ii < numCmpFormats; ++ii) { - BX_TRACE("\t%3d: %8x", ii, formats[ii]); + BX_TRACE(" %3d: %8x", ii, formats[ii]); } } -# define GL_GET(_pname, _min) BX_TRACE(#_pname " %d (min: %d)", glGet(_pname), _min) +# define GL_GET(_pname, _min) BX_TRACE(" " #_pname " %d (min: %d)", glGet(_pname), _min) + BX_TRACE("Defaults:"); # if BX_PLATFORM_OSX GL_GET(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, 16 * 4); GL_GET(GL_MAX_VERTEX_UNIFORM_COMPONENTS, 128 * 4); diff --git a/src/renderer_gl.h b/src/renderer_gl.h index 522e600f..c4969a11 100755 --- a/src/renderer_gl.h +++ b/src/renderer_gl.h @@ -12,7 +12,9 @@ #if BGFX_CONFIG_RENDERER_OPENGL # if BGFX_CONFIG_RENDERER_OPENGL >= 31 +# define GLCOREARB_PROTOTYPES # include +# define GL_ARB_shader_objects // OSX collsion with GLhandleARB in gltypes.h # else # if BX_PLATFORM_LINUX # define GL_PROTOTYPES