This commit is contained in:
Nigel Stewart 2013-08-15 13:56:11 -05:00
commit 7eedcd0443
3 changed files with 17 additions and 10 deletions

View file

@ -108,16 +108,8 @@ REGAL.CFLAGS += -DREGAL_STATISTICS=0
REGAL.CFLAGS += -Wno-constant-logical-operand
REGAL.CFLAGS += -DREGAL_PLUGIN=0
REGAL.CFLAGS += -DREGAL_TRACE=0
REGAL.CFLAGS += -DREGAL_NAMESPACE=1 -DREGAL_STATIC_ES2 -DREGAL_STATIC_EGL
REGAL_LOG = 0
REGAL_NO_TLS = 1
# Enabling this requires the library to be built with it, as well as all code
# that uses it. Defining this means that Regal will link statically to GL
# and EGL, and code will have to #include <GL/Regal.h> before any GL
# includes to pull in a bunch of #defines (e.g. #define glGetError rglGetError)
#LIB.CFLAGS += -DREGAL_SYS_EMSCRIPTEN_STATIC=1
endif
#

View file

@ -20,8 +20,17 @@ LN :=
BIN.SUFFIX = .html
EXT.DYNAMIC = js
CFLAGS.DEBUG = -O2
CFLAGS.RELEASE = -O2
# Enabling this requires the library to be built with it, *as well as all code
# that uses it*.
#
# Defining this means that Regal will link statically to GL
# and EGL, and code will have to #include <GL/Regal.h> before any GL
# includes to pull in a bunch of #defines (e.g. #define glGetError rglGetError).
#
#EMSCRIPTEN_STATIC = -DREGAL_SYS_EMSCRIPTEN_STATIC=1
CFLAGS.DEBUG = -O2 $(EMSCRIPTEN_STATIC)
CFLAGS.RELEASE = -O2 $(EMSCRIPTEN_STATIC)
#LIB.SHARED = lib$(NAME).js
LIB.STATIC = lib$(NAME).a

View file

@ -133,6 +133,12 @@ int main(int argc, const char *argv[])
RegalMakeCurrent(CGLGetCurrentContext());
#endif
// Regal workaround for Emscripten GLUT emulation
#ifdef EMSCRIPTEN
RegalMakeCurrent((RegalSystemContext)1);
#endif
RegalSetErrorCallback(myError);
// Exercise REGAL_extension_query extension