Fixed shutdown on OSX.

This commit is contained in:
bkaradzic 2013-07-14 10:13:10 -07:00
parent d30a5240d7
commit fcf71d35f3
3 changed files with 18 additions and 4 deletions

View file

@ -26,8 +26,16 @@ namespace bgfx
NSWindow* nsWindow = (NSWindow*)g_bgfxNSWindow; 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[] = { NSOpenGLPixelFormatAttribute pixelFormatAttributes[] = {
NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersionLegacy, // NSOpenGLProfileVersion3_2Core, NSOpenGLPFAOpenGLProfile, profile,
NSOpenGLPFAColorSize, 24, NSOpenGLPFAColorSize, 24,
NSOpenGLPFAAlphaSize, 8, NSOpenGLPFAAlphaSize, 8,
NSOpenGLPFADepthSize, 24, NSOpenGLPFADepthSize, 24,

View file

@ -457,7 +457,10 @@ namespace bgfx
void invalidateCache() void invalidateCache()
{ {
m_vaoCache.invalidate(); if (m_vaoSupport)
{
m_vaoCache.invalidate();
}
} }
void updateCapture() void updateCapture()
@ -2258,12 +2261,13 @@ namespace bgfx
for (GLint ii = 0; ii < numCmpFormats; ++ii) 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 # if BX_PLATFORM_OSX
GL_GET(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, 16 * 4); GL_GET(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, 16 * 4);
GL_GET(GL_MAX_VERTEX_UNIFORM_COMPONENTS, 128 * 4); GL_GET(GL_MAX_VERTEX_UNIFORM_COMPONENTS, 128 * 4);

View file

@ -12,7 +12,9 @@
#if BGFX_CONFIG_RENDERER_OPENGL #if BGFX_CONFIG_RENDERER_OPENGL
# if BGFX_CONFIG_RENDERER_OPENGL >= 31 # if BGFX_CONFIG_RENDERER_OPENGL >= 31
# define GLCOREARB_PROTOTYPES
# include <gl/glcorearb.h> # include <gl/glcorearb.h>
# define GL_ARB_shader_objects // OSX collsion with GLhandleARB in gltypes.h
# else # else
# if BX_PLATFORM_LINUX # if BX_PLATFORM_LINUX
# define GL_PROTOTYPES # define GL_PROTOTYPES