mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-19 21:42:59 +01:00
Setup emscripten canvas.
This commit is contained in:
@@ -391,14 +391,18 @@ namespace bgfx
|
||||
success = eglMakeCurrent(m_display, m_surface, m_surface, m_context);
|
||||
BGFX_FATAL(success, Fatal::OPENGL_UnableToCreateContext, "Failed to set context.");
|
||||
|
||||
# define GL_IMPORT(_optional, _proto, _func) \
|
||||
{ \
|
||||
_func = (_proto)eglGetProcAddress(#_func); \
|
||||
BX_TRACE(#_func " 0x%08x", _func); \
|
||||
BGFX_FATAL(_optional || NULL != _func, Fatal::OPENGL_UnableToCreateContext, "Failed to create OpenGLES context. eglGetProcAddress(\"%s\")", #_func); \
|
||||
}
|
||||
# include "glimports.h"
|
||||
# undef GL_IMPORT
|
||||
# if BX_PLATFORM_EMSCRIPTEN
|
||||
emscripten_set_canvas_size(_width, _height);
|
||||
# else
|
||||
# define GL_IMPORT(_optional, _proto, _func) \
|
||||
{ \
|
||||
_func = (_proto)eglGetProcAddress(#_func); \
|
||||
BX_TRACE(#_func " 0x%08x", _func); \
|
||||
BGFX_FATAL(_optional || NULL != _func, Fatal::OPENGL_UnableToCreateContext, "Failed to create OpenGLES context. eglGetProcAddress(\"%s\")", #_func); \
|
||||
}
|
||||
# include "glimports.h"
|
||||
# undef GL_IMPORT
|
||||
# endif // !BX_PLATFORM_EMSCRIPTEN
|
||||
}
|
||||
#endif // BX_PLATFORM_
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user