diff --git a/src/glcontext_nsgl.mm b/src/glcontext_nsgl.mm index 9236b44e..5d0bb22c 100755 --- a/src/glcontext_nsgl.mm +++ b/src/glcontext_nsgl.mm @@ -5,24 +5,15 @@ #include "bgfx_p.h" -#if (BGFX_CONFIG_RENDERER_OPENGLES2|BGFX_CONFIG_RENDERER_OPENGLES3|BGFX_CONFIG_RENDERER_OPENGL) +#if BX_PLATFORM_OSX && (BGFX_CONFIG_RENDERER_OPENGLES2|BGFX_CONFIG_RENDERER_OPENGLES3|BGFX_CONFIG_RENDERER_OPENGL) # include "renderer_gl.h" - -# if BX_PLATFORM_OSX - -# include -# include -# include -# include -# include -# include +# include +# include static void* NSGLGetProcAddress (const char* name) { - static void* const dylib = - dlopen("/System/Library/Frameworks/" - "OpenGL.framework/Versions/Current/OpenGL", - RTLD_LAZY); - return dylib ? dlsym(dylib, name) : NULL; + static void* dylib = + bx::dlopen("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL"); + return dylib ? bx::dlsym(dylib, name) : NULL; } namespace bgfx @@ -37,7 +28,7 @@ namespace bgfx NSWindow* nsWindow = (NSWindow*)g_bgfxNSWindow; NSOpenGLPixelFormatAttribute pixelFormatAttributes[] = { - NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersionLegacy, //NSOpenGLProfileVersion3_2Core, + NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersionLegacy, // NSOpenGLProfileVersion3_2Core, NSOpenGLPFAColorSize , 24, NSOpenGLPFAAlphaSize , 8, NSOpenGLPFADepthSize , 24, @@ -104,5 +95,4 @@ namespace bgfx } // namespace bgfx -# endif // BX_PLATFORM_OSX -#endif //(BGFX_CONFIG_RENDERER_OPENGLES2|BGFX_CONFIG_RENDERER_OPENGLES3|BGFX_CONFIG_RENDERER_OPENGL) +#endif // BX_PLATFORM_OSX && (BGFX_CONFIG_RENDERER_OPENGLES2|BGFX_CONFIG_RENDERER_OPENGLES3|BGFX_CONFIG_RENDERER_OPENGL)