Skip to content

Commit 41f9b27

Browse files
committed
Consolidation of environment variable queries at runtime.
ARB_texture_cube_map and EXT_texture_cube_map for ES 2.0 IFF emulation improvements Emscripten build improvements Update zlib to version 1.2.8 Update libpng to version 1.6.3 Update mongoose to version 3.8
1 parent b1128f1 commit 41f9b27

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+16591
-8909
lines changed

Makefile.apitrace

+7-3
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,15 @@ MAKEFILE_APITRACE_INCLUDED := 1
55

66
include build/common.inc
77

8-
ifeq ($(filter nacl%,$(SYSTEM)),)
9-
108
include build/apitrace.inc
119

10+
# Not supported for NaCL or emscripten, currently
11+
12+
ifneq ($(filter nacl% emscripten%,$(SYSTEM)),)
13+
APITRACE.STATIC :=
14+
APITRACE.SHARED :=
15+
endif
16+
1217
#
1318
# apitrace
1419
#
@@ -78,5 +83,4 @@ endif
7883

7984
endif
8085
endif
81-
endif
8286

Makefile.dreamtorus

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ MAKEFILE_DREAMTORUS_INCLUDED := 1
55

66
include build/common.inc
77

8-
# Not supported for NaCL - Revisit
8+
# Not supported for NaCL or emscripten - Revisit
99

10-
ifeq ($(filter nacl%,$(SYSTEM)),)
10+
ifeq ($(filter nacl% emscripten%,$(SYSTEM)),)
1111

1212
#
1313
# dreamtorus

Makefile.dreamtorus_static

+13-5
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,17 @@ MAKEFILE_DREAMTORUS_STATIC_INCLUDED := 1
55

66
include build/common.inc
77

8-
# Not supported for NaCL - Revisit
8+
DREAMTORUS_STATIC.EXE := dreamtorus
99

10-
ifeq ($(filter nacl%,$(SYSTEM)),)
10+
ifneq ($(filter emscripten%,$(SYSTEM)),)
11+
DREAMTORUS_STATIC.EXE := dreamtorus_static.html
12+
endif
13+
14+
ifneq ($(filter nacl%,$(SYSTEM)),)
15+
DREAMTORUS_STATIC.EXE :=
16+
endif
17+
18+
ifdef DREAMTORUS_STATIC.EXE
1119

1220
#
1321
# dreamtorus
@@ -24,11 +32,11 @@ all:: dreamtorus_static.bin
2432

2533
clean:: dreamtorus_static.clean
2634

27-
dreamtorus_static.bin: bin/$(SYSTEM)/dreamtorus_static
35+
dreamtorus_static.bin: bin/$(SYSTEM)/$(DREAMTORUS_STATIC.EXE)
2836

2937
dreamtorus_static.clean:
3038
$(RM) -r tmp/$(SYSTEM)/dreamtorus_static/static
31-
$(RM) -r bin/$(SYSTEM)/dreamtorus_static
39+
$(RM) -r bin/$(SYSTEM)/$(DREAMTORUS_STATIC.EXE)
3240

3341
DREAMTORUS_STATIC.SRCS += examples/dreamtorus/src/render.cpp
3442
DREAMTORUS_STATIC.SRCS += examples/dreamtorus/glut/code/main.cpp
@@ -65,7 +73,7 @@ ifdef GLUT.STATIC
6573
DREAMTORUS_STATIC.DEPEND += lib/$(SYSTEM)/$(GLUT.STATIC) lib/$(SYSTEM)/$(GLU.STATIC)
6674
endif
6775

68-
bin/$(SYSTEM)/dreamtorus_static: $(DREAMTORUS_STATIC.OBJS) $(DREAMTORUS_STATIC.DEPEND)
76+
bin/$(SYSTEM)/$(DREAMTORUS_STATIC.EXE): $(DREAMTORUS_STATIC.OBJS) $(DREAMTORUS_STATIC.DEPEND)
6977
@mkdir -p $(dir $@)
7078
ifdef APITRACE.STATIC
7179
$(LOG_LD)$(CCACHE) $(LD) $(LDFLAGS.EXTRA) -o $@ $(DREAMTORUS_STATIC.OBJS) $(LDFLAGS.STARTGROUP) lib/$(SYSTEM)/$(REGAL.STATIC) lib/$(SYSTEM)/$(APITRACE.STATIC) $(LDFLAGS.ENDGROUP) $(REGAL.SHARED.DEPEND) $(DREAMTORUS_STATIC.DEPEND) $(REGAL.LIBS) $(REGAL.LDFLAGS) $(DREAMTORUS_STATIC.LIBS)

