diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-02-08 20:44:26 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-02-09 10:22:26 -0800 |
commit | 475548d8c38134b9721cfca119cea18bc8d3f065 (patch) | |
tree | e920a2a365b70302970179557cb99a63f2c265f0 | |
parent | b3ab733682b4e909b5f52f8d9c4964332abd4817 (diff) |
move emscripten_GetProcAddress to a C library, so that it is less hackish and can work in fastcomp1.10.3
-rw-r--r-- | src/deps_info.json | 4 | ||||
-rw-r--r-- | src/library_egl.js | 2 | ||||
-rw-r--r-- | src/library_gl.js | 99 | ||||
-rw-r--r-- | src/library_sdl.js | 2 | ||||
-rw-r--r-- | system/lib/gl.c | 1729 | ||||
-rw-r--r-- | system/lib/gl.symbols | 1 | ||||
-rw-r--r-- | tools/shared.py | 2 | ||||
-rw-r--r-- | tools/system_libs.py | 11 |
8 files changed, 1767 insertions, 83 deletions
diff --git a/src/deps_info.json b/src/deps_info.json index 5bdc75bc..b38ffd00 100644 --- a/src/deps_info.json +++ b/src/deps_info.json @@ -1,5 +1,7 @@ { "uuid_compare": ["memcmp"], - "SDL_Init": ["malloc", "free"] + "SDL_Init": ["malloc", "free"], + "SDL_GL_GetProcAddress": ["emscripten_GetProcAddress"], + "eglGetProcAddress": ["emscripten_GetProcAddress"] } diff --git a/src/library_egl.js b/src/library_egl.js index 11cf8951..69dd266d 100644 --- a/src/library_egl.js +++ b/src/library_egl.js @@ -555,7 +555,7 @@ var LibraryEGL = { eglGetProcAddress__deps: ['emscripten_GetProcAddress'], eglGetProcAddress: function(name_) { - return _emscripten_GetProcAddress(Pointer_stringify(name_)); + return _emscripten_GetProcAddress(name_); }, }; diff --git a/src/library_gl.js b/src/library_gl.js index baa0597d..261780ce 100644 --- a/src/library_gl.js +++ b/src/library_gl.js @@ -2325,6 +2325,7 @@ var LibraryGL = { Module.printErr('WARNING: deleteObject received invalid id: ' + id); } }, + glDeleteObjectARB: 'glDeleteObject', glGetObjectParameteriv__sig: 'viii', glGetObjectParameteriv: function(id, type, result) { @@ -2347,6 +2348,7 @@ var LibraryGL = { Module.printErr('WARNING: getObjectParameteriv received invalid id: ' + id); } }, + glGetObjectParameterivARB: 'glGetObjectParameteriv', glGetInfoLog__sig: 'viiii', glGetInfoLog: function(id, maxLength, length, infoLog) { @@ -2358,6 +2360,7 @@ var LibraryGL = { Module.printErr('WARNING: getObjectParameteriv received invalid id: ' + id); } }, + glGetInfoLogARB: 'glGetInfoLog', glBindProgram__sig: 'vii', glBindProgram: function(type, id) { @@ -2365,6 +2368,7 @@ var LibraryGL = { assert(id == 0); #endif }, + glBindProgramARB: 'glBindProgram', glGetPointerv: function(name, p) { var attribute; @@ -5031,39 +5035,11 @@ var LibraryGL = { #else // LEGACY_GL_EMULATION - // Warn if code tries to use various emulation stuff, when emulation is disabled - // (do not warn if INCLUDE_FULL_LIBRARY is one, because then likely the gl code will - // not be called anyhow, leave only the runtime aborts) - glVertexPointer__deps: [function() { -#if INCLUDE_FULL_LIBRARY == 0 - warn('Legacy GL function (glVertexPointer) called. You need to compile with -s LEGACY_GL_EMULATION=1 to enable legacy GL emulation.'); -#endif - }], - glVertexPointer: function(){ throw 'Legacy GL function (glVertexPointer) called. You need to compile with -s LEGACY_GL_EMULATION=1 to enable legacy GL emulation.'; }, - glGenVertexArrays__deps: [function() { -#if INCLUDE_FULL_LIBRARY == 0 - warn('Legacy GL function (glGenVertexArrays) called. You need to compile with -s LEGACY_GL_EMULATION=1 to enable legacy GL emulation.'); -#endif - }], - glGenVertexArrays: function(){ throw 'Legacy GL function (glGenVertexArrays) called. You need to compile with -s LEGACY_GL_EMULATION=1 to enable legacy GL emulation.'; }, - glMatrixMode__deps: [function() { -#if INCLUDE_FULL_LIBRARY == 0 - warn('Legacy GL function (glMatrixMode) called. You need to compile with -s LEGACY_GL_EMULATION=1 to enable legacy GL emulation.'); -#endif - }], - glMatrixMode: function(){ throw 'Legacy GL function (glMatrixMode) called. You need to compile with -s LEGACY_GL_EMULATION=1 to enable legacy GL emulation.'; }, - glBegin__deps: [function() { -#if INCLUDE_FULL_LIBRARY == 0 - warn('Legacy GL function (glBegin) called. You need to compile with -s LEGACY_GL_EMULATION=1 to enable legacy GL emulation.'); -#endif - }], - glBegin: function(){ throw 'Legacy GL function (glBegin) called. You need to compile with -s LEGACY_GL_EMULATION=1 to enable legacy GL emulation.'; }, - glLoadIdentity__deps: [function() { -#if INCLUDE_FULL_LIBRARY == 0 - warn('Legacy GL function (glLoadIdentity) called. You need to compile with -s LEGACY_GL_EMULATION=1 to enable legacy GL emulation.'); -#endif - }], - glLoadIdentity: function(){ throw 'Legacy GL function (glLoadIdentity) called. You need to compile with -s LEGACY_GL_EMULATION=1 to enable legacy GL emulation.'; }, + glVertexPointer: function(){ throw 'Legacy GL function (glVertexPointer) called. If you want legacy GL emulation, you need to compile with -s LEGACY_GL_EMULATION=1 to enable legacy GL emulation.'; }, + glGenVertexArrays: function(){ throw 'Legacy GL function (glGenVertexArrays) called. If you want legacy GL emulation, you need to compile with -s LEGACY_GL_EMULATION=1 to enable legacy GL emulation.'; }, + glMatrixMode: function(){ throw 'Legacy GL function (glMatrixMode) called. If you want legacy GL emulation, you need to compile with -s LEGACY_GL_EMULATION=1 to enable legacy GL emulation.'; }, + glBegin: function(){ throw 'Legacy GL function (glBegin) called. If you want legacy GL emulation, you need to compile with -s LEGACY_GL_EMULATION=1 to enable legacy GL emulation.'; }, + glLoadIdentity: function(){ throw 'Legacy GL function (glLoadIdentity) called. If you want legacy GL emulation, you need to compile with -s LEGACY_GL_EMULATION=1 to enable legacy GL emulation.'; }, #endif // LEGACY_GL_EMULATION @@ -5374,52 +5350,17 @@ if (LEGACY_GL_EMULATION) { DEFAULT_LIBRARY_FUNCS_TO_INCLUDE.push('$GLEmulation'); } -// GL proc address retrieval -LibraryGL.emscripten_GetProcAddress__deps = [function() { - // ProcAddress is used, so include everything in GL. This runs before we go to the $ProcAddressTable object, - // and we fill its deps just in time, and create the lookup table - var table = {}; - LibraryManager.library.emscripten_procAddressTable__deps = keys(LibraryGL).map(function(x) { - if (x.substr(-6) == '__deps' || x.substr(-9) == '__postset' || x.substr(-5) == '__sig' || x.substr(-5) == '__asm' || x.substr(0, 2) != 'gl') return null; - var original = x; - if (('_' + x) in Functions.implementedFunctions) { - // a user-implemented function aliases this one, but we still want it to be accessible by name, so rename it - var y = x + '__procTable'; - LibraryManager.library[y] = LibraryManager.library[x]; - LibraryManager.library[y + '__deps'] = LibraryManager.library[x + '__deps']; - LibraryManager.library[y + '__postset'] = LibraryManager.library[x + '__postset']; - LibraryManager.library[y + '__sig'] = LibraryManager.library[x + '__sig'];//|| Functions.implementedFunctions['_' + x]; - LibraryManager.library[y + '__asm'] = LibraryManager.library[x + '__asm']; - x = y; - assert(!(y in Functions.implementedFunctions) && !Functions.unimplementedFunctions['_' + y]); - } - var longX = '_' + x; - var sig = LibraryManager.library[x + '__sig'] || functionStubSigs[longX]; - if (sig) { - table[original] = Functions.getIndex(longX, sig); - if (!(longX in Functions.implementedFunctions)) Functions.unimplementedFunctions[longX] = sig; - } - return x; - }).filter(function(x) { return x !== null }); - // convert table into function with switch, to not confuse closure compiler - var tableImpl = 'switch(name) {\n'; - for (var x in table) tableImpl += 'case "' + x + '": return ' + table[x] + '; break;\n'; - tableImpl += '}\nreturn 0;'; - LibraryManager.library.emscripten_procAddressTable = new Function('name', tableImpl); -}, 'emscripten_procAddressTable']; -LibraryGL.emscripten_GetProcAddress = function _LibraryGL_emscripten_GetProcAddress(name) { - name = name.replace('EXT', '').replace('ARB', ''); - switch(name) { // misc renamings - case 'glCreateProgramObject': name = 'glCreateProgram'; break; - case 'glUseProgramObject': name = 'glUseProgram'; break; - case 'glCreateShaderObject': name = 'glCreateShader'; break; - case 'glAttachObject': name = 'glAttachShader'; break; - case 'glDetachObject': name = 'glDetachShader'; break; - } - var ret = _emscripten_procAddressTable(name); - if (!ret) Module.printErr('WARNING: getProcAddress failed for ' + name); - return ret; -} +// GL proc address retrieval - allow access through glX and emscripten_glX, to allow name collisions with user-implemented things having the same name (see gl.c) +keys(LibraryGL).forEach(function(x) { + if (x.substr(-6) == '__deps' || x.substr(-9) == '__postset' || x.substr(-5) == '__sig' || x.substr(-5) == '__asm' || x.substr(0, 2) != 'gl') return; + var original = x; + var y = 'emscripten_' + x; + LibraryGL[y] = LibraryGL[x]; + LibraryGL[y + '__deps'] = LibraryGL[x + '__deps']; // note that we might want to rename in the deps as well + LibraryGL[y + '__postset'] = LibraryGL[x + '__postset']; + LibraryGL[y + '__sig'] = LibraryGL[x + '__sig']; + LibraryGL[y + '__asm'] = LibraryGL[x + '__asm']; +}); // Final merge mergeInto(LibraryManager.library, LibraryGL); diff --git a/src/library_sdl.js b/src/library_sdl.js index caba9b74..8c70ceee 100644 --- a/src/library_sdl.js +++ b/src/library_sdl.js @@ -2487,7 +2487,7 @@ var LibrarySDL = { SDL_GL_GetProcAddress__deps: ['emscripten_GetProcAddress'], SDL_GL_GetProcAddress: function(name_) { - return _emscripten_GetProcAddress(Pointer_stringify(name_)); + return _emscripten_GetProcAddress(name_); }, SDL_GL_SwapBuffers: function() {}, diff --git a/system/lib/gl.c b/system/lib/gl.c new file mode 100644 index 00000000..e6c60956 --- /dev/null +++ b/system/lib/gl.c @@ -0,0 +1,1729 @@ +// GL proc address retrieval + +#include <string.h> +#include <stdlib.h> +#include <stdio.h> + +#define GL_GLEXT_PROTOTYPES +#include <GL/gl.h> +#include <GL/glext.h> + +// Define emscripten_ versions of gl functions, to avoid name collisions + +/* + * Miscellaneous + */ + +GLAPI void GLAPIENTRY emscripten_glClearIndex( GLfloat c ); + +GLAPI void GLAPIENTRY emscripten_glClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ); + +GLAPI void GLAPIENTRY emscripten_glClear( GLbitfield mask ); + +GLAPI void GLAPIENTRY emscripten_glIndexMask( GLuint mask ); + +GLAPI void GLAPIENTRY emscripten_glColorMask( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha ); + +GLAPI void GLAPIENTRY emscripten_glAlphaFunc( GLenum func, GLclampf ref ); + +GLAPI void GLAPIENTRY emscripten_glBlendFunc( GLenum sfactor, GLenum dfactor ); + +GLAPI void GLAPIENTRY emscripten_glLogicOp( GLenum opcode ); + +GLAPI void GLAPIENTRY emscripten_glCullFace( GLenum mode ); + +GLAPI void GLAPIENTRY emscripten_glFrontFace( GLenum mode ); + +GLAPI void GLAPIENTRY emscripten_glPointSize( GLfloat size ); + +GLAPI void GLAPIENTRY emscripten_glLineWidth( GLfloat width ); + +GLAPI void GLAPIENTRY emscripten_glLineStipple( GLint factor, GLushort pattern ); + +GLAPI void GLAPIENTRY emscripten_glPolygonMode( GLenum face, GLenum mode ); + +GLAPI void GLAPIENTRY emscripten_glPolygonOffset( GLfloat factor, GLfloat units ); + +GLAPI void GLAPIENTRY emscripten_glPolygonStipple( const GLubyte *mask ); + +GLAPI void GLAPIENTRY emscripten_glGetPolygonStipple( GLubyte *mask ); + +GLAPI void GLAPIENTRY emscripten_glEdgeFlag( GLboolean flag ); + +GLAPI void GLAPIENTRY emscripten_glEdgeFlagv( const GLboolean *flag ); + +GLAPI void GLAPIENTRY emscripten_glScissor( GLint x, GLint y, GLsizei width, GLsizei height); + +GLAPI void GLAPIENTRY emscripten_glClipPlane( GLenum plane, const GLdouble *equation ); + +GLAPI void GLAPIENTRY emscripten_glGetClipPlane( GLenum plane, GLdouble *equation ); + +GLAPI void GLAPIENTRY emscripten_glDrawBuffer( GLenum mode ); + +GLAPI void GLAPIENTRY emscripten_glReadBuffer( GLenum mode ); + +GLAPI void GLAPIENTRY emscripten_glEnable( GLenum cap ); + +GLAPI void GLAPIENTRY emscripten_glDisable( GLenum cap ); + +GLAPI GLboolean GLAPIENTRY emscripten_glIsEnabled( GLenum cap ); + + +GLAPI void GLAPIENTRY emscripten_glEnableClientState( GLenum cap ); /* 1.1 */ + +GLAPI void GLAPIENTRY emscripten_glDisableClientState( GLenum cap ); /* 1.1 */ + + +GLAPI void GLAPIENTRY emscripten_glGetBooleanv( GLenum pname, GLboolean *params ); + +GLAPI void GLAPIENTRY emscripten_glGetDoublev( GLenum pname, GLdouble *params ); + +GLAPI void GLAPIENTRY emscripten_glGetFloatv( GLenum pname, GLfloat *params ); + +GLAPI void GLAPIENTRY emscripten_glGetIntegerv( GLenum pname, GLint *params ); + + +GLAPI void GLAPIENTRY emscripten_glPushAttrib( GLbitfield mask ); + +GLAPI void GLAPIENTRY emscripten_glPopAttrib( void ); + + +GLAPI void GLAPIENTRY emscripten_glPushClientAttrib( GLbitfield mask ); /* 1.1 */ + +GLAPI void GLAPIENTRY emscripten_glPopClientAttrib( void ); /* 1.1 */ + + +GLAPI GLint GLAPIENTRY emscripten_glRenderMode( GLenum mode ); + +GLAPI GLenum GLAPIENTRY emscripten_glGetError( void ); + +GLAPI const GLubyte * GLAPIENTRY emscripten_glGetString( GLenum name ); + +GLAPI void GLAPIENTRY emscripten_glFinish( void ); + +GLAPI void GLAPIENTRY emscripten_glFlush( void ); + +GLAPI void GLAPIENTRY emscripten_glHint( GLenum target, GLenum mode ); + + +/* + * Depth Buffer + */ + +GLAPI void GLAPIENTRY emscripten_glClearDepth( GLclampd depth ); + +GLAPI void GLAPIENTRY emscripten_glDepthFunc( GLenum func ); + +GLAPI void GLAPIENTRY emscripten_glDepthMask( GLboolean flag ); + +GLAPI void GLAPIENTRY emscripten_glDepthRange( GLclampd near_val, GLclampd far_val ); + + +/* + * Accumulation Buffer + */ + +GLAPI void GLAPIENTRY emscripten_glClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ); + +GLAPI void GLAPIENTRY emscripten_glAccum( GLenum op, GLfloat value ); + + +/* + * Transformation + */ + +GLAPI void GLAPIENTRY emscripten_glMatrixMode( GLenum mode ); + +GLAPI void GLAPIENTRY emscripten_glOrtho( GLdouble left, GLdouble right, + GLdouble bottom, GLdouble top, + GLdouble near_val, GLdouble far_val ); + +GLAPI void GLAPIENTRY emscripten_glFrustum( GLdouble left, GLdouble right, + GLdouble bottom, GLdouble top, + GLdouble near_val, GLdouble far_val ); + +GLAPI void GLAPIENTRY emscripten_glViewport( GLint x, GLint y, + GLsizei width, GLsizei height ); + +GLAPI void GLAPIENTRY emscripten_glPushMatrix( void ); + +GLAPI void GLAPIENTRY emscripten_glPopMatrix( void ); + +GLAPI void GLAPIENTRY emscripten_glLoadIdentity( void ); + +GLAPI void GLAPIENTRY emscripten_glLoadMatrixd( const GLdouble *m ); +GLAPI void GLAPIENTRY emscripten_glLoadMatrixf( const GLfloat *m ); + +GLAPI void GLAPIENTRY emscripten_glMultMatrixd( const GLdouble *m ); +GLAPI void GLAPIENTRY emscripten_glMultMatrixf( const GLfloat *m ); + +GLAPI void GLAPIENTRY emscripten_glRotated( GLdouble angle, + GLdouble x, GLdouble y, GLdouble z ); +GLAPI void GLAPIENTRY emscripten_glRotatef( GLfloat angle, + GLfloat x, GLfloat y, GLfloat z ); + +GLAPI void GLAPIENTRY emscripten_glScaled( GLdouble x, GLdouble y, GLdouble z ); +GLAPI void GLAPIENTRY emscripten_glScalef( GLfloat x, GLfloat y, GLfloat z ); + +GLAPI void GLAPIENTRY emscripten_glTranslated( GLdouble x, GLdouble y, GLdouble z ); +GLAPI void GLAPIENTRY emscripten_glTranslatef( GLfloat x, GLfloat y, GLfloat z ); + + +/* + * Display Lists + */ + +GLAPI GLboolean GLAPIENTRY emscripten_glIsList( GLuint list ); + +GLAPI void GLAPIENTRY emscripten_glDeleteLists( GLuint list, GLsizei range ); + +GLAPI GLuint GLAPIENTRY emscripten_glGenLists( GLsizei range ); + +GLAPI void GLAPIENTRY emscripten_glNewList( GLuint list, GLenum mode ); + +GLAPI void GLAPIENTRY emscripten_glEndList( void ); + +GLAPI void GLAPIENTRY emscripten_glCallList( GLuint list ); + +GLAPI void GLAPIENTRY emscripten_glCallLists( GLsizei n, GLenum type, + const GLvoid *lists ); + +GLAPI void GLAPIENTRY emscripten_glListBase( GLuint base ); + + +/* + * Drawing Functions + */ + +GLAPI void GLAPIENTRY emscripten_glBegin( GLenum mode ); + +GLAPI void GLAPIENTRY emscripten_glEnd( void ); + + +GLAPI void GLAPIENTRY emscripten_glVertex2d( GLdouble x, GLdouble y ); +GLAPI void GLAPIENTRY emscripten_glVertex2f( GLfloat x, GLfloat y ); +GLAPI void GLAPIENTRY emscripten_glVertex2i( GLint x, GLint y ); +GLAPI void GLAPIENTRY emscripten_glVertex2s( GLshort x, GLshort y ); + +GLAPI void GLAPIENTRY emscripten_glVertex3d( GLdouble x, GLdouble y, GLdouble z ); +GLAPI void GLAPIENTRY emscripten_glVertex3f( GLfloat x, GLfloat y, GLfloat z ); +GLAPI void GLAPIENTRY emscripten_glVertex3i( GLint x, GLint y, GLint z ); +GLAPI void GLAPIENTRY emscripten_glVertex3s( GLshort x, GLshort y, GLshort z ); + +GLAPI void GLAPIENTRY emscripten_glVertex4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w ); +GLAPI void GLAPIENTRY emscripten_glVertex4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w ); +GLAPI void GLAPIENTRY emscripten_glVertex4i( GLint x, GLint y, GLint z, GLint w ); +GLAPI void GLAPIENTRY emscripten_glVertex4s( GLshort x, GLshort y, GLshort z, GLshort w ); + +GLAPI void GLAPIENTRY emscripten_glVertex2dv( const GLdouble *v ); +GLAPI void GLAPIENTRY emscripten_glVertex2fv( const GLfloat *v ); +GLAPI void GLAPIENTRY emscripten_glVertex2iv( const GLint *v ); +GLAPI void GLAPIENTRY emscripten_glVertex2sv( const GLshort *v ); + +GLAPI void GLAPIENTRY emscripten_glVertex3dv( const GLdouble *v ); +GLAPI void GLAPIENTRY emscripten_glVertex3fv( const GLfloat *v ); +GLAPI void GLAPIENTRY emscripten_glVertex3iv( const GLint *v ); +GLAPI void GLAPIENTRY emscripten_glVertex3sv( const GLshort *v ); + +GLAPI void GLAPIENTRY emscripten_glVertex4dv( const GLdouble *v ); +GLAPI void GLAPIENTRY emscripten_glVertex4fv( const GLfloat *v ); +GLAPI void GLAPIENTRY emscripten_glVertex4iv( const GLint *v ); +GLAPI void GLAPIENTRY emscripten_glVertex4sv( const GLshort *v ); + + +GLAPI void GLAPIENTRY emscripten_glNormal3b( GLbyte nx, GLbyte ny, GLbyte nz ); +GLAPI void GLAPIENTRY emscripten_glNormal3d( GLdouble nx, GLdouble ny, GLdouble nz ); +GLAPI void GLAPIENTRY emscripten_glNormal3f( GLfloat nx, GLfloat ny, GLfloat nz ); +GLAPI void GLAPIENTRY emscripten_glNormal3i( GLint nx, GLint ny, GLint nz ); +GLAPI void GLAPIENTRY emscripten_glNormal3s( GLshort nx, GLshort ny, GLshort nz ); + +GLAPI void GLAPIENTRY emscripten_glNormal3bv( const GLbyte *v ); +GLAPI void GLAPIENTRY emscripten_glNormal3dv( const GLdouble *v ); +GLAPI void GLAPIENTRY emscripten_glNormal3fv( const GLfloat *v ); +GLAPI void GLAPIENTRY emscripten_glNormal3iv( const GLint *v ); +GLAPI void GLAPIENTRY emscripten_glNormal3sv( const GLshort *v ); + + +GLAPI void GLAPIENTRY emscripten_glIndexd( GLdouble c ); +GLAPI void GLAPIENTRY emscripten_glIndexf( GLfloat c ); +GLAPI void GLAPIENTRY emscripten_glIndexi( GLint c ); +GLAPI void GLAPIENTRY emscripten_glIndexs( GLshort c ); +GLAPI void GLAPIENTRY emscripten_glIndexub( GLubyte c ); /* 1.1 */ + +GLAPI void GLAPIENTRY emscripten_glIndexdv( const GLdouble *c ); +GLAPI void GLAPIENTRY emscripten_glIndexfv( const GLfloat *c ); +GLAPI void GLAPIENTRY emscripten_glIndexiv( const GLint *c ); +GLAPI void GLAPIENTRY emscripten_glIndexsv( const GLshort *c ); +GLAPI void GLAPIENTRY emscripten_glIndexubv( const GLubyte *c ); /* 1.1 */ + +GLAPI void GLAPIENTRY emscripten_glColor3b( GLbyte red, GLbyte green, GLbyte blue ); +GLAPI void GLAPIENTRY emscripten_glColor3d( GLdouble red, GLdouble green, GLdouble blue ); +GLAPI void GLAPIENTRY emscripten_glColor3f( GLfloat red, GLfloat green, GLfloat blue ); +GLAPI void GLAPIENTRY emscripten_glColor3i( GLint red, GLint green, GLint blue ); +GLAPI void GLAPIENTRY emscripten_glColor3s( GLshort red, GLshort green, GLshort blue ); +GLAPI void GLAPIENTRY emscripten_glColor3ub( GLubyte red, GLubyte green, GLubyte blue ); +GLAPI void GLAPIENTRY emscripten_glColor3ui( GLuint red, GLuint green, GLuint blue ); +GLAPI void GLAPIENTRY emscripten_glColor3us( GLushort red, GLushort green, GLushort blue ); + +GLAPI void GLAPIENTRY emscripten_glColor4b( GLbyte red, GLbyte green, + GLbyte blue, GLbyte alpha ); +GLAPI void GLAPIENTRY emscripten_glColor4d( GLdouble red, GLdouble green, + GLdouble blue, GLdouble alpha ); +GLAPI void GLAPIENTRY emscripten_glColor4f( GLfloat red, GLfloat green, + GLfloat blue, GLfloat alpha ); +GLAPI void GLAPIENTRY emscripten_glColor4i( GLint red, GLint green, + GLint blue, GLint alpha ); +GLAPI void GLAPIENTRY emscripten_glColor4s( GLshort red, GLshort green, + GLshort blue, GLshort alpha ); +GLAPI void GLAPIENTRY emscripten_glColor4ub( GLubyte red, GLubyte green, + GLubyte blue, GLubyte alpha ); +GLAPI void GLAPIENTRY emscripten_glColor4ui( GLuint red, GLuint green, + GLuint blue, GLuint alpha ); +GLAPI void GLAPIENTRY emscripten_glColor4us( GLushort red, GLushort green, + GLushort blue, GLushort alpha ); + + +GLAPI void GLAPIENTRY emscripten_glColor3bv( const GLbyte *v ); +GLAPI void GLAPIENTRY emscripten_glColor3dv( const GLdouble *v ); +GLAPI void GLAPIENTRY emscripten_glColor3fv( const GLfloat *v ); +GLAPI void GLAPIENTRY emscripten_glColor3iv( const GLint *v ); +GLAPI void GLAPIENTRY emscripten_glColor3sv( const GLshort *v ); +GLAPI void GLAPIENTRY emscripten_glColor3ubv( const GLubyte *v ); +GLAPI void GLAPIENTRY emscripten_glColor3uiv( const GLuint *v ); +GLAPI void GLAPIENTRY emscripten_glColor3usv( const GLushort *v ); + +GLAPI void GLAPIENTRY emscripten_glColor4bv( const GLbyte *v ); +GLAPI void GLAPIENTRY emscripten_glColor4dv( const GLdouble *v ); +GLAPI void GLAPIENTRY emscripten_glColor4fv( const GLfloat *v ); +GLAPI void GLAPIENTRY emscripten_glColor4iv( const GLint *v ); +GLAPI void GLAPIENTRY emscripten_glColor4sv( const GLshort *v ); +GLAPI void GLAPIENTRY emscripten_glColor4ubv( const GLubyte *v ); +GLAPI void GLAPIENTRY emscripten_glColor4uiv( const GLuint *v ); +GLAPI void GLAPIENTRY emscripten_glColor4usv( const GLushort *v ); + + +GLAPI void GLAPIENTRY emscripten_glTexCoord1d( GLdouble s ); +GLAPI void GLAPIENTRY emscripten_glTexCoord1f( GLfloat s ); +GLAPI void GLAPIENTRY emscripten_glTexCoord1i( GLint s ); +GLAPI void GLAPIENTRY emscripten_glTexCoord1s( GLshort s ); + +GLAPI void GLAPIENTRY emscripten_glTexCoord2d( GLdouble s, GLdouble t ); +GLAPI void GLAPIENTRY emscripten_glTexCoord2f( GLfloat s, GLfloat t ); +GLAPI void GLAPIENTRY emscripten_glTexCoord2i( GLint s, GLint t ); +GLAPI void GLAPIENTRY emscripten_glTexCoord2s( GLshort s, GLshort t ); + +GLAPI void GLAPIENTRY emscripten_glTexCoord3d( GLdouble s, GLdouble t, GLdouble r ); +GLAPI void GLAPIENTRY emscripten_glTexCoord3f( GLfloat s, GLfloat t, GLfloat r ); +GLAPI void GLAPIENTRY emscripten_glTexCoord3i( GLint s, GLint t, GLint r ); +GLAPI void GLAPIENTRY emscripten_glTexCoord3s( GLshort s, GLshort t, GLshort r ); + +GLAPI void GLAPIENTRY emscripten_glTexCoord4d( GLdouble s, GLdouble t, GLdouble r, GLdouble q ); +GLAPI void GLAPIENTRY emscripten_glTexCoord4f( GLfloat s, GLfloat t, GLfloat r, GLfloat q ); +GLAPI void GLAPIENTRY emscripten_glTexCoord4i( GLint s, GLint t, GLint r, GLint q ); +GLAPI void GLAPIENTRY emscripten_glTexCoord4s( GLshort s, GLshort t, GLshort r, GLshort q ); + +GLAPI void GLAPIENTRY emscripten_glTexCoord1dv( const GLdouble *v ); +GLAPI void GLAPIENTRY emscripten_glTexCoord1fv( const GLfloat *v ); +GLAPI void GLAPIENTRY emscripten_glTexCoord1iv( const GLint *v ); +GLAPI void GLAPIENTRY emscripten_glTexCoord1sv( const GLshort *v ); + +GLAPI void GLAPIENTRY emscripten_glTexCoord2dv( const GLdouble *v ); +GLAPI void GLAPIENTRY emscripten_glTexCoord2fv( const GLfloat *v ); +GLAPI void GLAPIENTRY emscripten_glTexCoord2iv( const GLint *v ); +GLAPI void GLAPIENTRY emscripten_glTexCoord2sv( const GLshort *v ); + +GLAPI void GLAPIENTRY emscripten_glTexCoord3dv( const GLdouble *v ); +GLAPI void GLAPIENTRY emscripten_glTexCoord3fv( const GLfloat *v ); +GLAPI void GLAPIENTRY emscripten_glTexCoord3iv( const GLint *v ); +GLAPI void GLAPIENTRY emscripten_glTexCoord3sv( const GLshort *v ); + +GLAPI void GLAPIENTRY emscripten_glTexCoord4dv( const GLdouble *v ); +GLAPI void GLAPIENTRY emscripten_glTexCoord4fv( const GLfloat *v ); +GLAPI void GLAPIENTRY emscripten_glTexCoord4iv( const GLint *v ); +GLAPI void GLAPIENTRY emscripten_glTexCoord4sv( const GLshort *v ); + + +GLAPI void GLAPIENTRY emscripten_glRasterPos2d( GLdouble x, GLdouble y ); +GLAPI void GLAPIENTRY emscripten_glRasterPos2f( GLfloat x, GLfloat y ); +GLAPI void GLAPIENTRY emscripten_glRasterPos2i( GLint x, GLint y ); +GLAPI void GLAPIENTRY emscripten_glRasterPos2s( GLshort x, GLshort y ); + +GLAPI void GLAPIENTRY emscripten_glRasterPos3d( GLdouble x, GLdouble y, GLdouble z ); +GLAPI void GLAPIENTRY emscripten_glRasterPos3f( GLfloat x, GLfloat y, GLfloat z ); +GLAPI void GLAPIENTRY emscripten_glRasterPos3i( GLint x, GLint y, GLint z ); +GLAPI void GLAPIENTRY emscripten_glRasterPos3s( GLshort x, GLshort y, GLshort z ); + +GLAPI void GLAPIENTRY emscripten_glRasterPos4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w ); +GLAPI void GLAPIENTRY emscripten_glRasterPos4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w ); +GLAPI void GLAPIENTRY emscripten_glRasterPos4i( GLint x, GLint y, GLint z, GLint w ); +GLAPI void GLAPIENTRY emscripten_glRasterPos4s( GLshort x, GLshort y, GLshort z, GLshort w ); + +GLAPI void GLAPIENTRY emscripten_glRasterPos2dv( const GLdouble *v ); +GLAPI void GLAPIENTRY emscripten_glRasterPos2fv( const GLfloat *v ); +GLAPI void GLAPIENTRY emscripten_glRasterPos2iv( const GLint *v ); +GLAPI void GLAPIENTRY emscripten_glRasterPos2sv( const GLshort *v ); + +GLAPI void GLAPIENTRY emscripten_glRasterPos3dv( const GLdouble *v ); +GLAPI void GLAPIENTRY emscripten_glRasterPos3fv( const GLfloat *v ); +GLAPI void GLAPIENTRY emscripten_glRasterPos3iv( const GLint *v ); +GLAPI void GLAPIENTRY emscripten_glRasterPos3sv( const GLshort *v ); + +GLAPI void GLAPIENTRY emscripten_glRasterPos4dv( const GLdouble *v ); +GLAPI void GLAPIENTRY emscripten_glRasterPos4fv( const GLfloat *v ); +GLAPI void GLAPIENTRY emscripten_glRasterPos4iv( const GLint *v ); +GLAPI void GLAPIENTRY emscripten_glRasterPos4sv( const GLshort *v ); + + +GLAPI void GLAPIENTRY emscripten_glRectd( GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2 ); +GLAPI void GLAPIENTRY emscripten_glRectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 ); +GLAPI void GLAPIENTRY emscripten_glRecti( GLint x1, GLint y1, GLint x2, GLint y2 ); +GLAPI void GLAPIENTRY emscripten_glRects( GLshort x1, GLshort y1, GLshort x2, GLshort y2 ); + + +GLAPI void GLAPIENTRY emscripten_glRectdv( const GLdouble *v1, const GLdouble *v2 ); +GLAPI void GLAPIENTRY emscripten_glRectfv( const GLfloat *v1, const GLfloat *v2 ); +GLAPI void GLAPIENTRY emscripten_glRectiv( const GLint *v1, const GLint *v2 ); +GLAPI void GLAPIENTRY emscripten_glRectsv( const GLshort *v1, const GLshort *v2 ); + + +/* + * Vertex Arrays (1.1) + */ + +GLAPI void GLAPIENTRY emscripten_glVertexPointer( GLint size, GLenum type, + GLsizei stride, const GLvoid *ptr ); + +GLAPI void GLAPIENTRY emscripten_glNormalPointer( GLenum type, GLsizei stride, + const GLvoid *ptr ); + +GLAPI void GLAPIENTRY emscripten_glColorPointer( GLint size, GLenum type, + GLsizei stride, const GLvoid *ptr ); + +GLAPI void GLAPIENTRY emscripten_glIndexPointer( GLenum type, GLsizei stride, + const GLvoid *ptr ); + +GLAPI void GLAPIENTRY emscripten_glTexCoordPointer( GLint size, GLenum type, + GLsizei stride, const GLvoid *ptr ); + +GLAPI void GLAPIENTRY emscripten_glEdgeFlagPointer( GLsizei stride, const GLvoid *ptr ); + +GLAPI void GLAPIENTRY emscripten_glGetPointerv( GLenum pname, GLvoid **params ); + +GLAPI void GLAPIENTRY emscripten_glArrayElement( GLint i ); + +GLAPI void GLAPIENTRY emscripten_glDrawArrays( GLenum mode, GLint first, GLsizei count ); + +GLAPI void GLAPIENTRY emscripten_glDrawElements( GLenum mode, GLsizei count, + GLenum type, const GLvoid *indices ); + +GLAPI void GLAPIENTRY emscripten_glInterleavedArrays( GLenum format, GLsizei stride, + const GLvoid *pointer ); + +/* + * Lighting + */ + +GLAPI void GLAPIENTRY emscripten_glShadeModel( GLenum mode ); + +GLAPI void GLAPIENTRY emscripten_glLightf( GLenum light, GLenum pname, GLfloat param ); +GLAPI void GLAPIENTRY emscripten_glLighti( GLenum light, GLenum pname, GLint param ); +GLAPI void GLAPIENTRY emscripten_glLightfv( GLenum light, GLenum pname, + const GLfloat *params ); +GLAPI void GLAPIENTRY emscripten_glLightiv( GLenum light, GLenum pname, + const GLint *params ); + +GLAPI void GLAPIENTRY emscripten_glGetLightfv( GLenum light, GLenum pname, + GLfloat *params ); +GLAPI void GLAPIENTRY emscripten_glGetLightiv( GLenum light, GLenum pname, + GLint *params ); + +GLAPI void GLAPIENTRY emscripten_glLightModelf( GLenum pname, GLfloat param ); +GLAPI void GLAPIENTRY emscripten_glLightModeli( GLenum pname, GLint param ); +GLAPI void GLAPIENTRY emscripten_glLightModelfv( GLenum pname, const GLfloat *params ); +GLAPI void GLAPIENTRY emscripten_glLightModeliv( GLenum pname, const GLint *params ); + +GLAPI void GLAPIENTRY emscripten_glMaterialf( GLenum face, GLenum pname, GLfloat param ); +GLAPI void GLAPIENTRY emscripten_glMateriali( GLenum face, GLenum pname, GLint param ); +GLAPI void GLAPIENTRY emscripten_glMaterialfv( GLenum face, GLenum pname, const GLfloat *params ); +GLAPI void GLAPIENTRY emscripten_glMaterialiv( GLenum face, GLenum pname, const GLint *params ); + +GLAPI void GLAPIENTRY emscripten_glGetMaterialfv( GLenum face, GLenum pname, GLfloat *params ); +GLAPI void GLAPIENTRY emscripten_glGetMaterialiv( GLenum face, GLenum pname, GLint *params ); + +GLAPI void GLAPIENTRY emscripten_glColorMaterial( GLenum face, GLenum mode ); + + +/* + * Raster functions + */ + +GLAPI void GLAPIENTRY emscripten_glPixelZoom( GLfloat xfactor, GLfloat yfactor ); + +GLAPI void GLAPIENTRY emscripten_glPixelStoref( GLenum pname, GLfloat param ); +GLAPI void GLAPIENTRY emscripten_glPixelStorei( GLenum pname, GLint param ); + +GLAPI void GLAPIENTRY emscripten_glPixelTransferf( GLenum pname, GLfloat param ); +GLAPI void GLAPIENTRY emscripten_glPixelTransferi( GLenum pname, GLint param ); + +GLAPI void GLAPIENTRY emscripten_glPixelMapfv( GLenum map, GLsizei mapsize, + const GLfloat *values ); +GLAPI void GLAPIENTRY emscripten_glPixelMapuiv( GLenum map, GLsizei mapsize, + const GLuint *values ); +GLAPI void GLAPIENTRY emscripten_glPixelMapusv( GLenum map, GLsizei mapsize, + const GLushort *values ); + +GLAPI void GLAPIENTRY emscripten_glGetPixelMapfv( GLenum map, GLfloat *values ); +GLAPI void GLAPIENTRY emscripten_glGetPixelMapuiv( GLenum map, GLuint *values ); +GLAPI void GLAPIENTRY emscripten_glGetPixelMapusv( GLenum map, GLushort *values ); + +GLAPI void GLAPIENTRY emscripten_glBitmap( GLsizei width, GLsizei height, + GLfloat xorig, GLfloat yorig, + GLfloat xmove, GLfloat ymove, + const GLubyte *bitmap ); + +GLAPI void GLAPIENTRY emscripten_glReadPixels( GLint x, GLint y, + GLsizei width, GLsizei height, + GLenum format, GLenum type, + GLvoid *pixels ); + +GLAPI void GLAPIENTRY emscripten_glDrawPixels( GLsizei width, GLsizei height, + GLenum format, GLenum type, + const GLvoid *pixels ); + +GLAPI void GLAPIENTRY emscripten_glCopyPixels( GLint x, GLint y, + GLsizei width, GLsizei height, + GLenum type ); + +/* + * Stenciling + */ + +GLAPI void GLAPIENTRY emscripten_glStencilFunc( GLenum func, GLint ref, GLuint mask ); + +GLAPI void GLAPIENTRY emscripten_glStencilMask( GLuint mask ); + +GLAPI void GLAPIENTRY emscripten_glStencilOp( GLenum fail, GLenum zfail, GLenum zpass ); + +GLAPI void GLAPIENTRY emscripten_glClearStencil( GLint s ); + + + +/* + * Texture mapping + */ + +GLAPI void GLAPIENTRY emscripten_glTexGend( GLenum coord, GLenum pname, GLdouble param ); +GLAPI void GLAPIENTRY emscripten_glTexGenf( GLenum coord, GLenum pname, GLfloat param ); +GLAPI void GLAPIENTRY emscripten_glTexGeni( GLenum coord, GLenum pname, GLint param ); + +GLAPI void GLAPIENTRY emscripten_glTexGendv( GLenum coord, GLenum pname, const GLdouble *params ); +GLAPI void GLAPIENTRY emscripten_glTexGenfv( GLenum coord, GLenum pname, const GLfloat *params ); +GLAPI void GLAPIENTRY emscripten_glTexGeniv( GLenum coord, GLenum pname, const GLint *params ); + +GLAPI void GLAPIENTRY emscripten_glGetTexGendv( GLenum coord, GLenum pname, GLdouble *params ); +GLAPI void GLAPIENTRY emscripten_glGetTexGenfv( GLenum coord, GLenum pname, GLfloat *params ); +GLAPI void GLAPIENTRY emscripten_glGetTexGeniv( GLenum coord, GLenum pname, GLint *params ); + + +GLAPI void GLAPIENTRY emscripten_glTexEnvf( GLenum target, GLenum pname, GLfloat param ); +GLAPI void GLAPIENTRY emscripten_glTexEnvi( GLenum target, GLenum pname, GLint param ); + +GLAPI void GLAPIENTRY emscripten_glTexEnvfv( GLenum target, GLenum pname, const GLfloat *params ); +GLAPI void GLAPIENTRY emscripten_glTexEnviv( GLenum target, GLenum pname, const GLint *params ); + +GLAPI void GLAPIENTRY emscripten_glGetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ); +GLAPI void GLAPIENTRY emscripten_glGetTexEnviv( GLenum target, GLenum pname, GLint *params ); + + +GLAPI void GLAPIENTRY emscripten_glTexParameterf( GLenum target, GLenum pname, GLfloat param ); +GLAPI void GLAPIENTRY emscripten_glTexParameteri( GLenum target, GLenum pname, GLint param ); + +GLAPI void GLAPIENTRY emscripten_glTexParameterfv( GLenum target, GLenum pname, + const GLfloat *params ); +GLAPI void GLAPIENTRY emscripten_glTexParameteriv( GLenum target, GLenum pname, + const GLint *params ); + +GLAPI void GLAPIENTRY emscripten_glGetTexParameterfv( GLenum target, + GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY emscripten_glGetTexParameteriv( GLenum target, + GLenum pname, GLint *params ); + +GLAPI void GLAPIENTRY emscripten_glGetTexLevelParameterfv( GLenum target, GLint level, + GLenum pname, GLfloat *params ); +GLAPI void GLAPIENTRY emscripten_glGetTexLevelParameteriv( GLenum target, GLint level, + GLenum pname, GLint *params ); + + +GLAPI void GLAPIENTRY emscripten_glTexImage1D( GLenum target, GLint level, + GLint internalFormat, + GLsizei width, GLint border, + GLenum format, GLenum type, + const GLvoid *pixels ); + +GLAPI void GLAPIENTRY emscripten_glTexImage2D( GLenum target, GLint level, + GLint internalFormat, + GLsizei width, GLsizei height, + GLint border, GLenum format, GLenum type, + const GLvoid *pixels ); + +GLAPI void GLAPIENTRY emscripten_glGetTexImage( GLenum target, GLint level, + GLenum format, GLenum type, + GLvoid *pixels ); + + +/* 1.1 functions */ + +GLAPI void GLAPIENTRY emscripten_glGenTextures( GLsizei n, GLuint *textures ); + +GLAPI void GLAPIENTRY emscripten_glDeleteTextures( GLsizei n, const GLuint *textures); + +GLAPI void GLAPIENTRY emscripten_glBindTexture( GLenum target, GLuint texture ); + +GLAPI void GLAPIENTRY emscripten_glPrioritizeTextures( GLsizei n, + const GLuint *textures, + const GLclampf *priorities ); + +GLAPI GLboolean GLAPIENTRY emscripten_glAreTexturesResident( GLsizei n, + const GLuint *textures, + GLboolean *residences ); + +GLAPI GLboolean GLAPIENTRY emscripten_glIsTexture( GLuint texture ); + + +GLAPI void GLAPIENTRY emscripten_glTexSubImage1D( GLenum target, GLint level, + GLint xoffset, + GLsizei width, GLenum format, + GLenum type, const GLvoid *pixels ); + + +GLAPI void GLAPIENTRY emscripten_glTexSubImage2D( GLenum target, GLint level, + GLint xoffset, GLint yoffset, + GLsizei width, GLsizei height, + GLenum format, GLenum type, + const GLvoid *pixels ); + + +GLAPI void GLAPIENTRY emscripten_glCopyTexImage1D( GLenum target, GLint level, + GLenum internalformat, + GLint x, GLint y, + GLsizei width, GLint border ); + + +GLAPI void GLAPIENTRY emscripten_glCopyTexImage2D( GLenum target, GLint level, + GLenum internalformat, + GLint x, GLint y, + GLsizei width, GLsizei height, + GLint border ); + + +GLAPI void GLAPIENTRY emscripten_glCopyTexSubImage1D( GLenum target, GLint level, + GLint xoffset, GLint x, GLint y, + GLsizei width );< |