mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-19 05:23:00 +01:00
Cleanup.
This commit is contained in:
@@ -444,30 +444,41 @@ EGL_IMPORT
|
||||
void GlContext::import()
|
||||
{
|
||||
BX_TRACE("Import:");
|
||||
|
||||
# if BX_PLATFORM_WINDOWS || BX_PLATFORM_LINUX
|
||||
void* glesv2 = bx::dlopen("libGLESv2." BX_DL_EXT);
|
||||
# define GL_EXTENSION(_optional, _proto, _func, _import) \
|
||||
{ \
|
||||
if (NULL == _func) \
|
||||
{ \
|
||||
_func = BGFX_CAST_FUNCTION(_proto, bx::dlsym(glesv2, #_import)); \
|
||||
BX_TRACE("\t%p " #_func " (" #_import ")", _func); \
|
||||
BGFX_FATAL(_optional || NULL != _func, Fatal::UnableToInitialize, "Failed to create OpenGLES context. eglGetProcAddress(\"%s\")", #_import); \
|
||||
} \
|
||||
|
||||
# define GL_EXTENSION(_optional, _proto, _func, _import) \
|
||||
{ \
|
||||
if (NULL == _func) \
|
||||
{ \
|
||||
_func = bx::functionCast<_proto>(bx::dlsym(glesv2, #_import)); \
|
||||
BX_TRACE("\t%p " #_func " (" #_import ")", _func); \
|
||||
BGFX_FATAL(_optional || NULL != _func \
|
||||
, Fatal::UnableToInitialize \
|
||||
, "Failed to create OpenGLES context. eglGetProcAddress(\"%s\")" \
|
||||
, #_import); \
|
||||
} \
|
||||
}
|
||||
# else
|
||||
# define GL_EXTENSION(_optional, _proto, _func, _import) \
|
||||
{ \
|
||||
if (NULL == _func) \
|
||||
{ \
|
||||
_func = BGFX_CAST_FUNCTION(_proto , eglGetProcAddress(#_import)); \
|
||||
BX_TRACE("\t%p " #_func " (" #_import ")", _func); \
|
||||
BGFX_FATAL(_optional || NULL != _func, Fatal::UnableToInitialize, "Failed to create OpenGLES context. eglGetProcAddress(\"%s\")", #_import); \
|
||||
} \
|
||||
# define GL_EXTENSION(_optional, _proto, _func, _import) \
|
||||
{ \
|
||||
if (NULL == _func) \
|
||||
{ \
|
||||
_func = bx::functionCast<_proto>(eglGetProcAddress(#_import) ); \
|
||||
BX_TRACE("\t%p " #_func " (" #_import ")", _func); \
|
||||
BGFX_FATAL(_optional || NULL != _func \
|
||||
, Fatal::UnableToInitialize \
|
||||
, "Failed to create OpenGLES context. eglGetProcAddress(\"%s\")" \
|
||||
, #_import); \
|
||||
} \
|
||||
}
|
||||
|
||||
# endif // BX_PLATFORM_
|
||||
|
||||
# include "glimports.h"
|
||||
|
||||
# undef GL_EXTENSION
|
||||
}
|
||||
|
||||
} /* namespace gl */ } // namespace bgfx
|
||||
|
||||
Reference in New Issue
Block a user