Makefile.glew

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ include build/common.inc
77

88
include build/glew.inc
99

10-
# Not supported for NaCL, yet
10+
# Not supported for NaCL or emscripten, yet
1111

12-
ifneq ($(filter nacl%,$(SYSTEM)),)
12+
ifneq ($(filter nacl% emscripten%,$(SYSTEM)),)
13+
GLEW.STATIC :=
1314
GLEW.SHARED :=
1415
endif
1516

Makefile.glewinfo

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ MAKEFILE_GLEWINFO_INCLUDED := 1
55

66
include build/common.inc
77

8-
# Not supported for NaCL
8+
# Not supported for NaCL or emscripten
99

10-
ifeq ($(filter nacl%,$(SYSTEM)),)
10+
ifeq ($(filter nacl% emscripten%,$(SYSTEM)),)
1111

1212
#
1313
# RegalGLEW glewinfo

Makefile.glu

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ include build/glu.inc
1111
# RegalGLU
1212
#
1313

14-
# Not supported for NaCL, yet
14+
# Not supported for NaCL or emscripten, yet
1515

16-
ifneq ($(filter nacl%,$(SYSTEM)),)
16+
ifneq ($(filter nacl% emscripten%,$(SYSTEM)),)
1717
GLU.SHARED :=
1818
endif
1919

Makefile.glut

+6-4
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@ MAKEFILE_GLUT_INCLUDED := 1
55

66
include build/common.inc
77

8-
# Not supported for Mac
8+
include build/glut.inc
99

10-
ifeq ($(filter darwin%,$(SYSTEM)),)
10+
# Not supported for Mac or emscripten
1111

12-
include build/glut.inc
12+
ifneq ($(filter darwin% emscripten%,$(SYSTEM)),)
13+
GLUT.STATIC :=
14+
GLUT.SHARED :=
15+
endif
1316

1417
#
1518
# RegalGLUT
@@ -80,4 +83,3 @@ endif
8083

8184
endif
8285
endif
83-
endif

Makefile.gtest

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ MAKEFILE_GTEST_INCLUDED := 1
55

66
include build/common.inc
77

8+
ifeq ($(filter emscripten%,$(SYSTEM)),)
9+
810
#
911
# googletest + googlemock
1012
#
@@ -49,3 +51,5 @@ ifneq ($(STRIP),)
4951
endif
5052

5153
endif
54+
endif
55+

Makefile.regal

+26-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ include build/regal.inc
1818
export:
1919
python scripts/Export.py --api gl 4.4 --api wgl 4.4 --api glx 4.4 --api cgl 1.4 --api egl 1.0 --outdir .
2020

21-
# Shared library target not currently supported for NaCL
21+
# Shared library target not currently supported for NaCL or emscripten
2222

23-
ifneq ($(filter nacl%,$(SYSTEM)),)
23+
ifneq ($(filter nacl% emscripten%,$(SYSTEM)),)
2424
REGAL.SHARED :=
2525
endif
2626

@@ -44,7 +44,7 @@ REGAL.SRCS := $(REGAL.CXX)
4444

4545
# Disable mongoose and Regal HTTP for NaCl build
4646

47-
ifeq ($(filter nacl%,$(SYSTEM)),)
47+
ifeq ($(filter nacl% emscripten%,$(SYSTEM)),)
4848
REGAL.SRCS += src/mongoose/mongoose.c
4949
endif
5050

@@ -97,6 +97,29 @@ endif
9797
ifeq ($(MODE),custom)
9898
endif
9999

