Setup emscripten canvas.

This commit is contained in:
Branimir Karadzic
2012-10-22 19:39:59 -07:00
parent b0075aa06c
commit 4bc42d9f97
5 changed files with 81 additions and 12 deletions

View File

@@ -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_
}