This commit is contained in:
Бранимир Караџић
2020-09-02 20:43:47 -07:00
parent 0093a67681
commit 8f4750b199
6 changed files with 116 additions and 73 deletions

View File

@@ -182,19 +182,28 @@ namespace bgfx { namespace gl
void GlContext::import(int webGLVersion)
{
BX_TRACE("Import:");
# define GL_EXTENSION(_optional, _proto, _func, _import) \
{ \
if (NULL == _func) \
{ \
_func = (_proto)emscripten_webgl1_get_proc_address(#_import); \
if (!_func && webGLVersion >= 2) \
_func = BGFX_CAST_FUNCTION(_proto, emscripten_webgl2_get_proc_address(#_import)); \
BX_TRACE("\t%p " #_func " (" #_import ")", _func); \
BGFX_FATAL(_optional || NULL != _func, Fatal::UnableToInitialize, "Failed to create WebGL/OpenGLES context. GetProcAddress(\"%s\")", #_import); \
} \
}
# define GL_EXTENSION(_optional, _proto, _func, _import) \
{ \
if (NULL == _func) \
{ \
_func = (_proto)emscripten_webgl1_get_proc_address(#_import); \
if (!_func && webGLVersion >= 2) \
{ \
_func = bx::functionCast<_proto>(emscripten_webgl2_get_proc_address(#_import); \
} \
BX_TRACE("\t%p " #_func " (" #_import ")", _func); \
BGFX_FATAL(_optional || NULL != _func, Fatal::UnableToInitialize \
, "Failed to create WebGL/OpenGLES context. GetProcAddress(\"%s\")" \
, #_import \
); \
} \
}
# include "glimports.h"
# undef GL_EXTENSION
}
} /* namespace gl */ } // namespace bgfx