100+
#
101+
# Emscripten-specific
102+
#
103+
104+
ifneq ($(filter emscripten%,$(SYSTEM)),)
105+
REGAL.CFLAGS += -DREGAL_SYS_EMSCRIPTEN=1 -DREGAL_SYS_EGL=1 -DREGAL_SYS_ES2=1
106+
REGAL.CFLAGS += -DREGAL_NO_HTTP=1
107+
REGAL.CFLAGS += -DREGAL_STATISTICS=0
108+
REGAL.CFLAGS += -Wno-constant-logical-operand
109+
REGAL.CFLAGS += -DREGAL_PLUGIN=0
110+
REGAL.CFLAGS += -DREGAL_TRACE=0
111+
REGAL.CFLAGS += -DREGAL_NAMESPACE=1 -DREGAL_STATIC_ES2 -DREGAL_STATIC_EGL
112+
REGAL_LOG = 0
113+
REGAL_NO_TLS = 1
114+
115+
# Enabling this requires the library to be built with it, as well as all code
116+
# that uses it. Defining this means that Regal will link statically to GL
117+
# and EGL, and code will have to #include <GL/Regal.h> before any GL
118+
# includes to pull in a bunch of #defines (e.g. #define glGetError rglGetError)
119+
#LIB.CFLAGS += -DREGAL_SYS_EMSCRIPTEN_STATIC=1
120+
121+
endif
122+
100123
#
101124

102125
ifneq ($(REGAL_LOG),)

Makefile.regaltest

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ include build/common.inc
77

88
# Not supported for NaCL - Revisit
99

10-
ifeq ($(filter nacl%,$(SYSTEM)),)
10+
ifeq ($(filter nacl% emscripten%,$(SYSTEM)),)
1111

1212
include build/regaltest.inc
1313

config/Makefile.emscripten

+12-18
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,22 @@
11
NAME = $(REGAL_NAME)
22

3-
EMSCRIPTEN := $(EMSCRIPTEN)
4-
CC := $(EMSCRIPTEN)/emcc
5-
CXX := $(EMSCRIPTEN)/em++
6-
LD := $(EMSCRIPTEN)/emcc
7-
AR := $(EMSCRIPTEN)/emar
3+
CC := emcc
4+
CXX := em++
5+
LD := emcc
6+
AR := emar
7+
8+
ifdef EMSCRIPTEN
9+
CC := $(EMSCRIPTEN)/$(CC)
10+
CXX := $(EMSCRIPTEN)/$(CXX)
11+
LD := $(EMSCRIPTEN)/$(LD)
12+
AR := $(EMSCRIPTEN)/$(AR)
13+
endif
14+
815
OBJDUMP := /bin/false
916
RANLIB :=
1017
STRIP :=
1118
LN :=
1219

13-
LIB.CFLAGS += -DREGAL_SYS_EMSCRIPTEN=1 -DREGAL_SYS_EGL=1 -DREGAL_SYS_ES2=1
14-
LIB.CFLAGS += -DREGAL_NO_HTTP=1
15-
LIB.CFLAGS += -Wno-constant-logical-operand
16-
17-
REGAL_LOG = 0
18-
REGAL_NO_TLS = 1
19-
20-
# Enabling this requires the library to be built with it, as well as all code
21-
# that uses it. Defining this means that Regal will link statically to GL
22-
# and EGL, and code will have to #include <GL/Regal.h> before any GL
23-
# includes to pull in a bunch of #defines (e.g. #define glGetError rglGetError)
24-
#LIB.CFLAGS += -REGAL_SYS_EMSCRIPTEN_STATIC=1
25-
2620
BIN.SUFFIX = .html
2721
EXT.DYNAMIC = js
2822

scripts/EmuFilter.py

