mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-11-13 11:35:41 +00:00
GL import code cleanup. Added ability to load GLES library dynamically.
This commit is contained in:
+10
-8
@@ -20,8 +20,7 @@ namespace bgfx
|
||||
PFNGLXSWAPINTERVALSGIPROC glXSwapIntervalSGI;
|
||||
|
||||
# define GL_IMPORT(_optional, _proto, _func, _import) _proto _func
|
||||
# include "glimports.h"
|
||||
# undef GL_IMPORT
|
||||
# include "glimports.h"
|
||||
|
||||
static ::Display* s_display;
|
||||
static ::Window s_window;
|
||||
@@ -220,13 +219,16 @@ namespace bgfx
|
||||
|
||||
void GlContext::import()
|
||||
{
|
||||
# define GL_IMPORT(_optional, _proto, _func, _import) \
|
||||
{ \
|
||||
_func = (_proto)glXGetProcAddress((const GLubyte*)#_import); \
|
||||
BGFX_FATAL(_optional || NULL != _func, Fatal::UnableToInitialize, "Failed to create OpenGL context. glXGetProcAddress %s", #_import); \
|
||||
}
|
||||
# define GL_EXTENSION(_optional, _proto, _func, _import) \
|
||||
{ \
|
||||
if (NULL == _func) \
|
||||
{ \
|
||||
_func = (_proto)glXGetProcAddress((const GLubyte*)#_import); \
|
||||
BX_TRACE(#_func " = " #_import " 0x%08x", _func); \
|
||||
BGFX_FATAL(_optional || NULL != _func, Fatal::UnableToInitialize, "Failed to create OpenGL context. glXGetProcAddress %s", #_import); \
|
||||
} \
|
||||
}
|
||||
# include "glimports.h"
|
||||
# undef GL_IMPORT
|
||||
}
|
||||
|
||||
} // namespace bgfx
|
||||
|
||||
Reference in New Issue
Block a user