mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2025-02-17 20:31:57 -05:00
OSX: Fixed NSGLGetProcAddress and Remotery. Issue #595.
This commit is contained in:
parent
3e5f6095a0
commit
c3dd88767a
2 changed files with 13 additions and 2 deletions
3
3rdparty/remotery/lib/Remotery.c
vendored
3
3rdparty/remotery/lib/Remotery.c
vendored
|
@ -5381,7 +5381,8 @@ GLAPI GLenum GLAPIENTRY glGetError(void) { return 0; }
|
|||
#if defined(_WIN32)
|
||||
# define rmtGetProcAddress(name) wglGetProcAddress((LPCSTR)name)
|
||||
#elif defined(__APPLE__) && !defined(GLEW_APPLE_GLX)
|
||||
# define rmtGetProcAddress(name) NSGLGetProcAddress(name)
|
||||
void* nsglGetProcAddress(const GLubyte* _name);
|
||||
# define rmtGetProcAddress(name) nsglGetProcAddress(name)
|
||||
#elif defined(__sgi) || defined(__sun)
|
||||
# define rmtGetProcAddress(name) dlGetProcAddress(name)
|
||||
#elif defined(__ANDROID__)
|
||||
|
|
|
@ -207,11 +207,21 @@ namespace bgfx { namespace gl
|
|||
_func = (_proto)bx::dlsym(s_opengl, #_import); \
|
||||
BX_TRACE("%p " #_func " (" #_import ")", _func); \
|
||||
} \
|
||||
BGFX_FATAL(_optional || NULL != _func, Fatal::UnableToInitialize, "Failed to create OpenGL context. NSGLGetProcAddress(\"%s\")", #_import); \
|
||||
BGFX_FATAL(_optional || NULL != _func, Fatal::UnableToInitialize, "Failed to create OpenGL context. GetProcAddress(\"%s\")", #_import); \
|
||||
}
|
||||
# include "glimports.h"
|
||||
}
|
||||
|
||||
} /* namespace gl */ } // namespace bgfx
|
||||
|
||||
void* nsglGetProcAddress(const GLubyte* _name)
|
||||
{
|
||||
using namespace bgfx::gl;
|
||||
if (NULL == s_opengl)
|
||||
{
|
||||
s_opengl = bx::dlopen("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL");
|
||||
}
|
||||
return bx::dlsym(s_opengl, (const char*)_name);
|
||||
}
|
||||
|
||||
#endif // BX_PLATFORM_OSX && (BGFX_CONFIG_RENDERER_OPENGLES2|BGFX_CONFIG_RENDERER_OPENGLES3|BGFX_CONFIG_RENDERER_OPENGL)
|
||||
|
|
Loading…
Reference in a new issue