+2
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,11 @@
108108
'gl(FramebufferTexture2D)',
109109
'gl(GenerateMipmap)',
110110
'gl(Get)(Boolean|Double|Float|Integer|Integer64)v',
111+
'gl(GetTexParameteriv)',
111112
'gl(PixelStorei)',
112113
'gl(PolygonMode)',
113114
'gl(RenderMode)',
115+
'gl(TexImage2D)',
114116
],
115117
'impl' : [
116118
'if (_context->filt->${m1}(*_context, ${arg0plus}))',

scripts/EmuIff.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,12 @@
152152
},
153153
'FfnGetTexEnv' : {
154154
'entries' : [ 'glGetTexEnv(i|f)(v|)(EXT|)' ],
155-
'impl' : [ '_context->iff->GetTexEnv( ${arg0plus} );', ],
155+
'impl' : [
156+
'_context->iff->RestoreVao( _context );',
157+
'if ( ! _context->iff->GetTexEnv( ${arg0plus} ) ) {',
158+
' _context->dispatcher.emulation.glGetTexEnv${m1}${m2}${m3}( ${arg0plus} );',
159+
'}',
160+
],
156161
},
157162
'FfnLightMatModel' : {
158163
'entries' : [ 'gl(Light|Material|GetMaterial|LightModel)(i|f)(v|)' ],

scripts/Export.py

+2
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
emulatedExts = {
9393
'GL_ARB_draw_buffers': { 'emulatedBy' : 'filt', 'emulatedIf' : '(info->gl_version_major >= 2) || info->gl_nv_draw_buffers'},
9494
'GL_ARB_multitexture': { 'emulatedBy' : 'filt', 'emulatedIf' : '' },
95+
'GL_ARB_texture_cube_map': { 'emulatedBy' : 'filt', 'emulatedIf' : '' },
9596
'GL_ARB_texture_env_combine': { 'emulatedBy' : 'iff', 'emulatedIf' : '' },
9697
'GL_ARB_texture_env_dot3': { 'emulatedBy' : 'iff', 'emulatedIf' : '' },
9798
'GL_ARB_texture_storage': { 'emulatedBy' : 'texsto', 'emulatedIf' : '' },
@@ -101,6 +102,7 @@
101102
'GL_EXT_direct_state_access': { 'emulatedBy' : 'dsa', 'emulatedIf' : '' },
102103
'GL_EXT_framebuffer_blit': { 'emulatedBy' : 'filt', 'emulatedIf' : '(info->gl_version_major >= 3) || info->gl_nv_framebuffer_blit' },
103104
'GL_EXT_framebuffer_object': { 'emulatedBy' : 'filt', 'emulatedIf' : '' },
105+
'GL_EXT_texture_cube_map': { 'emulatedBy' : 'filt', 'emulatedIf' : '' },
104106
'GL_EXT_texture_edge_clamp': { 'emulatedBy' : 'filt', 'emulatedIf' : '' },
105107
'GL_EXT_texture_env_combine': { 'emulatedBy' : 'iff', 'emulatedIf' : '' },
106108
'GL_EXT_texture_env_dot3': { 'emulatedBy' : 'iff', 'emulatedIf' : '' },

scripts/api/ApiRegal.py

+18-3
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,25 @@ def logParameter(function, parameter):
8888
return 'boost::print::raw(data,Logging::rawLimit(data ? size : 0))'
8989
elif n=='data' and (function.name=='glBufferSubData' or function.name=='glBufferSubDataARB'):
9090
return 'boost::print::raw(data,Logging::rawLimit(data ? size : 0))'
91-
elif t in [ 'void *', 'const void *', 'GLvoid *', 'const GLvoid *', 'GLubyte *', 'const GLubyte *'] or \
92-
t in [ 'int *', 'const int *', 'GLint *', 'const GLint *' ] or \
91+
elif \
92+
t in [ 'GLvoid *', 'const GLvoid *', 'void *', 'const void *'] or \
93+
t in [ 'GLvoid **', 'const GLvoid **', 'void **', 'const void **'] or \
94+
t in [ 'GLboolean *', 'const GLboolean *', 'bool *', 'const bool *'] or \
95+
t in [ 'GLchar *', 'const GLchar *', 'char *', 'const char *'] or \
96+
t in [ 'GLcharARB *', 'const GLcharARB *'] or \
97+
t in [ 'GLdouble *', 'const GLdouble *', 'double *', 'const double *'] or \
98+
t in [ 'GLenum *'] or \
99+
t in [ 'GLfloat *', 'const GLfloat *', 'float *', 'const float *'] or \
100+
t in [ 'GLhandleARB *', 'const GLhandleARB *'] or \
101+
t in [ 'GLint *', 'const GLint *', 'int *', 'const int *'] or \
102+
t in [ 'GLint64 *', 'const GLint64 *', 'GLint64EXT *', 'const GLint64EXT *'] or \
103+
t in [ 'GLsizei *', 'const GLsizei *'] or \
104+
t in [ 'GLubyte *', 'const GLubyte *'] or \
105+
t in [ 'GLuint *', 'const GLuint *'] or \
106+
t in [ 'GLuint64 *', 'const GLuint64 *', 'GLuint64EXT *', 'const GLuint64EXT *'] or \
107+
t in [ 'GLushort *', 'const GLushort *'] or \
93108
t in [ 'XID', 'XVisualInfo *', 'Pixmap', 'Font', 'Display *'] or \
94-
t in [ 'GLXDrawble', 'GLXPixmap', 'GLXContext', 'GLXVideoDeviceNV', 'GLXWindow', 'GLXPbuffer', 'GLXFBConfigID', '__GLXextFuncPtr'] or \
109+
t in [ 'GLXDrawble', 'GLXPixmap', 'GLXContext', 'GLXVideoDeviceNV', 'GLXWindow', 'GLXPbuffer', 'GLXFBConfigID', '__GLXextFuncPtr', 'GLXFBConfig *'] or \
95110
t in [ 'PVOID', 'LPVOID', 'HDC', 'HGLRC', 'HPBUFFERARB', 'HPBUFFEREXT', 'HGPUNV', 'HPVIDEODEV', 'HVIDEOINPUTDEVICENV', 'HVIDEOOUTPUTDEVICENV', 'PGPU_DEVICE' ] or \
96111
t in [ 'LPIXELFORMATDESCRIPTOR', 'LPLAYERPLANEDESCRIPTOR','LPLAYERPLANEDESCRIPTOR', 'LPGLYPHMETRICSFLOAT' ] or \
97112
t in [ 'EGLNativeWindowType', 'EGLNativePixmapType', 'EGLNativeDisplayType', 'EGLConfig', 'EGLContext', 'EGLDisplay', 'EGLSurface', 'EGLClientBuffer', 'EGLSyncKHR', 'EGLImageKHR', 'EGLStreamKHR', 'EGLSyncNV']:

scripts/regal/RegalContextInfo.py

+4-9
Original file line numberDiff line numberDiff line change
@@ -316,16 +316,11 @@
316316
317317
#ifndef REGAL_NO_GETENV
318318
{
319-
const char *vendorEnv = GetEnv("REGAL_GL_VENDOR");
320-
if (vendorEnv) regalVendor = vendorEnv;
319+
getEnv("REGAL_GL_VENDOR", regalVendor);
320+
getEnv("REGAL_GL_RENDERER", regalRenderer);
321+
getEnv("REGAL_GL_VERSION", regalVersion);
321322
322-
const char *rendererEnv = GetEnv("REGAL_GL_RENDERER");
323-
if (rendererEnv) regalRenderer = rendererEnv;
324-
325-
const char *versionEnv = GetEnv("REGAL_GL_VERSION");
326-
if (versionEnv) regalVersion = versionEnv;
327-
328-
const char *extensionsEnv = GetEnv("REGAL_GL_EXTENSIONS");
323+
const char *extensionsEnv = getEnv("REGAL_GL_EXTENSIONS");
329324
if (extensionsEnv)
330325
{
331326
string_list<string> extList;

src/jsonsl/README.pod

+20-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
=begin html
2+
3+
<img src="https://api.travis-ci.org/mnunberg/jsonsl.png"/>
4+
5+
=end html
6+
17
=head1 JSONSL
28

39
JSON Stateful (or Simple, or Stacked, or Searchable, or Streaming) Lexer
@@ -349,8 +355,21 @@ instead of the good 'ole C<char>. Of course you would need to
349355
handle processing the stream correctly to make sure the multibyte
350356
stream was complete.
351357

358+
=head2 WINDOWS
359+
360+
JSONSL Now has a visual studio C<.sln> and C<.vcxproj> files in the
361+
C<vs> directory.
362+
363+
If you wish to use JSONSL as a DLL, be sure to define the macro
364+
C<JSONSL_DLL> which will properly decorate the prototypes with
365+
C<__declspec(dllexport)>.
366+
367+
You can also run the tests on windows using the C<jsonsl-tests>
368+
project. You will need to manually pass in the sample input files to
369+
be tested, however. In the future, I hope to automate this process.
370+
352371
=head1 AUTHOR AND COPYRIGHT
353372

354-
Copyright (C) 2012 M. Nunberg.
373+
Copyright (C) 2012, 2013 M. Nunberg.
355374

356375
See C<LICENSE> for license information.

src/jsonsl/jsonsl.h

+10-1
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,17 @@ typedef int ssize_t;
5656
#endif /* JSONSL_STATE_GENERIC */
5757

5858
#ifndef JSONSL_API
59+
/**
60+
* We require a /DJSONSL_DLL so that users already using this as a static
61+
* or embedded library don't get confused
62+
*/
63+
#if defined(_WIN32) && defined(JSONSL_DLL)
64+
#define JSONSL_API __declspec(dllexport)
65+
#else
5966
#define JSONSL_API
60-
#endif /* JSONSL_API */
67+
#endif /* _WIN32 */
68+
69+
#endif /* !JSONSL_API */
6170

6271
#define JSONSL_MAX_LEVELS 512
6372

0 commit comments

Comments
 (0)