summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: abdb29a)
raw | patch | inline | side by side (parent: abdb29a)
author | a1batross <a1ba.omarov@gmail.com> | |
Fri, 4 Nov 2016 14:13:32 +0000 (17:13 +0300) | ||
committer | a1batross <a1ba.omarov@gmail.com> | |
Fri, 4 Nov 2016 14:13:32 +0000 (17:13 +0300) |
GL/egl.h | patch | blob | history | |
GL/gl.h | patch | blob | history | |
GL/gl_entries.in | patch | blob | history | |
GL/glesinterface.h | patch | blob | history | |
GL/glu.h | patch | blob | history | |
GL/nanogl.h | patch | blob | history | |
eglwrap.cpp | patch | blob | history | |
nanoWrap.cpp | patch | blob | history | |
nanogl.cpp | patch | blob | history |
diff --git a/GL/egl.h b/GL/egl.h
index cbbd7d1a8bf0f94f5832e336f7a008b14a619997..9e80a065f8eee82ba765e84e3c6965986302ed95 100644 (file)
--- a/GL/egl.h
+++ b/GL/egl.h
#ifndef __EGL__H__
#define __EGL__H__
-
-
typedef int EGLBoolean;
typedef int EGLint;
typedef int EGLDisplay;
typedef int EGLContext;
typedef int NativeDisplayType;
-typedef void* NativeWindowType;
-typedef void* NativePixmapType;
+typedef void *NativeWindowType;
+typedef void *NativePixmapType;
#define EGL_DEFAULT_DISPLAY 0
#define EGL_NO_CONTEXT 0
/*
** Versioning and extensions
*/
-#define EGL_VERSION_1_0 1
-#define EGL_VERSION_1_1 1
+#define EGL_VERSION_1_0 1
+#define EGL_VERSION_1_1 1
/*
** Boolean
*/
-#define EGL_FALSE 0
-#define EGL_TRUE 1
+#define EGL_FALSE 0
+#define EGL_TRUE 1
/*
** Errors
*/
-#define EGL_SUCCESS 0x3000
-#define EGL_NOT_INITIALIZED 0x3001
-#define EGL_BAD_ACCESS 0x3002
-#define EGL_BAD_ALLOC 0x3003
-#define EGL_BAD_ATTRIBUTE 0x3004
-#define EGL_BAD_CONFIG 0x3005
-#define EGL_BAD_CONTEXT 0x3006
-#define EGL_BAD_CURRENT_SURFACE 0x3007
-#define EGL_BAD_DISPLAY 0x3008
-#define EGL_BAD_MATCH 0x3009
-#define EGL_BAD_NATIVE_PIXMAP 0x300A
-#define EGL_BAD_NATIVE_WINDOW 0x300B
-#define EGL_BAD_PARAMETER 0x300C
-#define EGL_BAD_SURFACE 0x300D
-#define EGL_CONTEXT_LOST 0x300E
+#define EGL_SUCCESS 0x3000
+#define EGL_NOT_INITIALIZED 0x3001
+#define EGL_BAD_ACCESS 0x3002
+#define EGL_BAD_ALLOC 0x3003
+#define EGL_BAD_ATTRIBUTE 0x3004
+#define EGL_BAD_CONFIG 0x3005
+#define EGL_BAD_CONTEXT 0x3006
+#define EGL_BAD_CURRENT_SURFACE 0x3007
+#define EGL_BAD_DISPLAY 0x3008
+#define EGL_BAD_MATCH 0x3009
+#define EGL_BAD_NATIVE_PIXMAP 0x300A
+#define EGL_BAD_NATIVE_WINDOW 0x300B
+#define EGL_BAD_PARAMETER 0x300C
+#define EGL_BAD_SURFACE 0x300D
+#define EGL_CONTEXT_LOST 0x300E
/* 0x300F - 0x301F reserved for additional errors. */
/*
** Config attributes
*/
-#define EGL_BUFFER_SIZE 0x3020
-#define EGL_ALPHA_SIZE 0x3021
-#define EGL_BLUE_SIZE 0x3022
-#define EGL_GREEN_SIZE 0x3023
-#define EGL_RED_SIZE 0x3024
-#define EGL_DEPTH_SIZE 0x3025
-#define EGL_STENCIL_SIZE 0x3026
-#define EGL_CONFIG_CAVEAT 0x3027
-#define EGL_CONFIG_ID 0x3028
-#define EGL_LEVEL 0x3029
-#define EGL_MAX_PBUFFER_HEIGHT 0x302A
-#define EGL_MAX_PBUFFER_PIXELS 0x302B
-#define EGL_MAX_PBUFFER_WIDTH 0x302C
-#define EGL_NATIVE_RENDERABLE 0x302D
-#define EGL_NATIVE_VISUAL_ID 0x302E
-#define EGL_NATIVE_VISUAL_TYPE 0x302F
+#define EGL_BUFFER_SIZE 0x3020
+#define EGL_ALPHA_SIZE 0x3021
+#define EGL_BLUE_SIZE 0x3022
+#define EGL_GREEN_SIZE 0x3023
+#define EGL_RED_SIZE 0x3024
+#define EGL_DEPTH_SIZE 0x3025
+#define EGL_STENCIL_SIZE 0x3026
+#define EGL_CONFIG_CAVEAT 0x3027
+#define EGL_CONFIG_ID 0x3028
+#define EGL_LEVEL 0x3029
+#define EGL_MAX_PBUFFER_HEIGHT 0x302A
+#define EGL_MAX_PBUFFER_PIXELS 0x302B
+#define EGL_MAX_PBUFFER_WIDTH 0x302C
+#define EGL_NATIVE_RENDERABLE 0x302D
+#define EGL_NATIVE_VISUAL_ID 0x302E
+#define EGL_NATIVE_VISUAL_TYPE 0x302F
/*#define EGL_PRESERVED_RESOURCES 0x3030*/
-#define EGL_SAMPLES 0x3031
-#define EGL_SAMPLE_BUFFERS 0x3032
-#define EGL_SURFACE_TYPE 0x3033
-#define EGL_TRANSPARENT_TYPE 0x3034
-#define EGL_TRANSPARENT_BLUE_VALUE 0x3035
-#define EGL_TRANSPARENT_GREEN_VALUE 0x3036
-#define EGL_TRANSPARENT_RED_VALUE 0x3037
-
-#define EGL_NONE 0x3038 /* Also a config value */
-#define EGL_BIND_TO_TEXTURE_RGB 0x3039
-#define EGL_BIND_TO_TEXTURE_RGBA 0x303A
-#define EGL_MIN_SWAP_INTERVAL 0x303B
-#define EGL_MAX_SWAP_INTERVAL 0x303C
+#define EGL_SAMPLES 0x3031
+#define EGL_SAMPLE_BUFFERS 0x3032
+#define EGL_SURFACE_TYPE 0x3033
+#define EGL_TRANSPARENT_TYPE 0x3034
+#define EGL_TRANSPARENT_BLUE_VALUE 0x3035
+#define EGL_TRANSPARENT_GREEN_VALUE 0x3036
+#define EGL_TRANSPARENT_RED_VALUE 0x3037
+
+#define EGL_NONE 0x3038 /* Also a config value */
+#define EGL_BIND_TO_TEXTURE_RGB 0x3039
+#define EGL_BIND_TO_TEXTURE_RGBA 0x303A
+#define EGL_MIN_SWAP_INTERVAL 0x303B
+#define EGL_MAX_SWAP_INTERVAL 0x303C
/*
** Config values
*/
-#define EGL_DONT_CARE ((EGLint) -1)
+#define EGL_DONT_CARE ( (EGLint)-1 )
-#define EGL_SLOW_CONFIG 0x3050 /* EGL_CONFIG_CAVEAT value */
-#define EGL_NON_CONFORMANT_CONFIG 0x3051 /* " */
-#define EGL_TRANSPARENT_RGB 0x3052 /* EGL_TRANSPARENT_TYPE value */
-#define EGL_NO_TEXTURE 0x305C /* EGL_TEXTURE_FORMAT/TARGET value */
-#define EGL_TEXTURE_RGB 0x305D /* EGL_TEXTURE_FORMAT value */
-#define EGL_TEXTURE_RGBA 0x305E /* " */
-#define EGL_TEXTURE_2D 0x305F /* EGL_TEXTURE_TARGET value */
+#define EGL_SLOW_CONFIG 0x3050 /* EGL_CONFIG_CAVEAT value */
+#define EGL_NON_CONFORMANT_CONFIG 0x3051 /* " */
+#define EGL_TRANSPARENT_RGB 0x3052 /* EGL_TRANSPARENT_TYPE value */
+#define EGL_NO_TEXTURE 0x305C /* EGL_TEXTURE_FORMAT/TARGET value */
+#define EGL_TEXTURE_RGB 0x305D /* EGL_TEXTURE_FORMAT value */
+#define EGL_TEXTURE_RGBA 0x305E /* " */
+#define EGL_TEXTURE_2D 0x305F /* EGL_TEXTURE_TARGET value */
/*
** Config attribute mask bits
*/
-#define EGL_PBUFFER_BIT 0x01 /* EGL_SURFACE_TYPE mask bit */
-#define EGL_PIXMAP_BIT 0x02 /* " */
-#define EGL_WINDOW_BIT 0x04 /* " */
+#define EGL_PBUFFER_BIT 0x01 /* EGL_SURFACE_TYPE mask bit */
+#define EGL_PIXMAP_BIT 0x02 /* " */
+#define EGL_WINDOW_BIT 0x04 /* " */
/*
** String names
*/
-#define EGL_VENDOR 0x3053
-#define EGL_VERSION 0x3054
-#define EGL_EXTENSIONS 0x3055
+#define EGL_VENDOR 0x3053
+#define EGL_VERSION 0x3054
+#define EGL_EXTENSIONS 0x3055
/*
** Surface attributes
*/
-#define EGL_HEIGHT 0x3056
-#define EGL_WIDTH 0x3057
-#define EGL_LARGEST_PBUFFER 0x3058
-#define EGL_TEXTURE_FORMAT 0x3080 /* For pbuffers bound as textures */
-#define EGL_TEXTURE_TARGET 0x3081 /* " */
-#define EGL_MIPMAP_TEXTURE 0x3082 /* " */
-#define EGL_MIPMAP_LEVEL 0x3083 /* " */
+#define EGL_HEIGHT 0x3056
+#define EGL_WIDTH 0x3057
+#define EGL_LARGEST_PBUFFER 0x3058
+#define EGL_TEXTURE_FORMAT 0x3080 /* For pbuffers bound as textures */
+#define EGL_TEXTURE_TARGET 0x3081 /* " */
+#define EGL_MIPMAP_TEXTURE 0x3082 /* " */
+#define EGL_MIPMAP_LEVEL 0x3083 /* " */
/*
** BindTexImage / ReleaseTexImage buffer target
*/
-#define EGL_BACK_BUFFER 0x3084
+#define EGL_BACK_BUFFER 0x3084
/*
** Current surfaces
*/
-#define EGL_DRAW 0x3059
-#define EGL_READ 0x305A
+#define EGL_DRAW 0x3059
+#define EGL_READ 0x305A
/*
** Engines
*/
-#define EGL_CORE_NATIVE_ENGINE 0x305B
+#define EGL_CORE_NATIVE_ENGINE 0x305B
#ifdef __cplusplus
extern "C" {
#endif
-EGLint eglGetError (void);
+EGLint eglGetError( void );
-EGLDisplay eglGetDisplay (NativeDisplayType display);
-EGLBoolean eglInitialize (EGLDisplay dpy, EGLint *major, EGLint *minor);
-EGLBoolean eglTerminate (EGLDisplay dpy);
-const char * eglQueryString (EGLDisplay dpy, EGLint name);
+EGLDisplay eglGetDisplay( NativeDisplayType display );
+EGLBoolean eglInitialize( EGLDisplay dpy, EGLint *major, EGLint *minor );
+EGLBoolean eglTerminate( EGLDisplay dpy );
+const char *eglQueryString( EGLDisplay dpy, EGLint name );
//#ifdef __cplusplus
//void (* eglGetProcAddress (const char *procname))(...);
//#else
-void * eglGetProcAddress (const char *procname);
+void *eglGetProcAddress( const char *procname );
//#endif
-EGLBoolean eglGetConfigs (EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config);
-EGLBoolean eglChooseConfig (EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config);
-EGLBoolean eglGetConfigAttrib (EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value);
+EGLBoolean eglGetConfigs( EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config );
+EGLBoolean eglChooseConfig( EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config );
+EGLBoolean eglGetConfigAttrib( EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value );
-EGLSurface eglCreateWindowSurface (EGLDisplay dpy, EGLConfig config, NativeWindowType window, const EGLint *attrib_list);
-EGLSurface eglCreatePixmapSurface (EGLDisplay dpy, EGLConfig config, NativePixmapType pixmap, const EGLint *attrib_list);
-EGLSurface eglCreatePbufferSurface (EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list);
-EGLBoolean eglDestroySurface (EGLDisplay dpy, EGLSurface surface);
-EGLBoolean eglQuerySurface (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value);
+EGLSurface eglCreateWindowSurface( EGLDisplay dpy, EGLConfig config, NativeWindowType window, const EGLint *attrib_list );
+EGLSurface eglCreatePixmapSurface( EGLDisplay dpy, EGLConfig config, NativePixmapType pixmap, const EGLint *attrib_list );
+EGLSurface eglCreatePbufferSurface( EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list );
+EGLBoolean eglDestroySurface( EGLDisplay dpy, EGLSurface surface );
+EGLBoolean eglQuerySurface( EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value );
/* EGL 1.1 render-to-texture APIs */
-EGLBoolean eglSurfaceAttrib (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value);
-EGLBoolean eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer);
-EGLBoolean eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer);
+EGLBoolean eglSurfaceAttrib( EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value );
+EGLBoolean eglBindTexImage( EGLDisplay dpy, EGLSurface surface, EGLint buffer );
+EGLBoolean eglReleaseTexImage( EGLDisplay dpy, EGLSurface surface, EGLint buffer );
/* EGL 1.1 swap control API */
-EGLBoolean eglSwapInterval(EGLDisplay dpy, EGLint interval);
-
-EGLContext eglCreateContext (EGLDisplay dpy, EGLConfig config, EGLContext share_list, const EGLint *attrib_list);
-EGLBoolean eglDestroyContext (EGLDisplay dpy, EGLContext ctx);
-EGLBoolean eglMakeCurrent (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx);
-EGLContext eglGetCurrentContext (void);
-EGLSurface eglGetCurrentSurface (EGLint readdraw);
-EGLDisplay eglGetCurrentDisplay (void);
-EGLBoolean eglQueryContext (EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value);
-
-EGLBoolean eglWaitGL (void);
-EGLBoolean eglWaitNative (EGLint engine);
-EGLBoolean eglSwapBuffers (EGLDisplay dpy, EGLSurface draw);
-EGLBoolean eglCopyBuffers (EGLDisplay dpy, EGLSurface surface, NativePixmapType target);
+EGLBoolean eglSwapInterval( EGLDisplay dpy, EGLint interval );
+
+EGLContext eglCreateContext( EGLDisplay dpy, EGLConfig config, EGLContext share_list, const EGLint *attrib_list );
+EGLBoolean eglDestroyContext( EGLDisplay dpy, EGLContext ctx );
+EGLBoolean eglMakeCurrent( EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx );
+EGLContext eglGetCurrentContext( void );
+EGLSurface eglGetCurrentSurface( EGLint readdraw );
+EGLDisplay eglGetCurrentDisplay( void );
+EGLBoolean eglQueryContext( EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value );
+
+EGLBoolean eglWaitGL( void );
+EGLBoolean eglWaitNative( EGLint engine );
+EGLBoolean eglSwapBuffers( EGLDisplay dpy, EGLSurface draw );
+EGLBoolean eglCopyBuffers( EGLDisplay dpy, EGLSurface surface, NativePixmapType target );
#ifdef __cplusplus
}
index 605864b5729d09429e5af927595469c41d9ca538..edf91028a413b84a2045ba1421d86f481d599f57 100644 (file)
--- a/GL/gl.h
+++ b/GL/gl.h
typedef int GLclampx;
/* Boolean values */
-#define GL_FALSE 0x0
-#define GL_TRUE 0x1
+#define GL_FALSE 0x0
+#define GL_TRUE 0x1
/* Data types */
-#define GL_BYTE 0x1400
-#define GL_UNSIGNED_BYTE 0x1401
-#define GL_SHORT 0x1402
-#define GL_UNSIGNED_SHORT 0x1403
-#define GL_INT 0x1404
-#define GL_UNSIGNED_INT 0x1405
-#define GL_FLOAT 0x1406
-#define GL_2_BYTES 0x1407
-#define GL_3_BYTES 0x1408
-#define GL_4_BYTES 0x1409
-#define GL_DOUBLE 0x140A
+#define GL_BYTE 0x1400
+#define GL_UNSIGNED_BYTE 0x1401
+#define GL_SHORT 0x1402
+#define GL_UNSIGNED_SHORT 0x1403
+#define GL_INT 0x1404
+#define GL_UNSIGNED_INT 0x1405
+#define GL_FLOAT 0x1406
+#define GL_2_BYTES 0x1407
+#define GL_3_BYTES 0x1408
+#define GL_4_BYTES 0x1409
+#define GL_DOUBLE 0x140A
/* StringName */
-#define GL_VENDOR 0x1F00
-#define GL_RENDERER 0x1F01
-#define GL_VERSION 0x1F02
-#define GL_EXTENSIONS 0x1F03
+#define GL_VENDOR 0x1F00
+#define GL_RENDERER 0x1F01
+#define GL_VERSION 0x1F02
+#define GL_EXTENSIONS 0x1F03
/* TextureEnvMode */
-#define GL_MODULATE 0x2100
-#define GL_DECAL 0x2101
+#define GL_MODULATE 0x2100
+#define GL_DECAL 0x2101
/* GL_BLEND */
-#define GL_ADD 0x0104
+#define GL_ADD 0x0104
/* GL_REPLACE */
-
/* Primitives */
-#define GL_POINTS 0x0000
-#define GL_LINES 0x0001
-#define GL_LINE_LOOP 0x0002
-#define GL_LINE_STRIP 0x0003
-#define GL_TRIANGLES 0x0004
-#define GL_TRIANGLE_STRIP 0x0005
-#define GL_TRIANGLE_FAN 0x0006
-#define GL_QUADS 0x0007
-#define GL_QUAD_STRIP 0x0008
-#define GL_POLYGON 0x0009
+#define GL_POINTS 0x0000
+#define GL_LINES 0x0001
+#define GL_LINE_LOOP 0x0002
+#define GL_LINE_STRIP 0x0003
+#define GL_TRIANGLES 0x0004
+#define GL_TRIANGLE_STRIP 0x0005
+#define GL_TRIANGLE_FAN 0x0006
+#define GL_QUADS 0x0007
+#define GL_QUAD_STRIP 0x0008
+#define GL_POLYGON 0x0009
/* EnableCap */
-#define GL_FOG 0x0B60
-#define GL_LIGHTING 0x0B50
-#define GL_TEXTURE_2D 0x0DE1
-#define GL_CULL_FACE 0x0B44
-#define GL_ALPHA_TEST 0x0BC0
-#define GL_BLEND 0x0BE2
-#define GL_COLOR_LOGIC_OP 0x0BF2
-#define GL_DITHER 0x0BD0
-#define GL_STENCIL_TEST 0x0B90
-#define GL_DEPTH_TEST 0x0B71
+#define GL_FOG 0x0B60
+#define GL_LIGHTING 0x0B50
+#define GL_TEXTURE_2D 0x0DE1
+#define GL_CULL_FACE 0x0B44
+#define GL_ALPHA_TEST 0x0BC0
+#define GL_BLEND 0x0BE2
+#define GL_COLOR_LOGIC_OP 0x0BF2
+#define GL_DITHER 0x0BD0
+#define GL_STENCIL_TEST 0x0B90
+#define GL_DEPTH_TEST 0x0B71
/* GL_LIGHT0 */
/* GL_LIGHT1 */
/* GL_LIGHT2 */
/* GL_LIGHT5 */
/* GL_LIGHT6 */
/* GL_LIGHT7 */
-#define GL_POINT_SMOOTH 0x0B10
-#define GL_LINE_SMOOTH 0x0B20
-#define GL_SCISSOR_TEST 0x0C11
-#define GL_COLOR_MATERIAL 0x0B57
-#define GL_NORMALIZE 0x0BA1
-#define GL_RESCALE_NORMAL 0x803A
-#define GL_POLYGON_OFFSET_FILL 0x8037
-#define GL_VERTEX_ARRAY 0x8074
-#define GL_NORMAL_ARRAY 0x8075
-#define GL_COLOR_ARRAY 0x8076
-#define GL_TEXTURE_COORD_ARRAY 0x8078
-#define GL_MULTISAMPLE 0x809D
-#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
-#define GL_SAMPLE_ALPHA_TO_ONE 0x809F
-#define GL_SAMPLE_COVERAGE 0x80A0
-
+#define GL_POINT_SMOOTH 0x0B10
+#define GL_LINE_SMOOTH 0x0B20
+#define GL_SCISSOR_TEST 0x0C11
+#define GL_COLOR_MATERIAL 0x0B57
+#define GL_NORMALIZE 0x0BA1
+#define GL_RESCALE_NORMAL 0x803A
+#define GL_POLYGON_OFFSET_FILL 0x8037
+#define GL_VERTEX_ARRAY 0x8074
+#define GL_NORMAL_ARRAY 0x8075
+#define GL_COLOR_ARRAY 0x8076
+#define GL_TEXTURE_COORD_ARRAY 0x8078
+#define GL_MULTISAMPLE 0x809D
+#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
+#define GL_SAMPLE_ALPHA_TO_ONE 0x809F
+#define GL_SAMPLE_COVERAGE 0x80A0
/* Texture mapping */
-#define GL_TEXTURE_ENV 0x2300
-#define GL_TEXTURE_ENV_MODE 0x2200
-#define GL_TEXTURE_1D 0x0DE0
-#define GL_TEXTURE_2D 0x0DE1
-#define GL_TEXTURE_WRAP_S 0x2802
-#define GL_TEXTURE_WRAP_T 0x2803
-#define GL_TEXTURE_MAG_FILTER 0x2800
-#define GL_TEXTURE_MIN_FILTER 0x2801
-#define GL_TEXTURE_ENV_COLOR 0x2201
-#define GL_TEXTURE_GEN_S 0x0C60
-#define GL_TEXTURE_GEN_T 0x0C61
-#define GL_TEXTURE_GEN_MODE 0x2500
-#define GL_TEXTURE_BORDER_COLOR 0x1004
-#define GL_TEXTURE_WIDTH 0x1000
-#define GL_TEXTURE_HEIGHT 0x1001
-#define GL_TEXTURE_BORDER 0x1005
-#define GL_TEXTURE_COMPONENTS 0x1003
-#define GL_TEXTURE_RED_SIZE 0x805C
-#define GL_TEXTURE_GREEN_SIZE 0x805D
-#define GL_TEXTURE_BLUE_SIZE 0x805E
-#define GL_TEXTURE_ALPHA_SIZE 0x805F
-#define GL_TEXTURE_LUMINANCE_SIZE 0x8060
-#define GL_TEXTURE_INTENSITY_SIZE 0x8061
-#define GL_NEAREST_MIPMAP_NEAREST 0x2700
-#define GL_NEAREST_MIPMAP_LINEAR 0x2702
-#define GL_LINEAR_MIPMAP_NEAREST 0x2701
-#define GL_LINEAR_MIPMAP_LINEAR 0x2703
-#define GL_OBJECT_LINEAR 0x2401
-#define GL_OBJECT_PLANE 0x2501
-#define GL_EYE_LINEAR 0x2400
-#define GL_EYE_PLANE 0x2502
-#define GL_SPHERE_MAP 0x2402
-#define GL_DECAL 0x2101
-#define GL_MODULATE 0x2100
-#define GL_NEAREST 0x2600
-#define GL_REPEAT 0x2901
-#define GL_CLAMP 0x2900
-#define GL_S 0x2000
-#define GL_T 0x2001
-#define GL_R 0x2002
-#define GL_Q 0x2003
-#define GL_TEXTURE_GEN_R 0x0C62
-#define GL_TEXTURE_GEN_Q 0x0C63
-#define GL_CLAMP_TO_EDGE 0x812F
+#define GL_TEXTURE_ENV 0x2300
+#define GL_TEXTURE_ENV_MODE 0x2200
+#define GL_TEXTURE_1D 0x0DE0
+#define GL_TEXTURE_2D 0x0DE1
+#define GL_TEXTURE_WRAP_S 0x2802
+#define GL_TEXTURE_WRAP_T 0x2803
+#define GL_TEXTURE_MAG_FILTER 0x2800
+#define GL_TEXTURE_MIN_FILTER 0x2801
+#define GL_TEXTURE_ENV_COLOR 0x2201
+#define GL_TEXTURE_GEN_S 0x0C60
+#define GL_TEXTURE_GEN_T 0x0C61
+#define GL_TEXTURE_GEN_MODE 0x2500
+#define GL_TEXTURE_BORDER_COLOR 0x1004
+#define GL_TEXTURE_WIDTH 0x1000
+#define GL_TEXTURE_HEIGHT 0x1001
+#define GL_TEXTURE_BORDER 0x1005
+#define GL_TEXTURE_COMPONENTS 0x1003
+#define GL_TEXTURE_RED_SIZE 0x805C
+#define GL_TEXTURE_GREEN_SIZE 0x805D
+#define GL_TEXTURE_BLUE_SIZE 0x805E
+#define GL_TEXTURE_ALPHA_SIZE 0x805F
+#define GL_TEXTURE_LUMINANCE_SIZE 0x8060
+#define GL_TEXTURE_INTENSITY_SIZE 0x8061
+#define GL_NEAREST_MIPMAP_NEAREST 0x2700
+#define GL_NEAREST_MIPMAP_LINEAR 0x2702
+#define GL_LINEAR_MIPMAP_NEAREST 0x2701
+#define GL_LINEAR_MIPMAP_LINEAR 0x2703
+#define GL_OBJECT_LINEAR 0x2401
+#define GL_OBJECT_PLANE 0x2501
+#define GL_EYE_LINEAR 0x2400
+#define GL_EYE_PLANE 0x2502
+#define GL_SPHERE_MAP 0x2402
+#define GL_DECAL 0x2101
+#define GL_MODULATE 0x2100
+#define GL_NEAREST 0x2600
+#define GL_REPEAT 0x2901
+#define GL_CLAMP 0x2900
+#define GL_S 0x2000
+#define GL_T 0x2001
+#define GL_R 0x2002
+#define GL_Q 0x2003
+#define GL_TEXTURE_GEN_R 0x0C62
+#define GL_TEXTURE_GEN_Q 0x0C63
+#define GL_CLAMP_TO_EDGE 0x812F
/* Matrix Mode */
-#define GL_MATRIX_MODE 0x0BA0
-#define GL_MODELVIEW 0x1700
-#define GL_PROJECTION 0x1701
-#define GL_TEXTURE 0x1702
+#define GL_MATRIX_MODE 0x0BA0
+#define GL_MODELVIEW 0x1700
+#define GL_PROJECTION 0x1701
+#define GL_TEXTURE 0x1702
/* Buffers, Pixel Drawing/Reading */
-#define GL_NONE 0x0
-#define GL_LEFT 0x0406
-#define GL_RIGHT 0x0407
+#define GL_NONE 0x0
+#define GL_LEFT 0x0406
+#define GL_RIGHT 0x0407
/*GL_FRONT 0x0404 */
/*GL_BACK 0x0405 */
/*GL_FRONT_AND_BACK 0x0408 */
-#define GL_FRONT_LEFT 0x0400
-#define GL_FRONT_RIGHT 0x0401
-#define GL_BACK_LEFT 0x0402
-#define GL_BACK_RIGHT 0x0403
-#define GL_AUX0 0x0409
-#define GL_AUX1 0x040A
-#define GL_AUX2 0x040B
-#define GL_AUX3 0x040C
-#define GL_COLOR_INDEX 0x1900
-#define GL_RED 0x1903
-#define GL_GREEN 0x1904
-#define GL_BLUE 0x1905
-#define GL_ALPHA 0x1906
-#define GL_LUMINANCE 0x1909
-#define GL_LUMINANCE_ALPHA 0x190A
-#define GL_ALPHA_BITS 0x0D55
-#define GL_RED_BITS 0x0D52
-#define GL_GREEN_BITS 0x0D53
-#define GL_BLUE_BITS 0x0D54
-#define GL_INDEX_BITS 0x0D51
-#define GL_SUBPIXEL_BITS 0x0D50
-#define GL_AUX_BUFFERS 0x0C00
-#define GL_READ_BUFFER 0x0C02
-#define GL_DRAW_BUFFER 0x0C01
-#define GL_DOUBLEBUFFER 0x0C32
-#define GL_STEREO 0x0C33
-#define GL_BITMAP 0x1A00
-#define GL_COLOR 0x1800
-#define GL_DEPTH 0x1801
-#define GL_STENCIL 0x1802
-#define GL_DITHER 0x0BD0
-#define GL_RGB 0x1907
-#define GL_RGBA 0x1908
+#define GL_FRONT_LEFT 0x0400
+#define GL_FRONT_RIGHT 0x0401
+#define GL_BACK_LEFT 0x0402
+#define GL_BACK_RIGHT 0x0403
+#define GL_AUX0 0x0409
+#define GL_AUX1 0x040A
+#define GL_AUX2 0x040B
+#define GL_AUX3 0x040C
+#define GL_COLOR_INDEX 0x1900
+#define GL_RED 0x1903
+#define GL_GREEN 0x1904
+#define GL_BLUE 0x1905
+#define GL_ALPHA 0x1906
+#define GL_LUMINANCE 0x1909
+#define GL_LUMINANCE_ALPHA 0x190A
+#define GL_ALPHA_BITS 0x0D55
+#define GL_RED_BITS 0x0D52
+#define GL_GREEN_BITS 0x0D53
+#define GL_BLUE_BITS 0x0D54
+#define GL_INDEX_BITS 0x0D51
+#define GL_SUBPIXEL_BITS 0x0D50
+#define GL_AUX_BUFFERS 0x0C00
+#define GL_READ_BUFFER 0x0C02
+#define GL_DRAW_BUFFER 0x0C01
+#define GL_DOUBLEBUFFER 0x0C32
+#define GL_STEREO 0x0C33
+#define GL_BITMAP 0x1A00
+#define GL_COLOR 0x1800
+#define GL_DEPTH 0x1801
+#define GL_STENCIL 0x1802
+#define GL_DITHER 0x0BD0
+#define GL_RGB 0x1907
+#define GL_RGBA 0x1908
/* Fog */
-#define GL_FOG 0x0B60
-#define GL_FOG_MODE 0x0B65
-#define GL_FOG_DENSITY 0x0B62
-#define GL_FOG_COLOR 0x0B66
-#define GL_FOG_INDEX 0x0B61
-#define GL_FOG_START 0x0B63
-#define GL_FOG_END 0x0B64
-#define GL_LINEAR 0x2601
-#define GL_EXP 0x0800
-#define GL_EXP2 0x0801
+#define GL_FOG 0x0B60
+#define GL_FOG_MODE 0x0B65
+#define GL_FOG_DENSITY 0x0B62
+#define GL_FOG_COLOR 0x0B66
+#define GL_FOG_INDEX 0x0B61
+#define GL_FOG_START 0x0B63
+#define GL_FOG_END 0x0B64
+#define GL_LINEAR 0x2601
+#define GL_EXP 0x0800
+#define GL_EXP2 0x0801
/* Polygons */
-#define GL_POINT 0x1B00
-#define GL_LINE 0x1B01
-#define GL_FILL 0x1B02
-#define GL_CW 0x0900
-#define GL_CCW 0x0901
-#define GL_FRONT 0x0404
-#define GL_BACK 0x0405
-#define GL_POLYGON_MODE 0x0B40
-#define GL_POLYGON_SMOOTH 0x0B41
-#define GL_POLYGON_STIPPLE 0x0B42
-#define GL_EDGE_FLAG 0x0B43
-#define GL_CULL_FACE 0x0B44
-#define GL_CULL_FACE_MODE 0x0B45
-#define GL_FRONT_FACE 0x0B46
-#define GL_POLYGON_OFFSET_FACTOR 0x8038
-#define GL_POLYGON_OFFSET_UNITS 0x2A00
-#define GL_POLYGON_OFFSET_POINT 0x2A01
-#define GL_POLYGON_OFFSET_LINE 0x2A02
-#define GL_POLYGON_OFFSET_FILL 0x8037
+#define GL_POINT 0x1B00
+#define GL_LINE 0x1B01
+#define GL_FILL 0x1B02
+#define GL_CW 0x0900
+#define GL_CCW 0x0901
+#define GL_FRONT 0x0404
+#define GL_BACK 0x0405
+#define GL_POLYGON_MODE 0x0B40
+#define GL_POLYGON_SMOOTH 0x0B41
+#define GL_POLYGON_STIPPLE 0x0B42
+#define GL_EDGE_FLAG 0x0B43
+#define GL_CULL_FACE 0x0B44
+#define GL_CULL_FACE_MODE 0x0B45
+#define GL_FRONT_FACE 0x0B46
+#define GL_POLYGON_OFFSET_FACTOR 0x8038
+#define GL_POLYGON_OFFSET_UNITS 0x2A00
+#define GL_POLYGON_OFFSET_POINT 0x2A01
+#define GL_POLYGON_OFFSET_LINE 0x2A02
+#define GL_POLYGON_OFFSET_FILL 0x8037
/* Lighting */
-#define GL_LIGHTING 0x0B50
-#define GL_LIGHT0 0x4000
-#define GL_LIGHT1 0x4001
-#define GL_LIGHT2 0x4002
-#define GL_LIGHT3 0x4003
-#define GL_LIGHT4 0x4004
-#define GL_LIGHT5 0x4005
-#define GL_LIGHT6 0x4006
-#define GL_LIGHT7 0x4007
-#define GL_SPOT_EXPONENT 0x1205
-#define GL_SPOT_CUTOFF 0x1206
-#define GL_CONSTANT_ATTENUATION 0x1207
-#define GL_LINEAR_ATTENUATION 0x1208
-#define GL_QUADRATIC_ATTENUATION 0x1209
-#define GL_AMBIENT 0x1200
-#define GL_DIFFUSE 0x1201
-#define GL_SPECULAR 0x1202
-#define GL_SHININESS 0x1601
-#define GL_EMISSION 0x1600
-#define GL_POSITION 0x1203
-#define GL_SPOT_DIRECTION 0x1204
-#define GL_AMBIENT_AND_DIFFUSE 0x1602
-#define GL_COLOR_INDEXES 0x1603
-#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52
-#define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51
-#define GL_LIGHT_MODEL_AMBIENT 0x0B53
-#define GL_FRONT_AND_BACK 0x0408
-#define GL_SHADE_MODEL 0x0B54
-#define GL_FLAT 0x1D00
-#define GL_SMOOTH 0x1D01
-#define GL_COLOR_MATERIAL 0x0B57
-#define GL_COLOR_MATERIAL_FACE 0x0B55
-#define GL_COLOR_MATERIAL_PARAMETER 0x0B56
-#define GL_NORMALIZE 0x0BA1
+#define GL_LIGHTING 0x0B50
+#define GL_LIGHT0 0x4000
+#define GL_LIGHT1 0x4001
+#define GL_LIGHT2 0x4002
+#define GL_LIGHT3 0x4003
+#define GL_LIGHT4 0x4004
+#define GL_LIGHT5 0x4005
+#define GL_LIGHT6 0x4006
+#define GL_LIGHT7 0x4007
+#define GL_SPOT_EXPONENT 0x1205
+#define GL_SPOT_CUTOFF 0x1206
+#define GL_CONSTANT_ATTENUATION 0x1207
+#define GL_LINEAR_ATTENUATION 0x1208
+#define GL_QUADRATIC_ATTENUATION 0x1209
+#define GL_AMBIENT 0x1200
+#define GL_DIFFUSE 0x1201
+#define GL_SPECULAR 0x1202
+#define GL_SHININESS 0x1601
+#define GL_EMISSION 0x1600
+#define GL_POSITION 0x1203
+#define GL_SPOT_DIRECTION 0x1204
+#define GL_AMBIENT_AND_DIFFUSE 0x1602
+#define GL_COLOR_INDEXES 0x1603
+#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52
+#define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51
+#define GL_LIGHT_MODEL_AMBIENT 0x0B53
+#define GL_FRONT_AND_BACK 0x0408
+#define GL_SHADE_MODEL 0x0B54
+#define GL_FLAT 0x1D00
+#define GL_SMOOTH 0x1D01
+#define GL_COLOR_MATERIAL 0x0B57
+#define GL_COLOR_MATERIAL_FACE 0x0B55
+#define GL_COLOR_MATERIAL_PARAMETER 0x0B56
+#define GL_NORMALIZE 0x0BA1
/* Blending */
-#define GL_BLEND 0x0BE2
-#define GL_BLEND_SRC 0x0BE1
-#define GL_BLEND_DST 0x0BE0
-#define GL_ZERO 0x0
-#define GL_ONE 0x1
-#define GL_SRC_COLOR 0x0300
-#define GL_ONE_MINUS_SRC_COLOR 0x0301
-#define GL_SRC_ALPHA 0x0302
-#define GL_ONE_MINUS_SRC_ALPHA 0x0303
-#define GL_DST_ALPHA 0x0304
-#define GL_ONE_MINUS_DST_ALPHA 0x0305
-#define GL_DST_COLOR 0x0306
-#define GL_ONE_MINUS_DST_COLOR 0x0307
-#define GL_SRC_ALPHA_SATURATE 0x0308
+#define GL_BLEND 0x0BE2
+#define GL_BLEND_SRC 0x0BE1
+#define GL_BLEND_DST 0x0BE0
+#define GL_ZERO 0x0
+#define GL_ONE 0x1
+#define GL_SRC_COLOR 0x0300
+#define GL_ONE_MINUS_SRC_COLOR 0x0301
+#define GL_SRC_ALPHA 0x0302
+#define GL_ONE_MINUS_SRC_ALPHA 0x0303
+#define GL_DST_ALPHA 0x0304
+#define GL_ONE_MINUS_DST_ALPHA 0x0305
+#define GL_DST_COLOR 0x0306
+#define GL_ONE_MINUS_DST_COLOR 0x0307
+#define GL_SRC_ALPHA_SATURATE 0x0308
/* ClipPlaneName */
-#define GL_CLIP_PLANE0 0x3000
-#define GL_CLIP_PLANE1 0x3001
-#define GL_CLIP_PLANE2 0x3002
-#define GL_CLIP_PLANE3 0x3003
-#define GL_CLIP_PLANE4 0x3004
-#define GL_CLIP_PLANE5 0x3005
-
+#define GL_CLIP_PLANE0 0x3000
+#define GL_CLIP_PLANE1 0x3001
+#define GL_CLIP_PLANE2 0x3002
+#define GL_CLIP_PLANE3 0x3003
+#define GL_CLIP_PLANE4 0x3004
+#define GL_CLIP_PLANE5 0x3005
/* OpenGL 1.1 */
-#define GL_PROXY_TEXTURE_1D 0x8063
-#define GL_PROXY_TEXTURE_2D 0x8064
-#define GL_TEXTURE_PRIORITY 0x8066
-#define GL_TEXTURE_RESIDENT 0x8067
-#define GL_TEXTURE_BINDING_1D 0x8068
-#define GL_TEXTURE_BINDING_2D 0x8069
-#define GL_TEXTURE_INTERNAL_FORMAT 0x1003
-#define GL_ALPHA4 0x803B
-#define GL_ALPHA8 0x803C
-#define GL_ALPHA12 0x803D
-#define GL_ALPHA16 0x803E
-#define GL_LUMINANCE4 0x803F
-#define GL_LUMINANCE8 0x8040
-#define GL_LUMINANCE12 0x8041
-#define GL_LUMINANCE16 0x8042
-#define GL_LUMINANCE4_ALPHA4 0x8043
-#define GL_LUMINANCE6_ALPHA2 0x8044
-#define GL_LUMINANCE8_ALPHA8 0x8045
-#define GL_LUMINANCE12_ALPHA4 0x8046
-#define GL_LUMINANCE12_ALPHA12 0x8047
-#define GL_LUMINANCE16_ALPHA16 0x8048
-#define GL_INTENSITY 0x8049
-#define GL_INTENSITY4 0x804A
-#define GL_INTENSITY8 0x804B
-#define GL_INTENSITY12 0x804C
-#define GL_INTENSITY16 0x804D
-#define GL_R3_G3_B2 0x2A10
-#define GL_RGB4 0x804F
-#define GL_RGB5 0x8050
-#define GL_RGB8 0x8051
-#define GL_RGB10 0x8052
-#define GL_RGB12 0x8053
-#define GL_RGB16 0x8054
-#define GL_RGBA2 0x8055
-#define GL_RGBA4 0x8056
-#define GL_RGB5_A1 0x8057
-#define GL_RGBA8 0x8058
-#define GL_RGB10_A2 0x8059
-#define GL_RGBA12 0x805A
-#define GL_RGBA16 0x805B
-#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
-#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
-#define GL_UNSIGNED_SHORT_5_6_5 0x8363
-
-
-#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001
-#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002
-#define GL_ALL_CLIENT_ATTRIB_BITS 0xFFFFFFFF
-#define GL_CLIENT_ALL_ATTRIB_BITS 0xFFFFFFFF
+#define GL_PROXY_TEXTURE_1D 0x8063
+#define GL_PROXY_TEXTURE_2D 0x8064
+#define GL_TEXTURE_PRIORITY 0x8066
+#define GL_TEXTURE_RESIDENT 0x8067
+#define GL_TEXTURE_BINDING_1D 0x8068
+#define GL_TEXTURE_BINDING_2D 0x8069
+#define GL_TEXTURE_INTERNAL_FORMAT 0x1003
+#define GL_ALPHA4 0x803B
+#define GL_ALPHA8 0x803C
+#define GL_ALPHA12 0x803D
+#define GL_ALPHA16 0x803E
+#define GL_LUMINANCE4 0x803F
+#define GL_LUMINANCE8 0x8040
+#define GL_LUMINANCE12 0x8041
+#define GL_LUMINANCE16 0x8042
+#define GL_LUMINANCE4_ALPHA4 0x8043
+#define GL_LUMINANCE6_ALPHA2 0x8044
+#define GL_LUMINANCE8_ALPHA8 0x8045
+#define GL_LUMINANCE12_ALPHA4 0x8046
+#define GL_LUMINANCE12_ALPHA12 0x8047
+#define GL_LUMINANCE16_ALPHA16 0x8048
+#define GL_INTENSITY 0x8049
+#define GL_INTENSITY4 0x804A
+#define GL_INTENSITY8 0x804B
+#define GL_INTENSITY12 0x804C
+#define GL_INTENSITY16 0x804D
+#define GL_R3_G3_B2 0x2A10
+#define GL_RGB4 0x804F
+#define GL_RGB5 0x8050
+#define GL_RGB8 0x8051
+#define GL_RGB10 0x8052
+#define GL_RGB12 0x8053
+#define GL_RGB16 0x8054
+#define GL_RGBA2 0x8055
+#define GL_RGBA4 0x8056
+#define GL_RGB5_A1 0x8057
+#define GL_RGBA8 0x8058
+#define GL_RGB10_A2 0x8059
+#define GL_RGBA12 0x805A
+#define GL_RGBA16 0x805B
+#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
+#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
+#define GL_UNSIGNED_SHORT_5_6_5 0x8363
+
+#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001
+#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002
+#define GL_ALL_CLIENT_ATTRIB_BITS 0xFFFFFFFF
+#define GL_CLIENT_ALL_ATTRIB_BITS 0xFFFFFFFF
/* Stencil */
-#define GL_STENCIL_TEST 0x0B90
-#define GL_STENCIL_WRITEMASK 0x0B98
-#define GL_STENCIL_BITS 0x0D57
-#define GL_STENCIL_FUNC 0x0B92
-#define GL_STENCIL_VALUE_MASK 0x0B93
-#define GL_STENCIL_REF 0x0B97
-#define GL_STENCIL_FAIL 0x0B94
-#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
-#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
-#define GL_STENCIL_CLEAR_VALUE 0x0B91
-#define GL_STENCIL_INDEX 0x1901
-#define GL_KEEP 0x1E00
-#define GL_REPLACE 0x1E01
-#define GL_INCR 0x1E02
-#define GL_DECR 0x1E03
+#define GL_STENCIL_TEST 0x0B90
+#define GL_STENCIL_WRITEMASK 0x0B98
+#define GL_STENCIL_BITS 0x0D57
+#define GL_STENCIL_FUNC 0x0B92
+#define GL_STENCIL_VALUE_MASK 0x0B93
+#define GL_STENCIL_REF 0x0B97
+#define GL_STENCIL_FAIL 0x0B94
+#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
+#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
+#define GL_STENCIL_CLEAR_VALUE 0x0B91
+#define GL_STENCIL_INDEX 0x1901
+#define GL_KEEP 0x1E00
+#define GL_REPLACE 0x1E01
+#define GL_INCR 0x1E02
+#define GL_DECR 0x1E03
/* Hints */
-#define GL_FOG_HINT 0x0C54
-#define GL_LINE_SMOOTH_HINT 0x0C52
-#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50
-#define GL_POINT_SMOOTH_HINT 0x0C51
-#define GL_POLYGON_SMOOTH_HINT 0x0C53
-#define GL_DONT_CARE 0x1100
-#define GL_FASTEST 0x1101
-#define GL_NICEST 0x1102
+#define GL_FOG_HINT 0x0C54
+#define GL_LINE_SMOOTH_HINT 0x0C52
+#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50
+#define GL_POINT_SMOOTH_HINT 0x0C51
+#define GL_POLYGON_SMOOTH_HINT 0x0C53
+#define GL_DONT_CARE 0x1100
+#define GL_FASTEST 0x1101
+#define GL_NICEST 0x1102
/* Gets */
-#define GL_ATTRIB_STACK_DEPTH 0x0BB0
-#define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1
-#define GL_COLOR_CLEAR_VALUE 0x0C22
-#define GL_COLOR_WRITEMASK 0x0C23
-#define GL_CURRENT_INDEX 0x0B01
-#define GL_CURRENT_COLOR 0x0B00
-#define GL_CURRENT_NORMAL 0x0B02
-#define GL_CURRENT_RASTER_COLOR 0x0B04
-#define GL_CURRENT_RASTER_DISTANCE 0x0B09
-#define GL_CURRENT_RASTER_INDEX 0x0B05
-#define GL_CURRENT_RASTER_POSITION 0x0B07
-#define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06
-#define GL_CURRENT_RASTER_POSITION_VALID 0x0B08
-#define GL_CURRENT_TEXTURE_COORDS 0x0B03
-#define GL_INDEX_CLEAR_VALUE 0x0C20
-#define GL_INDEX_MODE 0x0C30
-#define GL_INDEX_WRITEMASK 0x0C21
-#define GL_MODELVIEW_MATRIX 0x0BA6
-#define GL_MODELVIEW_STACK_DEPTH 0x0BA3
-#define GL_NAME_STACK_DEPTH 0x0D70
-#define GL_PROJECTION_MATRIX 0x0BA7
-#define GL_PROJECTION_STACK_DEPTH 0x0BA4
-#define GL_RENDER_MODE 0x0C40
-#define GL_RGBA_MODE 0x0C31
-#define GL_TEXTURE_MATRIX 0x0BA8
-#define GL_TEXTURE_STACK_DEPTH 0x0BA5
-#define GL_VIEWPORT 0x0BA2
+#define GL_ATTRIB_STACK_DEPTH 0x0BB0
+#define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1
+#define GL_COLOR_CLEAR_VALUE 0x0C22
+#define GL_COLOR_WRITEMASK 0x0C23
+#define GL_CURRENT_INDEX 0x0B01
+#define GL_CURRENT_COLOR 0x0B00
+#define GL_CURRENT_NORMAL 0x0B02
+#define GL_CURRENT_RASTER_COLOR 0x0B04
+#define GL_CURRENT_RASTER_DISTANCE 0x0B09
+#define GL_CURRENT_RASTER_INDEX 0x0B05
+#define GL_CURRENT_RASTER_POSITION 0x0B07
+#define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06
+#define GL_CURRENT_RASTER_POSITION_VALID 0x0B08
+#define GL_CURRENT_TEXTURE_COORDS 0x0B03
+#define GL_INDEX_CLEAR_VALUE 0x0C20
+#define GL_INDEX_MODE 0x0C30
+#define GL_INDEX_WRITEMASK 0x0C21
+#define GL_MODELVIEW_MATRIX 0x0BA6
+#define GL_MODELVIEW_STACK_DEPTH 0x0BA3
+#define GL_NAME_STACK_DEPTH 0x0D70
+#define GL_PROJECTION_MATRIX 0x0BA7
+#define GL_PROJECTION_STACK_DEPTH 0x0BA4
+#define GL_RENDER_MODE 0x0C40
+#define GL_RGBA_MODE 0x0C31
+#define GL_TEXTURE_MATRIX 0x0BA8
+#define GL_TEXTURE_STACK_DEPTH 0x0BA5
+#define GL_VIEWPORT 0x0BA2
/* glPush/PopAttrib bits */
-#define GL_CURRENT_BIT 0x00000001
-#define GL_POINT_BIT 0x00000002
-#define GL_LINE_BIT 0x00000004
-#define GL_POLYGON_BIT 0x00000008
-#define GL_POLYGON_STIPPLE_BIT 0x00000010
-#define GL_PIXEL_MODE_BIT 0x00000020
-#define GL_LIGHTING_BIT 0x00000040
-#define GL_FOG_BIT 0x00000080
-#define GL_DEPTH_BUFFER_BIT 0x00000100
-#define GL_ACCUM_BUFFER_BIT 0x00000200
-#define GL_STENCIL_BUFFER_BIT 0x00000400
-#define GL_VIEWPORT_BIT 0x00000800
-#define GL_TRANSFORM_BIT 0x00001000
-#define GL_ENABLE_BIT 0x00002000
-#define GL_COLOR_BUFFER_BIT 0x00004000
-#define GL_HINT_BIT 0x00008000
-#define GL_EVAL_BIT 0x00010000
-#define GL_LIST_BIT 0x00020000
-#define GL_TEXTURE_BIT 0x00040000
-#define GL_SCISSOR_BIT 0x00080000
-#define GL_ALL_ATTRIB_BITS 0x000FFFFF
+#define GL_CURRENT_BIT 0x00000001
+#define GL_POINT_BIT 0x00000002
+#define GL_LINE_BIT 0x00000004
+#define GL_POLYGON_BIT 0x00000008
+#define GL_POLYGON_STIPPLE_BIT 0x00000010
+#define GL_PIXEL_MODE_BIT 0x00000020
+#define GL_LIGHTING_BIT 0x00000040
+#define GL_FOG_BIT 0x00000080
+#define GL_DEPTH_BUFFER_BIT 0x00000100
+#define GL_ACCUM_BUFFER_BIT 0x00000200
+#define GL_STENCIL_BUFFER_BIT 0x00000400
+#define GL_VIEWPORT_BIT 0x00000800
+#define GL_TRANSFORM_BIT 0x00001000
+#define GL_ENABLE_BIT 0x00002000
+#define GL_COLOR_BUFFER_BIT 0x00004000
+#define GL_HINT_BIT 0x00008000
+#define GL_EVAL_BIT 0x00010000
+#define GL_LIST_BIT 0x00020000
+#define GL_TEXTURE_BIT 0x00040000
+#define GL_SCISSOR_BIT 0x00080000
+#define GL_ALL_ATTRIB_BITS 0x000FFFFF
/* Depth buffer */
-#define GL_NEVER 0x0200
-#define GL_LESS 0x0201
-#define GL_EQUAL 0x0202
-#define GL_LEQUAL 0x0203
-#define GL_GREATER 0x0204
-#define GL_NOTEQUAL 0x0205
-#define GL_GEQUAL 0x0206
-#define GL_ALWAYS 0x0207
-#define GL_DEPTH_TEST 0x0B71
-#define GL_DEPTH_BITS 0x0D56
-#define GL_DEPTH_CLEAR_VALUE 0x0B73
-#define GL_DEPTH_FUNC 0x0B74
-#define GL_DEPTH_RANGE 0x0B70
-#define GL_DEPTH_WRITEMASK 0x0B72
-#define GL_DEPTH_COMPONENT 0x1902
+#define GL_NEVER 0x0200
+#define GL_LESS 0x0201
+#define GL_EQUAL 0x0202
+#define GL_LEQUAL 0x0203
+#define GL_GREATER 0x0204
+#define GL_NOTEQUAL 0x0205
+#define GL_GEQUAL 0x0206
+#define GL_ALWAYS 0x0207
+#define GL_DEPTH_TEST 0x0B71
+#define GL_DEPTH_BITS 0x0D56
+#define GL_DEPTH_CLEAR_VALUE 0x0B73
+#define GL_DEPTH_FUNC 0x0B74
+#define GL_DEPTH_RANGE 0x0B70
+#define GL_DEPTH_WRITEMASK 0x0B72
+#define GL_DEPTH_COMPONENT 0x1902
/* TextureUnit */
-#define GL_TEXTURE0 0x84C0
-#define GL_TEXTURE1 0x84C1
-#define GL_TEXTURE2 0x84C2
-#define GL_TEXTURE3 0x84C3
-#define GL_TEXTURE4 0x84C4
-#define GL_TEXTURE5 0x84C5
-#define GL_TEXTURE6 0x84C6
-#define GL_TEXTURE7 0x84C7
-#define GL_TEXTURE8 0x84C8
-#define GL_TEXTURE9 0x84C9
-#define GL_TEXTURE10 0x84CA
-#define GL_TEXTURE11 0x84CB
-#define GL_TEXTURE12 0x84CC
-#define GL_TEXTURE13 0x84CD
-#define GL_TEXTURE14 0x84CE
-#define GL_TEXTURE15 0x84CF
-#define GL_TEXTURE16 0x84D0
-#define GL_TEXTURE17 0x84D1
-#define GL_TEXTURE18 0x84D2
-#define GL_TEXTURE19 0x84D3
-#define GL_TEXTURE20 0x84D4
-#define GL_TEXTURE21 0x84D5
-#define GL_TEXTURE22 0x84D6
-#define GL_TEXTURE23 0x84D7
-#define GL_TEXTURE24 0x84D8
-#define GL_TEXTURE25 0x84D9
-#define GL_TEXTURE26 0x84DA
-#define GL_TEXTURE27 0x84DB
-#define GL_TEXTURE28 0x84DC
-#define GL_TEXTURE29 0x84DD
-#define GL_TEXTURE30 0x84DE
-#define GL_TEXTURE31 0x84DF
-#define GL_ACTIVE_TEXTURE 0x84E0
-#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1
+#define GL_TEXTURE0 0x84C0
+#define GL_TEXTURE1 0x84C1
+#define GL_TEXTURE2 0x84C2
+#define GL_TEXTURE3 0x84C3
+#define GL_TEXTURE4 0x84C4
+#define GL_TEXTURE5 0x84C5
+#define GL_TEXTURE6 0x84C6
+#define GL_TEXTURE7 0x84C7
+#define GL_TEXTURE8 0x84C8
+#define GL_TEXTURE9 0x84C9
+#define GL_TEXTURE10 0x84CA
+#define GL_TEXTURE11 0x84CB
+#define GL_TEXTURE12 0x84CC
+#define GL_TEXTURE13 0x84CD
+#define GL_TEXTURE14 0x84CE
+#define GL_TEXTURE15 0x84CF
+#define GL_TEXTURE16 0x84D0
+#define GL_TEXTURE17 0x84D1
+#define GL_TEXTURE18 0x84D2
+#define GL_TEXTURE19 0x84D3
+#define GL_TEXTURE20 0x84D4
+#define GL_TEXTURE21 0x84D5
+#define GL_TEXTURE22 0x84D6
+#define GL_TEXTURE23 0x84D7
+#define GL_TEXTURE24 0x84D8
+#define GL_TEXTURE25 0x84D9
+#define GL_TEXTURE26 0x84DA
+#define GL_TEXTURE27 0x84DB
+#define GL_TEXTURE28 0x84DC
+#define GL_TEXTURE29 0x84DD
+#define GL_TEXTURE30 0x84DE
+#define GL_TEXTURE31 0x84DF
+#define GL_ACTIVE_TEXTURE 0x84E0
+#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1
/* GetPName */
-#define GL_CURRENT_COLOR 0x0B00
-#define GL_CURRENT_NORMAL 0x0B02
-#define GL_CURRENT_TEXTURE_COORDS 0x0B03
-#define GL_POINT_SIZE 0x0B11
-#define GL_POINT_SIZE_MIN 0x8126
-#define GL_POINT_SIZE_MAX 0x8127
-#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128
-#define GL_POINT_DISTANCE_ATTENUATION 0x8129
-#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12
-#define GL_LINE_WIDTH 0x0B21
-#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22
-#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
-#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
-#define GL_CULL_FACE_MODE 0x0B45
-#define GL_FRONT_FACE 0x0B46
-#define GL_SHADE_MODEL 0x0B54
-#define GL_DEPTH_RANGE 0x0B70
-#define GL_DEPTH_WRITEMASK 0x0B72
-#define GL_DEPTH_CLEAR_VALUE 0x0B73
-#define GL_DEPTH_FUNC 0x0B74
-#define GL_STENCIL_CLEAR_VALUE 0x0B91
-#define GL_STENCIL_FUNC 0x0B92
-#define GL_STENCIL_VALUE_MASK 0x0B93
-#define GL_STENCIL_FAIL 0x0B94
-#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
-#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
-#define GL_STENCIL_REF 0x0B97
-#define GL_STENCIL_WRITEMASK 0x0B98
-#define GL_MATRIX_MODE 0x0BA0
-#define GL_VIEWPORT 0x0BA2
-#define GL_MODELVIEW_STACK_DEPTH 0x0BA3
-#define GL_PROJECTION_STACK_DEPTH 0x0BA4
-#define GL_TEXTURE_STACK_DEPTH 0x0BA5
-#define GL_MODELVIEW_MATRIX 0x0BA6
-#define GL_PROJECTION_MATRIX 0x0BA7
-#define GL_TEXTURE_MATRIX 0x0BA8
-#define GL_ALPHA_TEST_FUNC 0x0BC1
-#define GL_ALPHA_TEST_REF 0x0BC2
-#define GL_BLEND_DST 0x0BE0
-#define GL_BLEND_SRC 0x0BE1
-#define GL_LOGIC_OP_MODE 0x0BF0
-#define GL_SCISSOR_BOX 0x0C10
-#define GL_SCISSOR_TEST 0x0C11
-#define GL_COLOR_CLEAR_VALUE 0x0C22
-#define GL_COLOR_WRITEMASK 0x0C23
-#define GL_UNPACK_ALIGNMENT 0x0CF5
-#define GL_PACK_ALIGNMENT 0x0D05
-#define GL_MAX_LIGHTS 0x0D31
-#define GL_MAX_CLIP_PLANES 0x0D32
-#define GL_MAX_TEXTURE_SIZE 0x0D33
-#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36
-#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38
-#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39
-#define GL_MAX_VIEWPORT_DIMS 0x0D3A
-#define GL_MAX_ELEMENTS_VERTICES 0x80E8
-#define GL_MAX_ELEMENTS_INDICES 0x80E9
-#define GL_MAX_TEXTURE_UNITS 0x84E2
-#define GL_SUBPIXEL_BITS 0x0D50
-#define GL_RED_BITS 0x0D52
-#define GL_GREEN_BITS 0x0D53
-#define GL_BLUE_BITS 0x0D54
-#define GL_ALPHA_BITS 0x0D55
-#define GL_DEPTH_BITS 0x0D56
-#define GL_STENCIL_BITS 0x0D57
-#define GL_POLYGON_OFFSET_UNITS 0x2A00
-#define GL_POLYGON_OFFSET_FILL 0x8037
-#define GL_POLYGON_OFFSET_FACTOR 0x8038
-#define GL_TEXTURE_BINDING_2D 0x8069
-#define GL_VERTEX_ARRAY_SIZE 0x807A
-#define GL_VERTEX_ARRAY_TYPE 0x807B
-#define GL_VERTEX_ARRAY_STRIDE 0x807C
-#define GL_NORMAL_ARRAY_TYPE 0x807E
-#define GL_NORMAL_ARRAY_STRIDE 0x807F
-#define GL_COLOR_ARRAY_SIZE 0x8081
-#define GL_COLOR_ARRAY_TYPE 0x8082
-#define GL_COLOR_ARRAY_STRIDE 0x8083
-#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088
-#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089
-#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A
-#define GL_VERTEX_ARRAY_POINTER 0x808E
-#define GL_NORMAL_ARRAY_POINTER 0x808F
-#define GL_COLOR_ARRAY_POINTER 0x8090
-#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092
-#define GL_SAMPLE_BUFFERS 0x80A8
-#define GL_SAMPLES 0x80A9
-#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
-#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
-
+#define GL_CURRENT_COLOR 0x0B00
+#define GL_CURRENT_NORMAL 0x0B02
+#define GL_CURRENT_TEXTURE_COORDS 0x0B03
+#define GL_POINT_SIZE 0x0B11
+#define GL_POINT_SIZE_MIN 0x8126
+#define GL_POINT_SIZE_MAX 0x8127
+#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128
+#define GL_POINT_DISTANCE_ATTENUATION 0x8129
+#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12
+#define GL_LINE_WIDTH 0x0B21
+#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22
+#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
+#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
+#define GL_CULL_FACE_MODE 0x0B45
+#define GL_FRONT_FACE 0x0B46
+#define GL_SHADE_MODEL 0x0B54
+#define GL_DEPTH_RANGE 0x0B70
+#define GL_DEPTH_WRITEMASK 0x0B72
+#define GL_DEPTH_CLEAR_VALUE 0x0B73
+#define GL_DEPTH_FUNC 0x0B74
+#define GL_STENCIL_CLEAR_VALUE 0x0B91
+#define GL_STENCIL_FUNC 0x0B92
+#define GL_STENCIL_VALUE_MASK 0x0B93
+#define GL_STENCIL_FAIL 0x0B94
+#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
+#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
+#define GL_STENCIL_REF 0x0B97
+#define GL_STENCIL_WRITEMASK 0x0B98
+#define GL_MATRIX_MODE 0x0BA0
+#define GL_VIEWPORT 0x0BA2
+#define GL_MODELVIEW_STACK_DEPTH 0x0BA3
+#define GL_PROJECTION_STACK_DEPTH 0x0BA4
+#define GL_TEXTURE_STACK_DEPTH 0x0BA5
+#define GL_MODELVIEW_MATRIX 0x0BA6
+#define GL_PROJECTION_MATRIX 0x0BA7
+#define GL_TEXTURE_MATRIX 0x0BA8
+#define GL_ALPHA_TEST_FUNC 0x0BC1
+#define GL_ALPHA_TEST_REF 0x0BC2
+#define GL_BLEND_DST 0x0BE0
+#define GL_BLEND_SRC 0x0BE1
+#define GL_LOGIC_OP_MODE 0x0BF0
+#define GL_SCISSOR_BOX 0x0C10
+#define GL_SCISSOR_TEST 0x0C11
+#define GL_COLOR_CLEAR_VALUE 0x0C22
+#define GL_COLOR_WRITEMASK 0x0C23
+#define GL_UNPACK_ALIGNMENT 0x0CF5
+#define GL_PACK_ALIGNMENT 0x0D05
+#define GL_MAX_LIGHTS 0x0D31
+#define GL_MAX_CLIP_PLANES 0x0D32
+#define GL_MAX_TEXTURE_SIZE 0x0D33
+#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36
+#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38
+#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39
+#define GL_MAX_VIEWPORT_DIMS 0x0D3A
+#define GL_MAX_ELEMENTS_VERTICES 0x80E8
+#define GL_MAX_ELEMENTS_INDICES 0x80E9
+#define GL_MAX_TEXTURE_UNITS 0x84E2
+#define GL_SUBPIXEL_BITS 0x0D50
+#define GL_RED_BITS 0x0D52
+#define GL_GREEN_BITS 0x0D53
+#define GL_BLUE_BITS 0x0D54
+#define GL_ALPHA_BITS 0x0D55
+#define GL_DEPTH_BITS 0x0D56
+#define GL_STENCIL_BITS 0x0D57
+#define GL_POLYGON_OFFSET_UNITS 0x2A00
+#define GL_POLYGON_OFFSET_FILL 0x8037
+#define GL_POLYGON_OFFSET_FACTOR 0x8038
+#define GL_TEXTURE_BINDING_2D 0x8069
+#define GL_VERTEX_ARRAY_SIZE 0x807A
+#define GL_VERTEX_ARRAY_TYPE 0x807B
+#define GL_VERTEX_ARRAY_STRIDE 0x807C
+#define GL_NORMAL_ARRAY_TYPE 0x807E
+#define GL_NORMAL_ARRAY_STRIDE 0x807F
+#define GL_COLOR_ARRAY_SIZE 0x8081
+#define GL_COLOR_ARRAY_TYPE 0x8082
+#define GL_COLOR_ARRAY_STRIDE 0x8083
+#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088
+#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089
+#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A
+#define GL_VERTEX_ARRAY_POINTER 0x808E
+#define GL_NORMAL_ARRAY_POINTER 0x808F
+#define GL_COLOR_ARRAY_POINTER 0x8090
+#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092
+#define GL_SAMPLE_BUFFERS 0x80A8
+#define GL_SAMPLES 0x80A9
+#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
+#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
/* ErrorCode */
-#define GL_NO_ERROR 0
-#define GL_INVALID_ENUM 0x0500
-#define GL_INVALID_VALUE 0x0501
-#define GL_INVALID_OPERATION 0x0502
-#define GL_STACK_OVERFLOW 0x0503
-#define GL_STACK_UNDERFLOW 0x0504
-#define GL_OUT_OF_MEMORY 0x0505
+#define GL_NO_ERROR 0
+#define GL_INVALID_ENUM 0x0500
+#define GL_INVALID_VALUE 0x0501
+#define GL_INVALID_OPERATION 0x0502
+#define GL_STACK_OVERFLOW 0x0503
+#define GL_STACK_UNDERFLOW 0x0504
+#define GL_OUT_OF_MEMORY 0x0505
// Vladimir
-#define glVertex2i(x,y) glVertex3f(x,y,0.0)
+#define glVertex2i( x, y ) glVertex3f( x, y, 0.0 )
#define glTexCoord2d glTexCoord2f
#define glVertex3d glVertex3f
//#define glColor4ub(x,y,z,p) glColor4f(x,y,z,p) //nicknekit: wtf???
#define glFogi glFogf
//
-void glBegin(GLenum mode);
-void glEnd(void);
-void glEnable (GLenum cap);
-void glDisable (GLenum cap);
-void glVertex2f(GLfloat x, GLfloat y);
-void glColor3f( GLfloat red, GLfloat green, GLfloat blue);
-void glTexCoord2f(GLfloat s, GLfloat t);
-void glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
-void glLoadIdentity (void);
-void glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
-void glOrtho (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
-void glMatrixMode (GLenum mode);
-void glTexParameterf (GLenum target, GLenum pname, GLfloat param);
-void glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-void glDrawBuffer(GLenum mode);
-void glTranslatef (GLfloat x, GLfloat y, GLfloat z);
-void glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
-void glScalef (GLfloat x, GLfloat y, GLfloat z);
-void glDepthRange(GLclampf zNear, GLclampf zFar);
-void glDepthFunc (GLenum func);
-void glFinish (void);
-void glGetFloatv (GLenum pname, GLfloat *params);
-void glGetIntegerv (GLenum pname, GLint *params);
-void glCullFace (GLenum mode);
-void glFrustum (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
-void glClear (GLbitfield mask);
+void glBegin( GLenum mode );
+void glEnd( void );
+void glEnable( GLenum cap );
+void glDisable( GLenum cap );
+void glVertex2f( GLfloat x, GLfloat y );
+void glColor3f( GLfloat red, GLfloat green, GLfloat blue );
+void glTexCoord2f( GLfloat s, GLfloat t );
+void glViewport( GLint x, GLint y, GLsizei width, GLsizei height );
+void glLoadIdentity( void );
+void glColor4f( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha );
+void glOrtho( GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar );
+void glMatrixMode( GLenum mode );
+void glTexParameterf( GLenum target, GLenum pname, GLfloat param );
+void glTexImage2D( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels );
+void glDrawBuffer( GLenum mode );
+void glTranslatef( GLfloat x, GLfloat y, GLfloat z );
+void glRotatef( GLfloat angle, GLfloat x, GLfloat y, GLfloat z );
+void glScalef( GLfloat x, GLfloat y, GLfloat z );
+void glDepthRange( GLclampf zNear, GLclampf zFar );
+void glDepthFunc( GLenum func );
+void glFinish( void );
+void glGetFloatv( GLenum pname, GLfloat *params );
+void glGetIntegerv( GLenum pname, GLint *params );
+void glCullFace( GLenum mode );
+void glFrustum( GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar );
+void glClear( GLbitfield mask );
void glVertex3f( GLfloat x, GLfloat y, GLfloat z );
void glColor4fv( const GLfloat *v );
-void glHint (GLenum target, GLenum mode);
-void glBlendFunc (GLenum sfactor, GLenum dfactor);
-void glPopMatrix (void);
-void glShadeModel (GLenum mode);
-void glPushMatrix (void);
-void glTexEnvf (GLenum target, GLenum pname, GLfloat param);
+void glHint( GLenum target, GLenum mode );
+void glBlendFunc( GLenum sfactor, GLenum dfactor );
+void glPopMatrix( void );
+void glShadeModel( GLenum mode );
+void glPushMatrix( void );
+void glTexEnvf( GLenum target, GLenum pname, GLfloat param );
void glVertex3fv( const GLfloat *v );
-void glDepthMask (GLboolean flag);
-void glBindTexture (GLenum target, GLuint texture);
-const GLubyte* glGetString (GLenum name);
-void glAlphaFunc (GLenum func, GLclampf ref);
-void glFlush (void);
-void glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels);
+void glDepthMask( GLboolean flag );
+void glBindTexture( GLenum target, GLuint texture );
+const GLubyte *glGetString( GLenum name );
+void glAlphaFunc( GLenum func, GLclampf ref );
+void glFlush( void );
+void glReadPixels( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels );
void glReadBuffer( GLenum mode );
-void glLoadMatrixf (const GLfloat *m);
-void glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
-void glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
-GLenum glGetError (void);
-void glActiveTexture (GLenum texture);
-void glClientActiveTexture (GLenum texture);
-void glColor3ubv( const GLubyte* v);
+void glLoadMatrixf( const GLfloat *m );
+void glTexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels );
+void glClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha );
+GLenum glGetError( void );
+void glActiveTexture( GLenum texture );
+void glClientActiveTexture( GLenum texture );
+void glColor3ubv( const GLubyte *v );
void glPolygonMode( GLenum face, GLenum mode );
-void glArrayElement(GLint i);
-void glLineWidth(GLfloat width);
+void glArrayElement( GLint i );
+void glLineWidth( GLfloat width );
void glCallList( GLuint list );
void glTexCoord2fv( const GLfloat *v );
void glColorMask( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha );
void glDrawElements( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices );
void glEnableClientState( GLenum array );
-void glDisableClientState(GLenum array);
-void glVertexPointer( GLint size, GLenum type,GLsizei stride, const GLvoid *pointer );
-void glTexCoordPointer( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer );
-void glColorPointer( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer );
-void glPolygonOffset( GLfloat factor, GLfloat units );
+void glDisableClientState( GLenum array );
+void glVertexPointer( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer );
+void glTexCoordPointer( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer );
+void glColorPointer( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer );
+void glPolygonOffset( GLfloat factor, GLfloat units );
void glClearDepth( GLclampf depth );
-void glDeleteTextures( GLsizei n, const GLuint *textures );
-void glTexParameterfv( GLenum target, GLenum pname, const GLfloat * params);
+void glDeleteTextures( GLsizei n, const GLuint *textures );
+void glTexParameterfv( GLenum target, GLenum pname, const GLfloat *params );
void glStencilMask( GLuint mask );
void glClearStencil( GLint s );
-void glScissor( GLint x, GLint y, GLsizei width, GLsizei height );
+void glScissor( GLint x, GLint y, GLsizei width, GLsizei height );
void glClipPlane( GLenum plane, const GLdouble *equation );
void glColor3fv( const GLfloat *v );
void glPointSize( GLfloat size );
// Vladimir
-void glDrawArrays( GLenum mode, int first, int count);
-void glMultMatrixf (const GLfloat *m);
-void glPixelStorei (GLenum pname, GLint param);
-void glFogf (GLenum pname, GLfloat param);
-void glFogfv (GLenum pname, const GLfloat *params);
-void glGetTexParameteriv (GLenum target, GLenum pname, GLint *params);
-
-void glTexParameteri (GLenum target, GLenum pname, GLint param);
-void glTexParameterf (GLenum target, GLenum pname, GLfloat param);
-void glTexParameterx (GLenum target, GLenum pname, GLfixed param);
-void glGenTextures (GLsizei n, GLuint *textures);
-void glFrontFace (GLenum mode);
-
-
+void glDrawArrays( GLenum mode, int first, int count );
+void glMultMatrixf( const GLfloat *m );
+void glPixelStorei( GLenum pname, GLint param );
+void glFogf( GLenum pname, GLfloat param );
+void glFogfv( GLenum pname, const GLfloat *params );
+void glGetTexParameteriv( GLenum target, GLenum pname, GLint *params );
+
+void glTexParameteri( GLenum target, GLenum pname, GLint param );
+void glTexParameterf( GLenum target, GLenum pname, GLfloat param );
+void glTexParameterx( GLenum target, GLenum pname, GLfixed param );
+void glGenTextures( GLsizei n, GLuint *textures );
+void glFrontFace( GLenum mode );
//nicknekit: for xash3d
-void glColor3ub( GLubyte red, GLubyte green, GLubyte blue);
+void glColor3ub( GLubyte red, GLubyte green, GLubyte blue );
void glNormal3fv( const GLfloat *v );
void glCopyTexImage2D( GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border );
-void glTexImage1D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-void glTexImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+void glTexImage1D( GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels );
+void glTexImage3D( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels );
void glTexSubImage1D( GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels );
void glTexSubImage3D( GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLint zoffset, GLsizei width,
- GLsizei height, GLsizei depth,
- GLenum format,
- GLenum type, const GLvoid *pixels);
-GLboolean glIsTexture(GLuint texture);
+ GLint xoffset, GLint yoffset,
+ GLint zoffset, GLsizei width,
+ GLsizei height, GLsizei depth,
+ GLenum format,
+ GLenum type, const GLvoid *pixels );
+GLboolean glIsTexture( GLuint texture );
void glTexGeni( GLenum coord, GLenum pname, GLint param );
void glTexGenfv( GLenum coord, GLenum pname, const GLfloat *params );
-void glColor4ub( GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
+void glColor4ub( GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha );
// for XashXT
-void glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+void glCopyTexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height );
-void glTexEnvi(GLenum target, GLenum pname, GLint param);
+void glTexEnvi( GLenum target, GLenum pname, GLint param );
-void glBindFramebuffer(GLenum target, GLuint framebuffer);
-void glDeleteFramebuffers(GLsizei n, const GLuint *framebuffers);
-void glGenFramebuffers (GLsizei n, GLuint *framebuffers);
-GLenum glCheckFramebufferStatus(GLenum target);
+void glBindFramebuffer( GLenum target, GLuint framebuffer );
+void glDeleteFramebuffers( GLsizei n, const GLuint *framebuffers );
+void glGenFramebuffers( GLsizei n, GLuint *framebuffers );
+GLenum glCheckFramebufferStatus( GLenum target );
//GLboolean glIsRenderbuffer (GLuint renderbuffer);
-void glBindRenderbuffer (GLenum target, GLuint renderbuffer);
-void glDeleteRenderbuffers (GLsizei n, const GLuint *renderbuffers);
-void glGenRenderbuffers (GLsizei n, GLuint *renderbuffers);
-
-
-void glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+void glBindRenderbuffer( GLenum target, GLuint renderbuffer );
+void glDeleteRenderbuffers( GLsizei n, const GLuint *renderbuffers );
+void glGenRenderbuffers( GLsizei n, GLuint *renderbuffers );
+void glRenderbufferStorage( GLenum target, GLenum internalformat, GLsizei width, GLsizei height );
-void glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+void glFramebufferTexture2D( GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level );
-void glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+void glFramebufferRenderbuffer( GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer );
+void glNormalPointer( GLenum type, GLsizei stride, const void *ptr );
-void glNormalPointer(GLenum type, GLsizei stride, const void *ptr);
+void glMultiTexCoord3f( GLenum, GLfloat, GLfloat, GLfloat );
+void glMultiTexCoord3fARB( GLenum, GLfloat, GLfloat, GLfloat );
-void glMultiTexCoord3f(GLenum, GLfloat, GLfloat, GLfloat);
-void glMultiTexCoord3fARB(GLenum, GLfloat, GLfloat, GLfloat);
-
-void glMultiTexCoord2f(GLenum, GLfloat, GLfloat);
+void glMultiTexCoord2f( GLenum, GLfloat, GLfloat );
void glDrawArrays( GLenum mode, GLint first, GLsizei count );
}
#endif
-
#endif
diff --git a/GL/gl_entries.in b/GL/gl_entries.in
index 19220c2532bae8c7dd50f73eb71e4f898d6d5fac..250431c1dcfaf57e15b9e0c9f833e3dd3c435552 100644 (file)
--- a/GL/gl_entries.in
+++ b/GL/gl_entries.in
-//
- GL_ENTRY(int,eglChooseConfig,int dpy, const int *attrib_list, int *configs, int config_size, int *num_config)
- GL_ENTRY(int,eglCopyBuffers,int dpy, int surface, void* target)
- GL_ENTRY(int,eglCreateContext,int dpy, int config, int share_list, const int *attrib_list)
- GL_ENTRY(int,eglCreatePbufferSurface,int dpy, int config, const int *attrib_list)
- GL_ENTRY(int,eglCreatePixmapSurface,int dpy, int config, void* pixmap, const int *attrib_list)
- GL_ENTRY(int,eglCreateWindowSurface,int dpy, int config, void* window, const int *attrib_list)
- GL_ENTRY(int,eglDestroyContext,int dpy, int ctx)
- GL_ENTRY(int,eglDestroySurface,int dpy, int surface)
- GL_ENTRY(int,eglGetConfigAttrib,int dpy, int config, int attribute, int *value)
- GL_ENTRY(int,eglGetConfigs,int dpy, int *configs, int config_size, int *num_config)
- GL_ENTRY(int,eglGetCurrentContext,void)
- GL_ENTRY(int,eglGetCurrentDisplay,void)
- GL_ENTRY(int,eglGetCurrentSurface,int readdraw)
- GL_ENTRY(int,eglGetDisplay,int display)
- GL_ENTRY(int,eglGetError,void)
+//
+GL_ENTRY( int, eglChooseConfig, int dpy, const int *attrib_list, int *configs, int config_size, int *num_config )
+GL_ENTRY( int, eglCopyBuffers, int dpy, int surface, void *target )
+GL_ENTRY( int, eglCreateContext, int dpy, int config, int share_list, const int *attrib_list )
+GL_ENTRY( int, eglCreatePbufferSurface, int dpy, int config, const int *attrib_list )
+GL_ENTRY( int, eglCreatePixmapSurface, int dpy, int config, void *pixmap, const int *attrib_list )
+GL_ENTRY( int, eglCreateWindowSurface, int dpy, int config, void *window, const int *attrib_list )
+GL_ENTRY( int, eglDestroyContext, int dpy, int ctx )
+GL_ENTRY( int, eglDestroySurface, int dpy, int surface )
+GL_ENTRY( int, eglGetConfigAttrib, int dpy, int config, int attribute, int *value )
+GL_ENTRY( int, eglGetConfigs, int dpy, int *configs, int config_size, int *num_config )
+GL_ENTRY( int, eglGetCurrentContext, void )
+GL_ENTRY( int, eglGetCurrentDisplay, void )
+GL_ENTRY( int, eglGetCurrentSurface, int readdraw )
+GL_ENTRY( int, eglGetDisplay, int display )
+GL_ENTRY( int, eglGetError, void )
- GL_ENTRY(void, eglGetProcAddress,const char *procname)
+GL_ENTRY( void, eglGetProcAddress, const char *procname )
- GL_ENTRY(int,eglInitialize,int dpy, int *major, int *minor)
- GL_ENTRY(int,eglMakeCurrent,int dpy, int draw, int read, int ctx)
- GL_ENTRY(int,eglQueryContext,int dpy, int ctx, int attribute, int *value)
- GL_ENTRY(const char * ,eglQueryString,int dpy, int name)
- GL_ENTRY(int,eglQuerySurface,int dpy, int surface, int attribute, int *value)
- GL_ENTRY(int,eglSwapBuffers,int dpy, int draw)
- GL_ENTRY(int,eglTerminate,int dpy)
- GL_ENTRY(int,eglWaitGL,void)
- GL_ENTRY(int,eglWaitNative,int engine)
+GL_ENTRY( int, eglInitialize, int dpy, int *major, int *minor )
+GL_ENTRY( int, eglMakeCurrent, int dpy, int draw, int read, int ctx )
+GL_ENTRY( int, eglQueryContext, int dpy, int ctx, int attribute, int *value )
+GL_ENTRY( const char *, eglQueryString, int dpy, int name )
+GL_ENTRY( int, eglQuerySurface, int dpy, int surface, int attribute, int *value )
+GL_ENTRY( int, eglSwapBuffers, int dpy, int draw )
+GL_ENTRY( int, eglTerminate, int dpy )
+GL_ENTRY( int, eglWaitGL, void )
+GL_ENTRY( int, eglWaitNative, int engine )
// GL
- GL_ENTRY(void,glActiveTexture,unsigned int texture)
- GL_ENTRY(void,glAlphaFunc,unsigned int func, float ref)
- GL_ENTRY(void,glAlphaFuncx,unsigned int func, int ref)
- GL_ENTRY(void,glBindTexture,unsigned int target, unsigned int texture)
- GL_ENTRY(void,glBlendFunc,unsigned int sfactor, unsigned int dfactor)
- GL_ENTRY(void,glClear,unsigned int mask)
- GL_ENTRY(void,glClearColor,float red, float green, float blue, float alpha)
- GL_ENTRY(void,glClearColorx,int red, int green, int blue, int alpha)
- GL_ENTRY(void,glClearDepthf,float depth)
- GL_ENTRY(void,glClearDepthx,int depth)
- GL_ENTRY(void,glClearStencil,int s)
- GL_ENTRY(void,glClientActiveTexture,unsigned int texture)
- GL_ENTRY(void,glColor4f,float red, float green, float blue, float alpha)
- GL_ENTRY(void,glColor4x,int red, int green, int blue, int alpha)
- GL_ENTRY(void,glColorMask,unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha)
- GL_ENTRY(void,glColorPointer,int size, unsigned int type, int stride, const void *pointer)
- GL_ENTRY(void,glCompressedTexImage2D,unsigned int target, int level, unsigned int internalformat, int width, int height, int border, int imageSize, const void *data)
- GL_ENTRY(void,glCompressedTexSubImage2D,unsigned int target, int level, int xoffset, int yoffset, int width, int height, unsigned int format, int imageSize, const void *data)
- GL_ENTRY(void,glCopyTexImage2D,unsigned int target, int level, unsigned int internalformat, int x, int y, int width, int height, int border)
- GL_ENTRY(void,glCopyTexSubImage2D,unsigned int target, int level, int xoffset, int yoffset, int x, int y, int width, int height)
- GL_ENTRY(void,glCullFace,unsigned int mode)
- GL_ENTRY(void,glDeleteTextures,int n, const unsigned int *textures)
- GL_ENTRY(void,glDepthFunc,unsigned int func)
- GL_ENTRY(void,glDepthMask,unsigned char flag)
- GL_ENTRY(void,glDepthRangef,float zNear, float zFar)
- GL_ENTRY(void,glDepthRangex,int zNear, int zFar)
- GL_ENTRY(void,glDisable,unsigned int cap)
- GL_ENTRY(void,glDisableClientState,unsigned int array)
- GL_ENTRY(void,glDrawArrays,unsigned int mode, int first, int count)
- GL_ENTRY(void,glDrawElements,unsigned int mode, int count, unsigned int type, const void *indices)
- GL_ENTRY(void,glEnable,unsigned int cap)
- GL_ENTRY(void,glEnableClientState,unsigned int array)
- GL_ENTRY(void,glFinish,void)
- GL_ENTRY(void,glFlush,void)
- GL_ENTRY(void,glFogf,unsigned int pname, float param)
- GL_ENTRY(void,glFogfv,unsigned int pname, const float *params)
- GL_ENTRY(void,glFogx,unsigned int pname, int param)
- GL_ENTRY(void,glFogxv,unsigned int pname, const int *params)
- GL_ENTRY(void,glFrontFace,unsigned int mode)
- GL_ENTRY(void,glFrustumf,float left, float right, float bottom, float top, float zNear, float zFar)
- GL_ENTRY(void,glFrustumx,int left, int right, int bottom, int top, int zNear, int zFar)
- GL_ENTRY(void,glGenTextures,int n, unsigned int *textures)
- GL_ENTRY(unsigned int , glGetError,void)
- GL_ENTRY(void,glGetIntegerv,unsigned int pname, int *params)
- GL_ENTRY(const unsigned char * , glGetString,unsigned int name)
- GL_ENTRY(void,glHint,unsigned int target, unsigned int mode)
- GL_ENTRY(void,glLightModelf,unsigned int pname, float param)
- GL_ENTRY(void,glLightModelfv,unsigned int pname, const float *params)
- GL_ENTRY(void,glLightModelx,unsigned int pname, int param)
- GL_ENTRY(void,glLightModelxv,unsigned int pname, const int *params)
- GL_ENTRY(void,glLightf,unsigned int light, unsigned int pname, float param)
- GL_ENTRY(void,glLightfv,unsigned int light, unsigned int pname, const float *params)
- GL_ENTRY(void,glLightx,unsigned int light, unsigned int pname, int param)
- GL_ENTRY(void,glLightxv,unsigned int light, unsigned int pname, const int *params)
- GL_ENTRY(void,glLineWidth,float width)
- GL_ENTRY(void,glLineWidthx,int width)
- GL_ENTRY(void,glLoadIdentity,void)
- GL_ENTRY(void,glLoadMatrixf,const float *m)
- GL_ENTRY(void,glLoadMatrixx,const int *m)
- GL_ENTRY(void,glLogicOp,unsigned int opcode)
- GL_ENTRY(void,glMaterialf,unsigned int face, unsigned int pname, float param)
- GL_ENTRY(void,glMaterialfv,unsigned int face, unsigned int pname, const float *params)
- GL_ENTRY(void,glMaterialx,unsigned int face, unsigned int pname, int param)
- GL_ENTRY(void,glMaterialxv,unsigned int face, unsigned int pname, const int *params)
- GL_ENTRY(void,glMatrixMode,unsigned int mode)
- GL_ENTRY(void,glMultMatrixf,const float *m)
- GL_ENTRY(void,glMultMatrixx,const int *m)
- GL_ENTRY(void,glMultiTexCoord4f,unsigned int target, float s, float t, float r, float q)
- GL_ENTRY(void,glMultiTexCoord4x,unsigned int target, int s, int t, int r, int q)
- GL_ENTRY(void,glNormal3f,float nx, float ny, float nz)
- GL_ENTRY(void,glNormal3x,int nx, int ny, int nz)
- GL_ENTRY(void,glNormalPointer,unsigned int type, int stride, const void *pointer)
- GL_ENTRY(void,glOrthof,float left, float right, float bottom, float top, float zNear, float zFar)
- GL_ENTRY(void,glOrthox,int left, int right, int bottom, int top, int zNear, int zFar)
- GL_ENTRY(void,glPixelStorei,unsigned int pname, int param)
- GL_ENTRY(void,glPointSize,float size)
- GL_ENTRY(void,glPointSizex,int size)
- GL_ENTRY(void,glPolygonOffset,float factor, float units)
- GL_ENTRY(void,glPolygonOffsetx,int factor, int units)
- GL_ENTRY(void,glPopMatrix,void)
- GL_ENTRY(void,glPushMatrix,void)
- GL_ENTRY(unsigned int , glQueryMatrixxOES,int mantissa[16], int exponent[16])
- GL_ENTRY(void,glReadPixels,int x, int y, int width, int height, unsigned int format, unsigned int type, void *pixels)
- GL_ENTRY(void,glRotatef,float angle, float x, float y, float z)
- GL_ENTRY(void,glRotatex,int angle, int x, int y, int z)
- GL_ENTRY(void,glSampleCoverage,float value, unsigned char invert)
- GL_ENTRY(void,glSampleCoveragex,int value, unsigned char invert)
- GL_ENTRY(void,glScalef,float x, float y, float z)
- GL_ENTRY(void,glScalex,int x, int y, int z)
- GL_ENTRY(void,glScissor,int x, int y, int width, int height)
- GL_ENTRY(void,glShadeModel,unsigned int mode)
- GL_ENTRY(void,glStencilFunc,unsigned int func, int ref, unsigned int mask)
- GL_ENTRY(void,glStencilMask,unsigned int mask)
- GL_ENTRY(void,glStencilOp,unsigned int fail, unsigned int zfail, unsigned int zpass)
- GL_ENTRY(void,glTexCoordPointer,int size, unsigned int type, int stride, const void *pointer)
- GL_ENTRY(void,glTexEnvf,unsigned int target, unsigned int pname, float param)
- GL_ENTRY(void,glTexEnvfv,unsigned int target, unsigned int pname, const float *params)
- GL_ENTRY(void,glTexEnvx,unsigned int target, unsigned int pname, int param)
- GL_ENTRY(void,glTexEnvxv,unsigned int target, unsigned int pname, const int *params)
- GL_ENTRY(void,glTexImage2D,unsigned int target, int level, int internalformat, int width, int height, int border, unsigned int format, unsigned int type, const void *pixels)
- GL_ENTRY(void,glTexParameterf,unsigned int target, unsigned int pname, float param)
- GL_ENTRY(void,glTexParameterx,unsigned int target, unsigned int pname, int param)
- GL_ENTRY(void,glTexSubImage2D,unsigned int target, int level, int xoffset, int yoffset, int width, int height, unsigned int format, unsigned int type, const void *pixels)
- GL_ENTRY(void,glTranslatef,float x, float y, float z)
- GL_ENTRY(void,glTranslatex,int x, int y, int z)
- GL_ENTRY(void,glVertexPointer,int size, unsigned int type, int stride, const void *pointer)
- GL_ENTRY(void,glViewport,int x, int y, int width, int height)
- GL_ENTRY(int , eglSwapInterval,int dpy, int interval)
- GL_ENTRY(void,glBindBuffer,unsigned int target, unsigned int buffer)
- GL_ENTRY(void,glBufferData,unsigned int target, int size, const void *data, unsigned int usage)
- GL_ENTRY(void,glBufferSubData,unsigned int target, int offset,int size, const void *data)
- GL_ENTRY(void,glClipPlanef,unsigned int plane, const float *equation)
- GL_ENTRY(void,glClipPlanex,unsigned int plane, const int *equation)
- GL_ENTRY(void,glColor4ub,unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha)
- GL_ENTRY(void,glDeleteBuffers,int n, const unsigned int *buffers)
- GL_ENTRY(void,glGenBuffers,int n, unsigned int *buffers)
- GL_ENTRY(void,glGetBooleanv,unsigned int pname, unsigned char *params)
- GL_ENTRY(void,glGetBufferParameteriv,unsigned int target, unsigned int pname, int *params)
- GL_ENTRY(void,glGetClipPlanef,unsigned int pname, float eqn[4])
- GL_ENTRY(void,glGetClipPlanex,unsigned int pname, int eqn[4])
- GL_ENTRY(void,glGetFixedv,unsigned int pname, int *params)
- GL_ENTRY(void,glGetFloatv,unsigned int pname, float *params)
- GL_ENTRY(void,glGetLightfv,unsigned int light, unsigned int pname, float *params)
- GL_ENTRY(void,glGetLightxv,unsigned int light, unsigned int pname, int *params)
- GL_ENTRY(void,glGetMaterialfv,unsigned int face, unsigned int pname, float *params)
- GL_ENTRY(void,glGetMaterialxv,unsigned int face, unsigned int pname, int *params)
- GL_ENTRY(void,glGetPointerv,unsigned int pname, void **params)
- GL_ENTRY(void,glGetTexEnvfv,unsigned int env, unsigned int pname, float *params)
- GL_ENTRY(void,glGetTexEnviv,unsigned int env, unsigned int pname, int *params)
- GL_ENTRY(void,glGetTexEnvxv,unsigned int env, unsigned int pname, int *params)
- GL_ENTRY(void,glGetTexParameterfv,unsigned int target, unsigned int pname, float *params)
- GL_ENTRY(void,glGetTexParameteriv,unsigned int target, unsigned int pname, int *params)
- GL_ENTRY(void,glGetTexParameterxv,unsigned int target, unsigned int pname, int *params)
- GL_ENTRY(unsigned char ,glIsBuffer,unsigned int buffer)
- GL_ENTRY(unsigned char ,glIsEnabled,unsigned int cap)
- GL_ENTRY(unsigned char ,glIsTexture,unsigned int texture)
- GL_ENTRY(void,glPointParameterf,unsigned int pname, float param)
- GL_ENTRY(void,glPointParameterfv,unsigned int pname, const float *params)
- GL_ENTRY(void,glPointParameterx,unsigned int pname, int param)
- GL_ENTRY(void,glPointParameterxv,unsigned int pname, const int *params)
- GL_ENTRY(void,glPointSizePointerOES,unsigned int type, int stride, const void *pointer)
- GL_ENTRY(void,glTexEnvi,unsigned int target, unsigned int pname, int param)
- GL_ENTRY(void,glTexEnviv,unsigned int target, unsigned int pname, const int *params)
- GL_ENTRY(void,glTexParameterfv,unsigned int target, unsigned int pname, const float *params)
- GL_ENTRY(void,glTexParameteri,unsigned int target, unsigned int pname, int param)
- GL_ENTRY(void,glTexParameteriv,unsigned int target, unsigned int pname, const int *params)
- GL_ENTRY(void,glTexParameterxv,unsigned int target, unsigned int pname, const int *params)
+GL_ENTRY( void, glActiveTexture, unsigned int texture )
+GL_ENTRY( void, glAlphaFunc, unsigned int func, float ref )
+GL_ENTRY( void, glAlphaFuncx, unsigned int func, int ref )
+GL_ENTRY( void, glBindTexture, unsigned int target, unsigned int texture )
+GL_ENTRY( void, glBlendFunc, unsigned int sfactor, unsigned int dfactor )
+GL_ENTRY( void, glClear, unsigned int mask )
+GL_ENTRY( void, glClearColor, float red, float green, float blue, float alpha )
+GL_ENTRY( void, glClearColorx, int red, int green, int blue, int alpha )
+GL_ENTRY( void, glClearDepthf, float depth )
+GL_ENTRY( void, glClearDepthx, int depth )
+GL_ENTRY( void, glClearStencil, int s )
+GL_ENTRY( void, glClientActiveTexture, unsigned int texture )
+GL_ENTRY( void, glColor4f, float red, float green, float blue, float alpha )
+GL_ENTRY( void, glColor4x, int red, int green, int blue, int alpha )
+GL_ENTRY( void, glColorMask, unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha )
+GL_ENTRY( void, glColorPointer, int size, unsigned int type, int stride, const void *pointer )
+GL_ENTRY( void, glCompressedTexImage2D, unsigned int target, int level, unsigned int internalformat, int width, int height, int border, int imageSize, const void *data )
+GL_ENTRY( void, glCompressedTexSubImage2D, unsigned int target, int level, int xoffset, int yoffset, int width, int height, unsigned int format, int imageSize, const void *data )
+GL_ENTRY( void, glCopyTexImage2D, unsigned int target, int level, unsigned int internalformat, int x, int y, int width, int height, int border )
+GL_ENTRY( void, glCopyTexSubImage2D, unsigned int target, int level, int xoffset, int yoffset, int x, int y, int width, int height )
+GL_ENTRY( void, glCullFace, unsigned int mode )
+GL_ENTRY( void, glDeleteTextures, int n, const unsigned int *textures )
+GL_ENTRY( void, glDepthFunc, unsigned int func )
+GL_ENTRY( void, glDepthMask, unsigned char flag )
+GL_ENTRY( void, glDepthRangef, float zNear, float zFar )
+GL_ENTRY( void, glDepthRangex, int zNear, int zFar )
+GL_ENTRY( void, glDisable, unsigned int cap )
+GL_ENTRY( void, glDisableClientState, unsigned int array )
+GL_ENTRY( void, glDrawArrays, unsigned int mode, int first, int count )
+GL_ENTRY( void, glDrawElements, unsigned int mode, int count, unsigned int type, const void *indices )
+GL_ENTRY( void, glEnable, unsigned int cap )
+GL_ENTRY( void, glEnableClientState, unsigned int array )
+GL_ENTRY( void, glFinish, void )
+GL_ENTRY( void, glFlush, void )
+GL_ENTRY( void, glFogf, unsigned int pname, float param )
+GL_ENTRY( void, glFogfv, unsigned int pname, const float *params )
+GL_ENTRY( void, glFogx, unsigned int pname, int param )
+GL_ENTRY( void, glFogxv, unsigned int pname, const int *params )
+GL_ENTRY( void, glFrontFace, unsigned int mode )
+GL_ENTRY( void, glFrustumf, float left, float right, float bottom, float top, float zNear, float zFar )
+GL_ENTRY( void, glFrustumx, int left, int right, int bottom, int top, int zNear, int zFar )
+GL_ENTRY( void, glGenTextures, int n, unsigned int *textures )
+GL_ENTRY( unsigned int, glGetError, void )
+GL_ENTRY( void, glGetIntegerv, unsigned int pname, int *params )
+GL_ENTRY( const unsigned char *, glGetString, unsigned int name )
+GL_ENTRY( void, glHint, unsigned int target, unsigned int mode )
+GL_ENTRY( void, glLightModelf, unsigned int pname, float param )
+GL_ENTRY( void, glLightModelfv, unsigned int pname, const float *params )
+GL_ENTRY( void, glLightModelx, unsigned int pname, int param )
+GL_ENTRY( void, glLightModelxv, unsigned int pname, const int *params )
+GL_ENTRY( void, glLightf, unsigned int light, unsigned int pname, float param )
+GL_ENTRY( void, glLightfv, unsigned int light, unsigned int pname, const float *params )
+GL_ENTRY( void, glLightx, unsigned int light, unsigned int pname, int param )
+GL_ENTRY( void, glLightxv, unsigned int light, unsigned int pname, const int *params )
+GL_ENTRY( void, glLineWidth, float width )
+GL_ENTRY( void, glLineWidthx, int width )
+GL_ENTRY( void, glLoadIdentity, void )
+GL_ENTRY( void, glLoadMatrixf, const float *m )
+GL_ENTRY( void, glLoadMatrixx, const int *m )
+GL_ENTRY( void, glLogicOp, unsigned int opcode )
+GL_ENTRY( void, glMaterialf, unsigned int face, unsigned int pname, float param )
+GL_ENTRY( void, glMaterialfv, unsigned int face, unsigned int pname, const float *params )
+GL_ENTRY( void, glMaterialx, unsigned int face, unsigned int pname, int param )
+GL_ENTRY( void, glMaterialxv, unsigned int face, unsigned int pname, const int *params )
+GL_ENTRY( void, glMatrixMode, unsigned int mode )
+GL_ENTRY( void, glMultMatrixf, const float *m )
+GL_ENTRY( void, glMultMatrixx, const int *m )
+GL_ENTRY( void, glMultiTexCoord4f, unsigned int target, float s, float t, float r, float q )
+GL_ENTRY( void, glMultiTexCoord4x, unsigned int target, int s, int t, int r, int q )
+GL_ENTRY( void, glNormal3f, float nx, float ny, float nz )
+GL_ENTRY( void, glNormal3x, int nx, int ny, int nz )
+GL_ENTRY( void, glNormalPointer, unsigned int type, int stride, const void *pointer )
+GL_ENTRY( void, glOrthof, float left, float right, float bottom, float top, float zNear, float zFar )
+GL_ENTRY( void, glOrthox, int left, int right, int bottom, int top, int zNear, int zFar )
+GL_ENTRY( void, glPixelStorei, unsigned int pname, int param )
+GL_ENTRY( void, glPointSize, float size )
+GL_ENTRY( void, glPointSizex, int size )
+GL_ENTRY( void, glPolygonOffset, float factor, float units )
+GL_ENTRY( void, glPolygonOffsetx, int factor, int units )
+GL_ENTRY( void, glPopMatrix, void )
+GL_ENTRY( void, glPushMatrix, void )
+GL_ENTRY( unsigned int, glQueryMatrixxOES, int mantissa[16], int exponent[16] )
+GL_ENTRY( void, glReadPixels, int x, int y, int width, int height, unsigned int format, unsigned int type, void *pixels )
+GL_ENTRY( void, glRotatef, float angle, float x, float y, float z )
+GL_ENTRY( void, glRotatex, int angle, int x, int y, int z )
+GL_ENTRY( void, glSampleCoverage, float value, unsigned char invert )
+GL_ENTRY( void, glSampleCoveragex, int value, unsigned char invert )
+GL_ENTRY( void, glScalef, float x, float y, float z )
+GL_ENTRY( void, glScalex, int x, int y, int z )
+GL_ENTRY( void, glScissor, int x, int y, int width, int height )
+GL_ENTRY( void, glShadeModel, unsigned int mode )
+GL_ENTRY( void, glStencilFunc, unsigned int func, int ref, unsigned int mask )
+GL_ENTRY( void, glStencilMask, unsigned int mask )
+GL_ENTRY( void, glStencilOp, unsigned int fail, unsigned int zfail, unsigned int zpass )
+GL_ENTRY( void, glTexCoordPointer, int size, unsigned int type, int stride, const void *pointer )
+GL_ENTRY( void, glTexEnvf, unsigned int target, unsigned int pname, float param )
+GL_ENTRY( void, glTexEnvfv, unsigned int target, unsigned int pname, const float *params )
+GL_ENTRY( void, glTexEnvx, unsigned int target, unsigned int pname, int param )
+GL_ENTRY( void, glTexEnvxv, unsigned int target, unsigned int pname, const int *params )
+GL_ENTRY( void, glTexImage2D, unsigned int target, int level, int internalformat, int width, int height, int border, unsigned int format, unsigned int type, const void *pixels )
+GL_ENTRY( void, glTexParameterf, unsigned int target, unsigned int pname, float param )
+GL_ENTRY( void, glTexParameterx, unsigned int target, unsigned int pname, int param )
+GL_ENTRY( void, glTexSubImage2D, unsigned int target, int level, int xoffset, int yoffset, int width, int height, unsigned int format, unsigned int type, const void *pixels )
+GL_ENTRY( void, glTranslatef, float x, float y, float z )
+GL_ENTRY( void, glTranslatex, int x, int y, int z )
+GL_ENTRY( void, glVertexPointer, int size, unsigned int type, int stride, const void *pointer )
+GL_ENTRY( void, glViewport, int x, int y, int width, int height )
+GL_ENTRY( int, eglSwapInterval, int dpy, int interval )
+GL_ENTRY( void, glBindBuffer, unsigned int target, unsigned int buffer )
+GL_ENTRY( void, glBufferData, unsigned int target, int size, const void *data, unsigned int usage )
+GL_ENTRY( void, glBufferSubData, unsigned int target, int offset, int size, const void *data )
+GL_ENTRY( void, glClipPlanef, unsigned int plane, const float *equation )
+GL_ENTRY( void, glClipPlanex, unsigned int plane, const int *equation )
+GL_ENTRY( void, glColor4ub, unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha )
+GL_ENTRY( void, glDeleteBuffers, int n, const unsigned int *buffers )
+GL_ENTRY( void, glGenBuffers, int n, unsigned int *buffers )
+GL_ENTRY( void, glGetBooleanv, unsigned int pname, unsigned char *params )
+GL_ENTRY( void, glGetBufferParameteriv, unsigned int target, unsigned int pname, int *params )
+GL_ENTRY( void, glGetClipPlanef, unsigned int pname, float eqn[4] )
+GL_ENTRY( void, glGetClipPlanex, unsigned int pname, int eqn[4] )
+GL_ENTRY( void, glGetFixedv, unsigned int pname, int *params )
+GL_ENTRY( void, glGetFloatv, unsigned int pname, float *params )
+GL_ENTRY( void, glGetLightfv, unsigned int light, unsigned int pname, float *params )
+GL_ENTRY( void, glGetLightxv, unsigned int light, unsigned int pname, int *params )
+GL_ENTRY( void, glGetMaterialfv, unsigned int face, unsigned int pname, float *params )
+GL_ENTRY( void, glGetMaterialxv, unsigned int face, unsigned int pname, int *params )
+GL_ENTRY( void, glGetPointerv, unsigned int pname, void **params )
+GL_ENTRY( void, glGetTexEnvfv, unsigned int env, unsigned int pname, float *params )
+GL_ENTRY( void, glGetTexEnviv, unsigned int env, unsigned int pname, int *params )
+GL_ENTRY( void, glGetTexEnvxv, unsigned int env, unsigned int pname, int *params )
+GL_ENTRY( void, glGetTexParameterfv, unsigned int target, unsigned int pname, float *params )
+GL_ENTRY( void, glGetTexParameteriv, unsigned int target, unsigned int pname, int *params )
+GL_ENTRY( void, glGetTexParameterxv, unsigned int target, unsigned int pname, int *params )
+GL_ENTRY( unsigned char, glIsBuffer, unsigned int buffer )
+GL_ENTRY( unsigned char, glIsEnabled, unsigned int cap )
+GL_ENTRY( unsigned char, glIsTexture, unsigned int texture )
+GL_ENTRY( void, glPointParameterf, unsigned int pname, float param )
+GL_ENTRY( void, glPointParameterfv, unsigned int pname, const float *params )
+GL_ENTRY( void, glPointParameterx, unsigned int pname, int param )
+GL_ENTRY( void, glPointParameterxv, unsigned int pname, const int *params )
+GL_ENTRY( void, glPointSizePointerOES, unsigned int type, int stride, const void *pointer )
+GL_ENTRY( void, glTexEnvi, unsigned int target, unsigned int pname, int param )
+GL_ENTRY( void, glTexEnviv, unsigned int target, unsigned int pname, const int *params )
+GL_ENTRY( void, glTexParameterfv, unsigned int target, unsigned int pname, const float *params )
+GL_ENTRY( void, glTexParameteri, unsigned int target, unsigned int pname, int param )
+GL_ENTRY( void, glTexParameteriv, unsigned int target, unsigned int pname, const int *params )
+GL_ENTRY( void, glTexParameterxv, unsigned int target, unsigned int pname, const int *params )
// EGL EXT
- GL_ENTRY(int,eglBindTexImage,int dpy, int surface, int buffer)
- GL_ENTRY(int,eglReleaseTexImage,int dpy, int surface, int buffer)
- GL_ENTRY(int,eglSurfaceAttrib,int dpy, int surface, int attribute, int value)
+GL_ENTRY( int, eglBindTexImage, int dpy, int surface, int buffer )
+GL_ENTRY( int, eglReleaseTexImage, int dpy, int surface, int buffer )
+GL_ENTRY( int, eglSurfaceAttrib, int dpy, int surface, int attribute, int value )
#ifdef USE_CORE_PROFILE
- GL_ENTRY(void,glOrtho,double left, double right, double bottom, double top, double zNear, double zFar)
- GL_ENTRY(void,glDepthRange,double zNear, double zFar)
+GL_ENTRY( void, glOrtho, double left, double right, double bottom, double top, double zNear, double zFar )
+GL_ENTRY( void, glDepthRange, double zNear, double zFar )
#endif
// fbo
-GL_ENTRY(void,glGenFramebuffersOES, GLsizei n, GLuint* framebuffers)
-GL_ENTRY(void,glGenRenderbuffersOES, GLsizei n, GLuint* renderbuffers)
-GL_ENTRY(void,glRenderbufferStorageOES, GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
-GL_ENTRY(void,glBindFramebufferOES, GLenum target, GLuint framebuffer)
-GL_ENTRY(void,glBindRenderbufferOES, GLenum target, GLuint renderbuffer)
-GL_ENTRY(void,glFramebufferTexture2DOES, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
-GL_ENTRY(void,glDeleteRenderbuffersOES, GLsizei n, const GLuint* renderbuffers)
-GL_ENTRY(void,glDeleteFramebuffersOES, GLsizei n, const GLuint* framebuffers)
-GL_ENTRY(void,glFramebufferRenderbufferOES, GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
+GL_ENTRY( void, glGenFramebuffersOES, GLsizei n, GLuint *framebuffers )
+GL_ENTRY( void, glGenRenderbuffersOES, GLsizei n, GLuint *renderbuffers )
+GL_ENTRY( void, glRenderbufferStorageOES, GLenum target, GLenum internalformat, GLsizei width, GLsizei height )
+GL_ENTRY( void, glBindFramebufferOES, GLenum target, GLuint framebuffer )
+GL_ENTRY( void, glBindRenderbufferOES, GLenum target, GLuint renderbuffer )
+GL_ENTRY( void, glFramebufferTexture2DOES, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level )
+GL_ENTRY( void, glDeleteRenderbuffersOES, GLsizei n, const GLuint *renderbuffers )
+GL_ENTRY( void, glDeleteFramebuffersOES, GLsizei n, const GLuint *framebuffers )
+GL_ENTRY( void, glFramebufferRenderbufferOES, GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer )
diff --git a/GL/glesinterface.h b/GL/glesinterface.h
index 0003ef690d16a56c30b0c8a0e77f3b9217a34272..8231fda870bb45aacf681f01954a2e7d57b1201c 100644 (file)
--- a/GL/glesinterface.h
+++ b/GL/glesinterface.h
#ifndef __GLESINTERFACE_H__
#define __GLESINTERFACE_H__
-
-#if !defined (__WINS__)
- #if defined(__TARGET_FPU_VFP)
- #pragma softfp_linkage
- #endif
+#if !defined( __WINS__ )
+#if defined( __TARGET_FPU_VFP )
+#pragma softfp_linkage
+#endif
#endif
#ifdef SOFTFP_LINK
-#define S __attribute__((pcs("aapcs")))
+#define S __attribute__( ( pcs( "aapcs" ) ) )
#else
#define S
#endif
#endif
struct GlESInterface
- {
- int (*eglChooseConfig) (int dpy, const int *attrib_list, int *configs, int config_size, int *num_config) S;
- int (*eglCopyBuffers) (int dpy, int surface, void* target) S;
- int (*eglCreateContext) (int dpy, int config, int share_list, const int *attrib_list) S;
- int (*eglCreatePbufferSurface) (int dpy, int config, const int *attrib_list) S;
- int (*eglCreatePixmapSurface) (int dpy, int config, void* pixmap, const int *attrib_list) S;
- int (*eglCreateWindowSurface) (int dpy, int config, void* window, const int *attrib_list) S;
- int (*eglDestroyContext) (int dpy, int ctx) S;
- int (*eglDestroySurface) (int dpy, int surface) S;
- int (*eglGetConfigAttrib) (int dpy, int config, int attribute, int *value) S;
- int (*eglGetConfigs) (int dpy, int *configs, int config_size, int *num_config) S;
- int (*eglGetCurrentContext) (void) S;
- int (*eglGetCurrentDisplay) (void) S;
- int (*eglGetCurrentSurface) (int readdraw) S;
- int (*eglGetDisplay) (int display) S;
- int (*eglGetError) (void) S;
-
- void (*(*eglGetProcAddress) (const char *procname))(...) S;
-
- int (*eglInitialize) (int dpy, int *major, int *minor) S;
- int (*eglMakeCurrent) (int dpy, int draw, int read, int ctx) S;
- int (*eglQueryContext) (int dpy, int ctx, int attribute, int *value) S;
- const char * (*eglQueryString) (int dpy, int name) S;
- int (*eglQuerySurface) (int dpy, int surface, int attribute, int *value) S;
- int (*eglSwapBuffers) (int dpy, int draw) S;
- int (*eglTerminate) (int dpy) S;
- int (*eglWaitGL) (void) S;
- int (*eglWaitNative) (int engine) S;
- void ( APIENTRY *glActiveTexture) (unsigned int texture) S;
- void ( APIENTRY *glAlphaFunc) (unsigned int func, float ref) S;
- void ( APIENTRY *glAlphaFuncx) (unsigned int func, int ref) S;
- void ( APIENTRY *glBindTexture) (unsigned int target, unsigned int texture) S;
- void ( APIENTRY *glBlendFunc) (unsigned int sfactor, unsigned int dfactor) S;
- void ( APIENTRY *glClear) (unsigned int mask) S;
- void ( APIENTRY *glClearColor) (float red, float green, float blue, float alpha) S;
- void ( APIENTRY *glClearColorx) (int red, int green, int blue, int alpha) S;
- void ( APIENTRY *glClearDepthf) (float depth) S;
- void ( APIENTRY *glClearDepthx) (int depth) S;
- void ( APIENTRY *glClearStencil) (int s) S;
- void ( APIENTRY *glClientActiveTexture) (unsigned int texture) S;
- void ( APIENTRY *glColor4f) (float red, float green, float blue, float alpha) S;
- void ( APIENTRY *glColor4x) (int red, int green, int blue, int alpha) S;
- void ( APIENTRY *glColorMask) (unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha) S;
- void ( APIENTRY *glColorPointer) (int size, unsigned int type, int stride, const void *pointer) S;
- void ( APIENTRY *glCompressedTexImage2D) (unsigned int target, int level, unsigned int internalformat, int width, int height, int border, int imageSize, const void *data) S;
- void ( APIENTRY *glCompressedTexSubImage2D) (unsigned int target, int level, int xoffset, int yoffset, int width, int height, unsigned int format, int imageSize, const void *data) S;
- void ( APIENTRY *glCopyTexImage2D) (unsigned int target, int level, unsigned int internalformat, int x, int y, int width, int height, int border) S;
- void ( APIENTRY *glCopyTexSubImage2D) (unsigned int target, int level, int xoffset, int yoffset, int x, int y, int width, int height) S;
- void ( APIENTRY *glCullFace) (unsigned int mode) S;
- void ( APIENTRY *glDeleteTextures) (int n, const unsigned int *textures) S;
- void ( APIENTRY *glDepthFunc) (unsigned int func) S;
- void ( APIENTRY *glDepthMask) (unsigned char flag) S;
- void ( APIENTRY *glDepthRangef) (float zNear, float zFar) S;
- void ( APIENTRY *glDepthRangex) (int zNear, int zFar) S;
- void ( APIENTRY *glDisable) (unsigned int cap) S;
- void ( APIENTRY *glDisableClientState) (unsigned int array) S;
- void ( APIENTRY *glDrawArrays) (unsigned int mode, int first, int count) S;
- void ( APIENTRY *glDrawElements) (unsigned int mode, int count, unsigned int type, const void *indices) S;
- void ( APIENTRY *glEnable) (unsigned int cap) S;
- void ( APIENTRY *glEnableClientState) (unsigned int array) S;
- void ( APIENTRY *glFinish) (void) S;
- void ( APIENTRY *glFlush) (void) S;
- void ( APIENTRY *glFogf) (unsigned int pname, float param) S;
- void ( APIENTRY *glFogfv) (unsigned int pname, const float *params) S;
- void ( APIENTRY *glFogx) (unsigned int pname, int param) S;
- void ( APIENTRY *glFogxv) (unsigned int pname, const int *params) S;
- void ( APIENTRY *glFrontFace) (unsigned int mode) S;
- void ( APIENTRY *glFrustumf) (float left, float right, float bottom, float top, float zNear, float zFar) S;
- void ( APIENTRY *glFrustumx) (int left, int right, int bottom, int top, int zNear, int zFar) S;
- void ( APIENTRY *glGenTextures) (int n, unsigned int *textures) S;
- unsigned int ( APIENTRY *glGetError) (void) S;
- void ( APIENTRY *glGetIntegerv) (unsigned int pname, int *params) S;
- const unsigned char * ( APIENTRY *glGetString) (unsigned int name) S;
- void ( APIENTRY *glHint) (unsigned int target, unsigned int mode) S;
- void ( APIENTRY *glLightModelf) (unsigned int pname, float param) S;
- void ( APIENTRY *glLightModelfv) (unsigned int pname, const float *params) S;
- void ( APIENTRY *glLightModelx) (unsigned int pname, int param) S;
- void ( APIENTRY *glLightModelxv) (unsigned int pname, const int *params) S;
- void ( APIENTRY *glLightf) (unsigned int light, unsigned int pname, float param) S;
- void ( APIENTRY *glLightfv) (unsigned int light, unsigned int pname, const float *params) S;
- void ( APIENTRY *glLightx) (unsigned int light, unsigned int pname, int param) S;
- void ( APIENTRY *glLightxv) (unsigned int light, unsigned int pname, const int *params) S;
- void ( APIENTRY *glLineWidth) (float width) S;
- void ( APIENTRY *glLineWidthx) (int width) S;
- void ( APIENTRY *glLoadIdentity) (void) S;
- void ( APIENTRY *glLoadMatrixf) (const float *m) S;
- void ( APIENTRY *glLoadMatrixx) (const int *m) S;
- void ( APIENTRY *glLogicOp) (unsigned int opcode) S;
- void ( APIENTRY *glMaterialf) (unsigned int face, unsigned int pname, float param) S;
- void ( APIENTRY *glMaterialfv) (unsigned int face, unsigned int pname, const float *params) S;
- void ( APIENTRY *glMaterialx) (unsigned int face, unsigned int pname, int param) S;
- void ( APIENTRY *glMaterialxv) (unsigned int face, unsigned int pname, const int *params) S;
- void ( APIENTRY *glMatrixMode) (unsigned int mode) S;
- void ( APIENTRY *glMultMatrixf) (const float *m) S;
- void ( APIENTRY *glMultMatrixx) (const int *m) S;
- void ( APIENTRY *glMultiTexCoord4f) (unsigned int target, float s, float t, float r, float q) S;
- void ( APIENTRY *glMultiTexCoord4x) (unsigned int target, int s, int t, int r, int q) S;
- void ( APIENTRY *glNormal3f) (float nx, float ny, float nz) S;
- void ( APIENTRY *glNormal3x) (int nx, int ny, int nz) S;
- void ( APIENTRY *glNormalPointer) (unsigned int type, int stride, const void *pointer) S;
- void ( APIENTRY *glOrthof) (float left, float right, float bottom, float top, float zNear, float zFar) S;
- void ( APIENTRY *glOrthox) (int left, int right, int bottom, int top, int zNear, int zFar) S;
- void ( APIENTRY *glPixelStorei) (unsigned int pname, int param) S;
- void ( APIENTRY *glPointSize) (float size) S;
- void ( APIENTRY *glPointSizex) (int size) S;
- void ( APIENTRY *glPolygonOffset) (float factor, float units) S;
- void ( APIENTRY *glPolygonOffsetx) (int factor, int units) S;
- void ( APIENTRY *glPopMatrix) (void) S;
- void ( APIENTRY *glPushMatrix) (void) S;
- unsigned int ( APIENTRY *glQueryMatrixxOES) (int mantissa[16], int exponent[16]) S;
- void ( APIENTRY *glReadPixels) (int x, int y, int width, int height, unsigned int format, unsigned int type, void *pixels) S;
- void ( APIENTRY *glRotatef) (float angle, float x, float y, float z) S;
- void ( APIENTRY *glRotatex) (int angle, int x, int y, int z) S;
- void ( APIENTRY *glSampleCoverage) (float value, unsigned char invert) S;
- void ( APIENTRY *glSampleCoveragex) (int value, unsigned char invert) S;
- void ( APIENTRY *glScalef) (float x, float y, float z) S;
- void ( APIENTRY *glScalex) (int x, int y, int z) S;
- void ( APIENTRY *glScissor) (int x, int y, int width, int height) S;
- void ( APIENTRY *glShadeModel) (unsigned int mode) S;
- void ( APIENTRY *glStencilFunc) (unsigned int func, int ref, unsigned int mask) S;
- void ( APIENTRY *glStencilMask) (unsigned int mask) S;
- void ( APIENTRY *glStencilOp) (unsigned int fail, unsigned int zfail, unsigned int zpass) S;
- void ( APIENTRY *glTexCoordPointer) (int size, unsigned int type, int stride, const void *pointer) S;
- void ( APIENTRY *glTexEnvf) (unsigned int target, unsigned int pname, float param) S;
- void ( APIENTRY *glTexEnvfv) (unsigned int target, unsigned int pname, const float *params) S;
- void ( APIENTRY *glTexEnvx) (unsigned int target, unsigned int pname, int param) S;
- void ( APIENTRY *glTexEnvxv) (unsigned int target, unsigned int pname, const int *params) S;
- void ( APIENTRY *glTexImage2D) (unsigned int target, int level, int internalformat, int width, int height, int border, unsigned int format, unsigned int type, const void *pixels) S;
- void ( APIENTRY *glTexParameterf) (unsigned int target, unsigned int pname, float param) S;
- void ( APIENTRY *glTexParameterx) (unsigned int target, unsigned int pname, int param) S;
- void ( APIENTRY *glTexSubImage2D) (unsigned int target, int level, int xoffset, int yoffset, int width, int height, unsigned int format, unsigned int type, const void *pixels) S;
- void ( APIENTRY *glTranslatef) (float x, float y, float z) S;
- void ( APIENTRY *glTranslatex) (int x, int y, int z) S;
- void ( APIENTRY *glVertexPointer) (int size, unsigned int type, int stride, const void *pointer) S;
- void ( APIENTRY *glViewport) (int x, int y, int width, int height) S;
- int (*eglSwapInterval) (int dpy, int interval) S;
- void ( APIENTRY *glBindBuffer) (unsigned int target, unsigned int buffer) S;
- void ( APIENTRY *glBufferData) (unsigned int target, int size, const void *data, unsigned int usage) S;
- void ( APIENTRY *glBufferSubData) (unsigned int target, int offset,int size, const void *data) S;
- void ( APIENTRY *glClipPlanef) (unsigned int plane, const float *equation) S;
- void ( APIENTRY *glClipPlanex) (unsigned int plane, const int *equation) S;
- void ( APIENTRY *glColor4ub) (unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha) S;
- void ( APIENTRY *glDeleteBuffers) (int n, const unsigned int *buffers) S;
- void ( APIENTRY *glGenBuffers) (int n, unsigned int *buffers) S;
- void ( APIENTRY *glGetBooleanv) (unsigned int pname, unsigned char *params) S;
- void ( APIENTRY *glGetBufferParameteriv) (unsigned int target, unsigned int pname, int *params) S;
- void ( APIENTRY *glGetClipPlanef) (unsigned int pname, float eqn[4]) S;
- void ( APIENTRY *glGetClipPlanex) (unsigned int pname, int eqn[4]) S;
- void ( APIENTRY *glGetFixedv) (unsigned int pname, int *params) S;
- void ( APIENTRY *glGetFloatv) (unsigned int pname, float *params) S;
- void ( APIENTRY *glGetLightfv) (unsigned int light, unsigned int pname, float *params) S;
- void ( APIENTRY *glGetLightxv) (unsigned int light, unsigned int pname, int *params) S;
- void ( APIENTRY *glGetMaterialfv) (unsigned int face, unsigned int pname, float *params) S;
- void ( APIENTRY *glGetMaterialxv) (unsigned int face, unsigned int pname, int *params) S;
- void ( APIENTRY *glGetPointerv) (unsigned int pname, void **params) S;
- void ( APIENTRY *glGetTexEnvfv) (unsigned int env, unsigned int pname, float *params) S;
- void ( APIENTRY *glGetTexEnviv) (unsigned int env, unsigned int pname, int *params) S;
- void ( APIENTRY *glGetTexEnvxv) (unsigned int env, unsigned int pname, int *params) S;
- void ( APIENTRY *glGetTexParameterfv) (unsigned int target, unsigned int pname, float *params) S;
- void ( APIENTRY *glGetTexParameteriv) (unsigned int target, unsigned int pname, int *params) S;
- void ( APIENTRY *glGetTexParameterxv) (unsigned int target, unsigned int pname, int *params) S;
- unsigned char ( APIENTRY *glIsBuffer) (unsigned int buffer) S;
- unsigned char ( APIENTRY *glIsEnabled) (unsigned int cap) S;
- unsigned char ( APIENTRY *glIsTexture) (unsigned int texture) S;
- void ( APIENTRY *glPointParameterf) (unsigned int pname, float param) S;
- void ( APIENTRY *glPointParameterfv) (unsigned int pname, const float *params) S;
- void ( APIENTRY *glPointParameterx) (unsigned int pname, int param) S;
- void ( APIENTRY *glPointParameterxv) (unsigned int pname, const int *params) S;
- void ( APIENTRY *glPointSizePointerOES) (unsigned int type, int stride, const void *pointer) S;
- void ( APIENTRY *glTexEnvi) (unsigned int target, unsigned int pname, int param) S;
- void ( APIENTRY *glTexEnviv) (unsigned int target, unsigned int pname, const int *params) S;
- void ( APIENTRY *glTexParameterfv) (unsigned int target, unsigned int pname, const float *params) S;
- void ( APIENTRY *glTexParameteri) (unsigned int target, unsigned int pname, int param) S;
- void ( APIENTRY *glTexParameteriv) (unsigned int target, unsigned int pname, const int *params) S;
- void ( APIENTRY *glTexParameterxv) (unsigned int target, unsigned int pname, const int *params) S;
-
- int (*eglBindTexImage) (int dpy, int surface, int buffer) S;
- int (*eglReleaseTexImage) (int dpy, int surface, int buffer) S;
- int (*eglSurfaceAttrib) (int dpy, int surface, int attribute, int value) S;
+{
+ int ( *eglChooseConfig )( int dpy, const int *attrib_list, int *configs, int config_size, int *num_config ) S;
+ int ( *eglCopyBuffers )( int dpy, int surface, void *target ) S;
+ int ( *eglCreateContext )( int dpy, int config, int share_list, const int *attrib_list ) S;
+ int ( *eglCreatePbufferSurface )( int dpy, int config, const int *attrib_list ) S;
+ int ( *eglCreatePixmapSurface )( int dpy, int config, void *pixmap, const int *attrib_list ) S;
+ int ( *eglCreateWindowSurface )( int dpy, int config, void *window, const int *attrib_list ) S;
+ int ( *eglDestroyContext )( int dpy, int ctx ) S;
+ int ( *eglDestroySurface )( int dpy, int surface ) S;
+ int ( *eglGetConfigAttrib )( int dpy, int config, int attribute, int *value ) S;
+ int ( *eglGetConfigs )( int dpy, int *configs, int config_size, int *num_config ) S;
+ int ( *eglGetCurrentContext )( void ) S;
+ int ( *eglGetCurrentDisplay )( void ) S;
+ int ( *eglGetCurrentSurface )( int readdraw ) S;
+ int ( *eglGetDisplay )( int display ) S;
+ int ( *eglGetError )( void ) S;
+
+ void ( *( *eglGetProcAddress )( const char *procname ) )( ... ) S;
+
+ int ( *eglInitialize )( int dpy, int *major, int *minor ) S;
+ int ( *eglMakeCurrent )( int dpy, int draw, int read, int ctx ) S;
+ int ( *eglQueryContext )( int dpy, int ctx, int attribute, int *value ) S;
+ const char *( *eglQueryString )(int dpy, int name)S;
+ int ( *eglQuerySurface )( int dpy, int surface, int attribute, int *value ) S;
+ int ( *eglSwapBuffers )( int dpy, int draw ) S;
+ int ( *eglTerminate )( int dpy ) S;
+ int ( *eglWaitGL )( void ) S;
+ int ( *eglWaitNative )( int engine ) S;
+ void( APIENTRY *glActiveTexture )( unsigned int texture ) S;
+ void( APIENTRY *glAlphaFunc )( unsigned int func, float ref ) S;
+ void( APIENTRY *glAlphaFuncx )( unsigned int func, int ref ) S;
+ void( APIENTRY *glBindTexture )( unsigned int target, unsigned int texture ) S;
+ void( APIENTRY *glBlendFunc )( unsigned int sfactor, unsigned int dfactor ) S;
+ void( APIENTRY *glClear )( unsigned int mask ) S;
+ void( APIENTRY *glClearColor )( float red, float green, float blue, float alpha ) S;
+ void( APIENTRY *glClearColorx )( int red, int green, int blue, int alpha ) S;
+ void( APIENTRY *glClearDepthf )( float depth ) S;
+ void( APIENTRY *glClearDepthx )( int depth ) S;
+ void( APIENTRY *glClearStencil )( int s ) S;
+ void( APIENTRY *glClientActiveTexture )( unsigned int texture ) S;
+ void( APIENTRY *glColor4f )( float red, float green, float blue, float alpha ) S;
+ void( APIENTRY *glColor4x )( int red, int green, int blue, int alpha ) S;
+ void( APIENTRY *glColorMask )( unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha ) S;
+ void( APIENTRY *glColorPointer )( int size, unsigned int type, int stride, const void *pointer ) S;
+ void( APIENTRY *glCompressedTexImage2D )( unsigned int target, int level, unsigned int internalformat, int width, int height, int border, int imageSize, const void *data ) S;
+ void( APIENTRY *glCompressedTexSubImage2D )( unsigned int target, int level, int xoffset, int yoffset, int width, int height, unsigned int format, int imageSize, const void *data ) S;
+ void( APIENTRY *glCopyTexImage2D )( unsigned int target, int level, unsigned int internalformat, int x, int y, int width, int height, int border ) S;
+ void( APIENTRY *glCopyTexSubImage2D )( unsigned int target, int level, int xoffset, int yoffset, int x, int y, int width, int height ) S;
+ void( APIENTRY *glCullFace )( unsigned int mode ) S;
+ void( APIENTRY *glDeleteTextures )( int n, const unsigned int *textures ) S;
+ void( APIENTRY *glDepthFunc )( unsigned int func ) S;
+ void( APIENTRY *glDepthMask )( unsigned char flag ) S;
+ void( APIENTRY *glDepthRangef )( float zNear, float zFar ) S;
+ void( APIENTRY *glDepthRangex )( int zNear, int zFar ) S;
+ void( APIENTRY *glDisable )( unsigned int cap ) S;
+ void( APIENTRY *glDisableClientState )( unsigned int array ) S;
+ void( APIENTRY *glDrawArrays )( unsigned int mode, int first, int count ) S;
+ void( APIENTRY *glDrawElements )( unsigned int mode, int count, unsigned int type, const void *indices ) S;
+ void( APIENTRY *glEnable )( unsigned int cap ) S;
+ void( APIENTRY *glEnableClientState )( unsigned int array ) S;
+ void( APIENTRY *glFinish )( void ) S;
+ void( APIENTRY *glFlush )( void ) S;
+ void( APIENTRY *glFogf )( unsigned int pname, float param ) S;
+ void( APIENTRY *glFogfv )( unsigned int pname, const float *params ) S;
+ void( APIENTRY *glFogx )( unsigned int pname, int param ) S;
+ void( APIENTRY *glFogxv )( unsigned int pname, const int *params ) S;
+ void( APIENTRY *glFrontFace )( unsigned int mode ) S;
+ void( APIENTRY *glFrustumf )( float left, float right, float bottom, float top, float zNear, float zFar ) S;
+ void( APIENTRY *glFrustumx )( int left, int right, int bottom, int top, int zNear, int zFar ) S;
+ void( APIENTRY *glGenTextures )( int n, unsigned int *textures ) S;
+ unsigned int( APIENTRY *glGetError )( void ) S;
+ void( APIENTRY *glGetIntegerv )( unsigned int pname, int *params ) S;
+ const unsigned char *( APIENTRY *glGetString )(unsigned int name)S;
+ void( APIENTRY *glHint )( unsigned int target, unsigned int mode ) S;
+ void( APIENTRY *glLightModelf )( unsigned int pname, float param ) S;
+ void( APIENTRY *glLightModelfv )( unsigned int pname, const float *params ) S;
+ void( APIENTRY *glLightModelx )( unsigned int pname, int param ) S;
+ void( APIENTRY *glLightModelxv )( unsigned int pname, const int *params ) S;
+ void( APIENTRY *glLightf )( unsigned int light, unsigned int pname, float param ) S;
+ void( APIENTRY *glLightfv )( unsigned int light, unsigned int pname, const float *params ) S;
+ void( APIENTRY *glLightx )( unsigned int light, unsigned int pname, int param ) S;
+ void( APIENTRY *glLightxv )( unsigned int light, unsigned int pname, const int *params ) S;
+ void( APIENTRY *glLineWidth )( float width ) S;
+ void( APIENTRY *glLineWidthx )( int width ) S;
+ void( APIENTRY *glLoadIdentity )( void ) S;
+ void( APIENTRY *glLoadMatrixf )( const float *m ) S;
+ void( APIENTRY *glLoadMatrixx )( const int *m ) S;
+ void( APIENTRY *glLogicOp )( unsigned int opcode ) S;
+ void( APIENTRY *glMaterialf )( unsigned int face, unsigned int pname, float param ) S;
+ void( APIENTRY *glMaterialfv )( unsigned int face, unsigned int pname, const float *params ) S;
+ void( APIENTRY *glMaterialx )( unsigned int face, unsigned int pname, int param ) S;
+ void( APIENTRY *glMaterialxv )( unsigned int face, unsigned int pname, const int *params ) S;
+ void( APIENTRY *glMatrixMode )( unsigned int mode ) S;
+ void( APIENTRY *glMultMatrixf )( const float *m ) S;
+ void( APIENTRY *glMultMatrixx )( const int *m ) S;
+ void( APIENTRY *glMultiTexCoord4f )( unsigned int target, float s, float t, float r, float q ) S;
+ void( APIENTRY *glMultiTexCoord4x )( unsigned int target, int s, int t, int r, int q ) S;
+ void( APIENTRY *glNormal3f )( float nx, float ny, float nz ) S;
+ void( APIENTRY *glNormal3x )( int nx, int ny, int nz ) S;
+ void( APIENTRY *glNormalPointer )( unsigned int type, int stride, const void *pointer ) S;
+ void( APIENTRY *glOrthof )( float left, float right, float bottom, float top, float zNear, float zFar ) S;
+ void( APIENTRY *glOrthox )( int left, int right, int bottom, int top, int zNear, int zFar ) S;
+ void( APIENTRY *glPixelStorei )( unsigned int pname, int param ) S;
+ void( APIENTRY *glPointSize )( float size ) S;
+ void( APIENTRY *glPointSizex )( int size ) S;
+ void( APIENTRY *glPolygonOffset )( float factor, float units ) S;
+ void( APIENTRY *glPolygonOffsetx )( int factor, int units ) S;
+ void( APIENTRY *glPopMatrix )( void ) S;
+ void( APIENTRY *glPushMatrix )( void ) S;
+ unsigned int( APIENTRY *glQueryMatrixxOES )( int mantissa[16], int exponent[16] ) S;
+ void( APIENTRY *glReadPixels )( int x, int y, int width, int height, unsigned int format, unsigned int type, void *pixels ) S;
+ void( APIENTRY *glRotatef )( float angle, float x, float y, float z ) S;
+ void( APIENTRY *glRotatex )( int angle, int x, int y, int z ) S;
+ void( APIENTRY *glSampleCoverage )( float value, unsigned char invert ) S;
+ void( APIENTRY *glSampleCoveragex )( int value, unsigned char invert ) S;
+ void( APIENTRY *glScalef )( float x, float y, float z ) S;
+ void( APIENTRY *glScalex )( int x, int y, int z ) S;
+ void( APIENTRY *glScissor )( int x, int y, int width, int height ) S;
+ void( APIENTRY *glShadeModel )( unsigned int mode ) S;
+ void( APIENTRY *glStencilFunc )( unsigned int func, int ref, unsigned int mask ) S;
+ void( APIENTRY *glStencilMask )( unsigned int mask ) S;
+ void( APIENTRY *glStencilOp )( unsigned int fail, unsigned int zfail, unsigned int zpass ) S;
+ void( APIENTRY *glTexCoordPointer )( int size, unsigned int type, int stride, const void *pointer ) S;
+ void( APIENTRY *glTexEnvf )( unsigned int target, unsigned int pname, float param ) S;
+ void( APIENTRY *glTexEnvfv )( unsigned int target, unsigned int pname, const float *params ) S;
+ void( APIENTRY *glTexEnvx )( unsigned int target, unsigned int pname, int param ) S;
+ void( APIENTRY *glTexEnvxv )( unsigned int target, unsigned int pname, const int *params ) S;
+ void( APIENTRY *glTexImage2D )( unsigned int target, int level, int internalformat, int width, int height, int border, unsigned int format, unsigned int type, const void *pixels ) S;
+ void( APIENTRY *glTexParameterf )( unsigned int target, unsigned int pname, float param ) S;
+ void( APIENTRY *glTexParameterx )( unsigned int target, unsigned int pname, int param ) S;
+ void( APIENTRY *glTexSubImage2D )( unsigned int target, int level, int xoffset, int yoffset, int width, int height, unsigned int format, unsigned int type, const void *pixels ) S;
+ void( APIENTRY *glTranslatef )( float x, float y, float z ) S;
+ void( APIENTRY *glTranslatex )( int x, int y, int z ) S;
+ void( APIENTRY *glVertexPointer )( int size, unsigned int type, int stride, const void *pointer ) S;
+ void( APIENTRY *glViewport )( int x, int y, int width, int height ) S;
+ int ( *eglSwapInterval )( int dpy, int interval ) S;
+ void( APIENTRY *glBindBuffer )( unsigned int target, unsigned int buffer ) S;
+ void( APIENTRY *glBufferData )( unsigned int target, int size, const void *data, unsigned int usage ) S;
+ void( APIENTRY *glBufferSubData )( unsigned int target, int offset, int size, const void *data ) S;
+ void( APIENTRY *glClipPlanef )( unsigned int plane, const float *equation ) S;
+ void( APIENTRY *glClipPlanex )( unsigned int plane, const int *equation ) S;
+ void( APIENTRY *glColor4ub )( unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha ) S;
+ void( APIENTRY *glDeleteBuffers )( int n, const unsigned int *buffers ) S;
+ void( APIENTRY *glGenBuffers )( int n, unsigned int *buffers ) S;
+ void( APIENTRY *glGetBooleanv )( unsigned int pname, unsigned char *params ) S;
+ void( APIENTRY *glGetBufferParameteriv )( unsigned int target, unsigned int pname, int *params ) S;
+ void( APIENTRY *glGetClipPlanef )( unsigned int pname, float eqn[4] ) S;
+ void( APIENTRY *glGetClipPlanex )( unsigned int pname, int eqn[4] ) S;
+ void( APIENTRY *glGetFixedv )( unsigned int pname, int *params ) S;
+ void( APIENTRY *glGetFloatv )( unsigned int pname, float *params ) S;
+ void( APIENTRY *glGetLightfv )( unsigned int light, unsigned int pname, float *params ) S;
+ void( APIENTRY *glGetLightxv )( unsigned int light, unsigned int pname, int *params ) S;
+ void( APIENTRY *glGetMaterialfv )( unsigned int face, unsigned int pname, float *params ) S;
+ void( APIENTRY *glGetMaterialxv )( unsigned int face, unsigned int pname, int *params ) S;
+ void( APIENTRY *glGetPointerv )( unsigned int pname, void **params ) S;
+ void( APIENTRY *glGetTexEnvfv )( unsigned int env, unsigned int pname, float *params ) S;
+ void( APIENTRY *glGetTexEnviv )( unsigned int env, unsigned int pname, int *params ) S;
+ void( APIENTRY *glGetTexEnvxv )( unsigned int env, unsigned int pname, int *params ) S;
+ void( APIENTRY *glGetTexParameterfv )( unsigned int target, unsigned int pname, float *params ) S;
+ void( APIENTRY *glGetTexParameteriv )( unsigned int target, unsigned int pname, int *params ) S;
+ void( APIENTRY *glGetTexParameterxv )( unsigned int target, unsigned int pname, int *params ) S;
+ unsigned char( APIENTRY *glIsBuffer )( unsigned int buffer ) S;
+ unsigned char( APIENTRY *glIsEnabled )( unsigned int cap ) S;
+ unsigned char( APIENTRY *glIsTexture )( unsigned int texture ) S;
+ void( APIENTRY *glPointParameterf )( unsigned int pname, float param ) S;
+ void( APIENTRY *glPointParameterfv )( unsigned int pname, const float *params ) S;
+ void( APIENTRY *glPointParameterx )( unsigned int pname, int param ) S;
+ void( APIENTRY *glPointParameterxv )( unsigned int pname, const int *params ) S;
+ void( APIENTRY *glPointSizePointerOES )( unsigned int type, int stride, const void *pointer ) S;
+ void( APIENTRY *glTexEnvi )( unsigned int target, unsigned int pname, int param ) S;
+ void( APIENTRY *glTexEnviv )( unsigned int target, unsigned int pname, const int *params ) S;
+ void( APIENTRY *glTexParameterfv )( unsigned int target, unsigned int pname, const float *params ) S;
+ void( APIENTRY *glTexParameteri )( unsigned int target, unsigned int pname, int param ) S;
+ void( APIENTRY *glTexParameteriv )( unsigned int target, unsigned int pname, const int *params ) S;
+ void( APIENTRY *glTexParameterxv )( unsigned int target, unsigned int pname, const int *params ) S;
+
+ int ( *eglBindTexImage )( int dpy, int surface, int buffer ) S;
+ int ( *eglReleaseTexImage )( int dpy, int surface, int buffer ) S;
+ int ( *eglSurfaceAttrib )( int dpy, int surface, int attribute, int value ) S;
#ifdef USE_CORE_PROFILE
- void ( APIENTRY *glOrtho) (double left, double right, double bottom, double top, double zNear, double zFar) S;
- void ( APIENTRY *glDepthRange) (double zNear, double zFar) S;
+ void( APIENTRY *glOrtho )( double left, double right, double bottom, double top, double zNear, double zFar ) S;
+ void( APIENTRY *glDepthRange )( double zNear, double zFar ) S;
#endif
- void ( APIENTRY *glGenFramebuffers) (unsigned int n, unsigned int* framebuffers) S;
- void ( APIENTRY *glGenRenderbuffers) (unsigned int n, unsigned int* renderbuffers) S;
- void ( APIENTRY *glRenderbufferStorage) (unsigned int target, unsigned int internalformat, unsigned int width, unsigned int height) S;
- void ( APIENTRY *glBindFramebuffer) (unsigned int target, unsigned int framebuffer) S;
- void ( APIENTRY *glBindRenderbuffer) (unsigned int target, unsigned int renderbuffer) S;
- void ( APIENTRY *glFramebufferTexture2D) (unsigned int target, unsigned int attachment, unsigned int textarget, unsigned int texture, int level) S;
- void ( APIENTRY *glDeleteRenderbuffers) (unsigned int n, const unsigned int* renderbuffers) S;
- void ( APIENTRY *glDeleteFramebuffers) (unsigned int n, const unsigned int* framebuffers) S;
- void ( APIENTRY *glFramebufferRenderbuffer) (unsigned int target, unsigned int attachment, unsigned int renderbuffertarget, unsigned int renderbuffer) S;
-
+ void( APIENTRY *glGenFramebuffers )( unsigned int n, unsigned int *framebuffers ) S;
+ void( APIENTRY *glGenRenderbuffers )( unsigned int n, unsigned int *renderbuffers ) S;
+ void( APIENTRY *glRenderbufferStorage )( unsigned int target, unsigned int internalformat, unsigned int width, unsigned int height ) S;
+ void( APIENTRY *glBindFramebuffer )( unsigned int target, unsigned int framebuffer ) S;
+ void( APIENTRY *glBindRenderbuffer )( unsigned int target, unsigned int renderbuffer ) S;
+ void( APIENTRY *glFramebufferTexture2D )( unsigned int target, unsigned int attachment, unsigned int textarget, unsigned int texture, int level ) S;
+ void( APIENTRY *glDeleteRenderbuffers )( unsigned int n, const unsigned int *renderbuffers ) S;
+ void( APIENTRY *glDeleteFramebuffers )( unsigned int n, const unsigned int *framebuffers ) S;
+ void( APIENTRY *glFramebufferRenderbuffer )( unsigned int target, unsigned int attachment, unsigned int renderbuffertarget, unsigned int renderbuffer ) S;
};
-#if !defined (__WINS__)
- #if defined(__TARGET_FPU_VFP)
- #pragma no_softfp_linkage
- #endif
+#if !defined( __WINS__ )
+#if defined( __TARGET_FPU_VFP )
+#pragma no_softfp_linkage
+#endif
#endif
-
#endif
diff --git a/GL/glu.h b/GL/glu.h
index 844876613fcc41d24700677c9c4eac7a9808f6aa..5045903202bbd793bac6fc41cef6ea6457f58604 100644 (file)
--- a/GL/glu.h
+++ b/GL/glu.h
#define M_PI 3.14159265358979323846
#endif
-
void gluLookAt( GLdouble eyex, GLdouble eyey, GLdouble eyez,
- GLdouble centerx, GLdouble centery, GLdouble centerz,
- GLdouble upx, GLdouble upy, GLdouble upz );
+ GLdouble centerx, GLdouble centery, GLdouble centerz,
+ GLdouble upx, GLdouble upy, GLdouble upz );
void gluPerspective( GLdouble fovy, GLdouble aspect,
GLdouble zNear, GLdouble zFar );
GLint gluScaleImage( GLenum format,
- GLint widthin, GLint heightin,
- GLenum typein, const void *datain,
- GLint widthout, GLint heightout,
- GLenum typeout, void *dataout );
-
+ GLint widthin, GLint heightin,
+ GLenum typein, const void *datain,
+ GLint widthout, GLint heightout,
+ GLenum typeout, void *dataout );
+
GLint gluBuild2DMipmaps( GLenum target, GLint components,
GLint width, GLint height, GLenum format,
GLenum type, const void *data );
diff --git a/GL/nanogl.h b/GL/nanogl.h
index 99102fa01187f14159b4f414338f083c6c54a0c0..c5bc7b6f45880c53c9b5dc269344c621b98681b2 100644 (file)
--- a/GL/nanogl.h
+++ b/GL/nanogl.h
extern "C" {
#endif
-int nanoGL_Init(void);
-void nanoGL_Destroy(void);
-void nanoGL_Flush();
-void *nanoGL_GetProcAddress(const char *);
-void nanoGL_Reset();
+int nanoGL_Init( void );
+void nanoGL_Destroy( void );
+void nanoGL_Flush( );
+void *nanoGL_GetProcAddress( const char * );
+void nanoGL_Reset( );
#ifdef __cplusplus
}
#endif
-
#endif
diff --git a/eglwrap.cpp b/eglwrap.cpp
index 7237c5be7278fa2f76a552c1de06dca73c1f7a64..a3870b758155cf8447e0c60c814800181cfbad52 100644 (file)
--- a/eglwrap.cpp
+++ b/eglwrap.cpp
*/
-
#include "egl.h"
#include "glesinterface.h"
#include "gl.h"
#include <string.h>
-
-extern "C++" GlESInterface* glEsImpl;
-extern "C++" void FlushOnStateChange();
-void APIENTRY gl_unimplemented(GLenum none);
-
-EGLint eglGetError (void)
- {
- return glEsImpl->eglGetError();
- }
-
-EGLDisplay eglGetDisplay (NativeDisplayType display)
- {
- return glEsImpl->eglGetDisplay(display);
- }
-
-EGLBoolean eglInitialize (EGLDisplay dpy, EGLint *major, EGLint *minor)
- {
- return glEsImpl->eglInitialize(dpy,major,minor);
- }
-
-EGLBoolean eglTerminate (EGLDisplay dpy)
- {
- return glEsImpl->eglTerminate(dpy);
- }
-const char * eglQueryString (EGLDisplay dpy, EGLint name)
- {
- return glEsImpl->eglQueryString(dpy,name);
- }
-
-#if defined(__MULTITEXTURE_SUPPORT__)
+extern "C++" GlESInterface *glEsImpl;
+extern "C++" void FlushOnStateChange( );
+void APIENTRY gl_unimplemented( GLenum none );
+
+EGLint eglGetError( void )
+{
+ return glEsImpl->eglGetError( );
+}
+
+EGLDisplay eglGetDisplay( NativeDisplayType display )
+{
+ return glEsImpl->eglGetDisplay( display );
+}
+
+EGLBoolean eglInitialize( EGLDisplay dpy, EGLint *major, EGLint *minor )
+{
+ return glEsImpl->eglInitialize( dpy, major, minor );
+}
+
+EGLBoolean eglTerminate( EGLDisplay dpy )
+{
+ return glEsImpl->eglTerminate( dpy );
+}
+const char *eglQueryString( EGLDisplay dpy, EGLint name )
+{
+ return glEsImpl->eglQueryString( dpy, name );
+}
+
+#if defined( __MULTITEXTURE_SUPPORT__ )
extern "C" void glMultiTexCoord2fARB( GLenum target, GLfloat s, GLfloat t );
#endif
-void * eglGetProcAddress (const char *procname)
- {
-#if defined(__MULTITEXTURE_SUPPORT__)
- if (!strcmp(procname, "glMultiTexCoord2fARB"))
- {
- return (void*)&glMultiTexCoord2fARB;
- }
- else if (!strcmp(procname, "glActiveTextureARB"))
- {
- return (void*)&glActiveTexture;
- }
- else if (!strcmp(procname, "glClientActiveTextureARB"))
- {
- return (void*)&glClientActiveTexture;
- }
+void *eglGetProcAddress( const char *procname )
+{
+#if defined( __MULTITEXTURE_SUPPORT__ )
+ if ( !strcmp( procname, "glMultiTexCoord2fARB" ) )
+ {
+ return (void *)&glMultiTexCoord2fARB;
+ }
+ else if ( !strcmp( procname, "glActiveTextureARB" ) )
+ {
+ return (void *)&glActiveTexture;
+ }
+ else if ( !strcmp( procname, "glClientActiveTextureARB" ) )
+ {
+ return (void *)&glClientActiveTexture;
+ }
#endif
- return (void*)glEsImpl->eglGetProcAddress(procname);
- }
-
-EGLBoolean eglGetConfigs (EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config)
- {
- return glEsImpl->eglGetConfigs(dpy,configs, config_size, num_config);
- }
-
-EGLBoolean eglChooseConfig (EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config)
- {
- return glEsImpl->eglChooseConfig(dpy,attrib_list,configs,config_size, num_config);
- }
-
-EGLBoolean eglGetConfigAttrib (EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value)
- {
- return glEsImpl->eglGetConfigAttrib(dpy,config,attribute,value);
- }
-
-EGLSurface eglCreateWindowSurface (EGLDisplay dpy, EGLConfig config, NativeWindowType window, const EGLint *attrib_list)
- {
- return glEsImpl->eglCreateWindowSurface(dpy,config,window,attrib_list);
- }
-
-EGLSurface eglCreatePixmapSurface (EGLDisplay dpy, EGLConfig config, NativePixmapType pixmap, const EGLint *attrib_list)
- {
- return glEsImpl->eglCreatePixmapSurface(dpy,config,pixmap,attrib_list);
- }
-
-EGLSurface eglCreatePbufferSurface (EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list)
- {
- return glEsImpl->eglCreatePbufferSurface(dpy, config, attrib_list);
- }
-
-EGLBoolean eglDestroySurface (EGLDisplay dpy, EGLSurface surface)
- {
- return glEsImpl->eglDestroySurface(dpy,surface);
- }
-EGLBoolean eglQuerySurface (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value)
- {
- return glEsImpl->eglQuerySurface(dpy,surface,attribute,value);
- }
+ return (void *)glEsImpl->eglGetProcAddress( procname );
+}
+
+EGLBoolean eglGetConfigs( EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config )
+{
+ return glEsImpl->eglGetConfigs( dpy, configs, config_size, num_config );
+}
+
+EGLBoolean eglChooseConfig( EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config )
+{
+ return glEsImpl->eglChooseConfig( dpy, attrib_list, configs, config_size, num_config );
+}
+
+EGLBoolean eglGetConfigAttrib( EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value )
+{
+ return glEsImpl->eglGetConfigAttrib( dpy, config, attribute, value );
+}
+
+EGLSurface eglCreateWindowSurface( EGLDisplay dpy, EGLConfig config, NativeWindowType window, const EGLint *attrib_list )
+{
+ return glEsImpl->eglCreateWindowSurface( dpy, config, window, attrib_list );
+}
+
+EGLSurface eglCreatePixmapSurface( EGLDisplay dpy, EGLConfig config, NativePixmapType pixmap, const EGLint *attrib_list )
+{
+ return glEsImpl->eglCreatePixmapSurface( dpy, config, pixmap, attrib_list );
+}
+
+EGLSurface eglCreatePbufferSurface( EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list )
+{
+ return glEsImpl->eglCreatePbufferSurface( dpy, config, attrib_list );
+}
+
+EGLBoolean eglDestroySurface( EGLDisplay dpy, EGLSurface surface )
+{
+ return glEsImpl->eglDestroySurface( dpy, surface );
+}
+EGLBoolean eglQuerySurface( EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value )
+{
+ return glEsImpl->eglQuerySurface( dpy, surface, attribute, value );
+}
/* EGL 1.1 render-to-texture APIs */
-EGLBoolean eglSurfaceAttrib (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value)
- {
- return glEsImpl->eglSurfaceAttrib(dpy,surface,attribute,value);
- }
-
-EGLBoolean eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer)
- {
- return glEsImpl->eglBindTexImage(dpy,surface,buffer);
- }
-EGLBoolean eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer)
- {
- return glEsImpl->eglReleaseTexImage(dpy,surface,buffer);
- }
+EGLBoolean eglSurfaceAttrib( EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value )
+{
+ return glEsImpl->eglSurfaceAttrib( dpy, surface, attribute, value );
+}
+
+EGLBoolean eglBindTexImage( EGLDisplay dpy, EGLSurface surface, EGLint buffer )
+{
+ return glEsImpl->eglBindTexImage( dpy, surface, buffer );
+}
+EGLBoolean eglReleaseTexImage( EGLDisplay dpy, EGLSurface surface, EGLint buffer )
+{
+ return glEsImpl->eglReleaseTexImage( dpy, surface, buffer );
+}
/* EGL 1.1 swap control API */
-EGLBoolean eglSwapInterval(EGLDisplay dpy, EGLint interval)
- {
- return glEsImpl->eglSwapInterval(dpy,interval);
- }
-
-EGLContext eglCreateContext (EGLDisplay dpy, EGLConfig config, EGLContext share_list, const EGLint *attrib_list)
- {
- return glEsImpl->eglCreateContext(dpy,config,share_list,attrib_list);
- }
-
-EGLBoolean eglDestroyContext (EGLDisplay dpy, EGLContext ctx)
- {
- return glEsImpl->eglDestroyContext(dpy,ctx);
- }
-
-EGLBoolean eglMakeCurrent (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx)
- {
- FlushOnStateChange();
- return glEsImpl->eglMakeCurrent(dpy,draw,read,ctx);
- }
-
-EGLContext eglGetCurrentContext (void)
- {
- return glEsImpl->eglGetCurrentContext();
- }
-EGLSurface eglGetCurrentSurface (EGLint readdraw)
- {
- if( (void*)glEsImpl->eglGetCurrentSurface == (void*)gl_unimplemented )
+EGLBoolean eglSwapInterval( EGLDisplay dpy, EGLint interval )
+{
+ return glEsImpl->eglSwapInterval( dpy, interval );
+}
+
+EGLContext eglCreateContext( EGLDisplay dpy, EGLConfig config, EGLContext share_list, const EGLint *attrib_list )
+{
+ return glEsImpl->eglCreateContext( dpy, config, share_list, attrib_list );
+}
+
+EGLBoolean eglDestroyContext( EGLDisplay dpy, EGLContext ctx )
+{
+ return glEsImpl->eglDestroyContext( dpy, ctx );
+}
+
+EGLBoolean eglMakeCurrent( EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx )
+{
+ FlushOnStateChange( );
+ return glEsImpl->eglMakeCurrent( dpy, draw, read, ctx );
+}
+
+EGLContext eglGetCurrentContext( void )
+{
+ return glEsImpl->eglGetCurrentContext( );
+}
+EGLSurface eglGetCurrentSurface( EGLint readdraw )
+{
+ if ( (void *)glEsImpl->eglGetCurrentSurface == (void *)gl_unimplemented )
return EGL_NO_SURFACE;
- return glEsImpl->eglGetCurrentSurface(readdraw);
- }
-EGLDisplay eglGetCurrentDisplay (void)
- {
- if( (void*)glEsImpl->eglGetCurrentDisplay == (void*)gl_unimplemented )
+ return glEsImpl->eglGetCurrentSurface( readdraw );
+}
+EGLDisplay eglGetCurrentDisplay( void )
+{
+ if ( (void *)glEsImpl->eglGetCurrentDisplay == (void *)gl_unimplemented )
return EGL_NO_DISPLAY;
- return glEsImpl->eglGetCurrentDisplay();
- }
-
-EGLBoolean eglQueryContext (EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value)
- {
- return glEsImpl->eglQueryContext(dpy,ctx,attribute,value);
- }
-
-EGLBoolean eglWaitGL (void)
- {
- FlushOnStateChange();
- return glEsImpl->eglWaitGL();
- }
-
-EGLBoolean eglWaitNative (EGLint engine)
- {
- FlushOnStateChange();
- return glEsImpl->eglWaitNative(engine);
- }
-
-
-EGLBoolean eglSwapBuffers (EGLDisplay dpy, EGLSurface draw)
- {
- FlushOnStateChange();
- return glEsImpl->eglSwapBuffers(dpy,draw);
- }
-
-EGLBoolean eglCopyBuffers (EGLDisplay dpy, EGLSurface surface, NativePixmapType target)
- {
- FlushOnStateChange();
- return glEsImpl->eglCopyBuffers(dpy,surface,target);
- }
+ return glEsImpl->eglGetCurrentDisplay( );
+}
+
+EGLBoolean eglQueryContext( EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value )
+{
+ return glEsImpl->eglQueryContext( dpy, ctx, attribute, value );
+}
+
+EGLBoolean eglWaitGL( void )
+{
+ FlushOnStateChange( );
+ return glEsImpl->eglWaitGL( );
+}
+
+EGLBoolean eglWaitNative( EGLint engine )
+{
+ FlushOnStateChange( );
+ return glEsImpl->eglWaitNative( engine );
+}
+
+EGLBoolean eglSwapBuffers( EGLDisplay dpy, EGLSurface draw )
+{
+ FlushOnStateChange( );
+ return glEsImpl->eglSwapBuffers( dpy, draw );
+}
+
+EGLBoolean eglCopyBuffers( EGLDisplay dpy, EGLSurface surface, NativePixmapType target )
+{
+ FlushOnStateChange( );
+ return glEsImpl->eglCopyBuffers( dpy, surface, target );
+}
diff --git a/nanoWrap.cpp b/nanoWrap.cpp
index 8ded7b86f1619add94d252b5bf12c40064dab835..e159046488ad94dbd24f21818ec451b63992eea3 100644 (file)
--- a/nanoWrap.cpp
+++ b/nanoWrap.cpp
#include "glesinterface.h"
#include "nanogl.h"
-#define GL_TEXTURE0_ARB 0x84C0
-#define GL_TEXTURE1_ARB 0x84C1
-
-struct nanoState
- {
- GLboolean alpha_test;
- GLboolean blend;
- GLboolean clip_planei;
- GLboolean color_logic_op;
- GLboolean color_material;
- GLboolean cull_face;
- GLboolean depth_test;
- GLboolean dither;
- GLboolean fog;
- GLboolean lighti;
- GLboolean lighting;
- GLboolean line_smooth;
- GLboolean matrix_palette_oes;
- GLboolean multisample;
- GLboolean normalize;
- GLboolean point_smooth;
- GLboolean point_sprite_oes;
- GLboolean polygon_offset_fill;
- GLboolean rescale_normal;
- GLboolean sample_alpha_to_coverage;
- GLboolean sample_alpha_to_one;
- GLboolean sample_coverage;
- GLboolean scissor_test;
- GLboolean stencil_test;
- GLboolean depthmask;
- GLclampf depth_range_near;
- GLclampf depth_range_far;
- GLenum depth_func;
- GLenum cullface;
- GLenum shademodel;
- GLenum sfactor;
- GLenum dfactor;
- GLenum matrixmode;
- };
+#define GL_TEXTURE0_ARB 0x84C0
+#define GL_TEXTURE1_ARB 0x84C1
+
+struct nanoState
+{
+ GLboolean alpha_test;
+ GLboolean blend;
+ GLboolean clip_planei;
+ GLboolean color_logic_op;
+ GLboolean color_material;
+ GLboolean cull_face;
+ GLboolean depth_test;
+ GLboolean dither;
+ GLboolean fog;
+ GLboolean lighti;
+ GLboolean lighting;
+ GLboolean line_smooth;
+ GLboolean matrix_palette_oes;
+ GLboolean multisample;
+ GLboolean normalize;
+ GLboolean point_smooth;
+ GLboolean point_sprite_oes;
+ GLboolean polygon_offset_fill;
+ GLboolean rescale_normal;
+ GLboolean sample_alpha_to_coverage;
+ GLboolean sample_alpha_to_one;
+ GLboolean sample_coverage;
+ GLboolean scissor_test;
+ GLboolean stencil_test;
+ GLboolean depthmask;
+ GLclampf depth_range_near;
+ GLclampf depth_range_far;
+ GLenum depth_func;
+ GLenum cullface;
+ GLenum shademodel;
+ GLenum sfactor;
+ GLenum dfactor;
+ GLenum matrixmode;
+};
static struct nanoState nanoglState;
-static struct nanoState nanoglInitState =
- {
- GL_FALSE,
- GL_FALSE,
- GL_FALSE,
- GL_FALSE,
- GL_FALSE,
- GL_FALSE,
- GL_FALSE,
- GL_TRUE,
- GL_FALSE,
- GL_FALSE,
- GL_FALSE,
- GL_FALSE,
- GL_FALSE,
- GL_TRUE,
- GL_FALSE,
- GL_FALSE,
- GL_FALSE,
- GL_FALSE,
- GL_FALSE,
- GL_FALSE,
- GL_FALSE,
- GL_FALSE,
- GL_FALSE,
- GL_FALSE,
- GL_TRUE,
- 0.0f,
- 1.0f,
- GL_LESS,
- GL_BACK,
- GL_SMOOTH,
- GL_ONE,
- GL_ZERO,
- GL_MODELVIEW,
- };
+static struct nanoState nanoglInitState =
+ {
+ GL_FALSE,
+ GL_FALSE,
+ GL_FALSE,
+ GL_FALSE,
+ GL_FALSE,
+ GL_FALSE,
+ GL_FALSE,
+ GL_TRUE,
+ GL_FALSE,
+ GL_FALSE,
+ GL_FALSE,
+ GL_FALSE,
+ GL_FALSE,
+ GL_TRUE,
+ GL_FALSE,
+ GL_FALSE,
+ GL_FALSE,
+ GL_FALSE,
+ GL_FALSE,
+ GL_FALSE,
+ GL_FALSE,
+ GL_FALSE,
+ GL_FALSE,
+ GL_FALSE,
+ GL_TRUE,
+ 0.0f,
+ 1.0f,
+ GL_LESS,
+ GL_BACK,
+ GL_SMOOTH,
+ GL_ONE,
+ GL_ZERO,
+ GL_MODELVIEW,
+};
struct booleanstate
- {
- GLboolean value;
- GLboolean changed;
- };
+{
+ GLboolean value;
+ GLboolean changed;
+};
struct floatstate
- {
- GLfloat value;
- GLboolean changed;
- };
-
+{
+ GLfloat value;
+ GLboolean changed;
+};
+
struct uintstate
- {
- GLuint value;
- GLboolean changed;
- };
-
-struct ptrstate
- {
- GLint size;
- GLenum type;
- GLsizei stride;
- GLvoid* ptr;
- GLboolean changed;
- GLboolean enabled;
- };
+{
+ GLuint value;
+ GLboolean changed;
+};
+struct ptrstate
+{
+ GLint size;
+ GLenum type;
+ GLsizei stride;
+ GLvoid *ptr;
+ GLboolean changed;
+ GLboolean enabled;
+};
struct nanotmuState
- {
- struct booleanstate texture_2d;
- struct floatstate texture_env_mode;
- struct uintstate boundtexture;
- struct ptrstate vertex_array;
- struct ptrstate color_array;
- struct ptrstate texture_coord_array;
- struct ptrstate normal_array;
-
- };
+{
+ struct booleanstate texture_2d;
+ struct floatstate texture_env_mode;
+ struct uintstate boundtexture;
+ struct ptrstate vertex_array;
+ struct ptrstate color_array;
+ struct ptrstate texture_coord_array;
+ struct ptrstate normal_array;
+};
static struct nanotmuState tmuState0;
static struct nanotmuState tmuState1;
-
-static struct nanotmuState tmuInitState =
+
+static struct nanotmuState tmuInitState =
{
- {GL_FALSE, GL_FALSE},
- {GL_MODULATE,GL_FALSE},
- {0x7fffffff,GL_FALSE},
- {4,GL_FLOAT,0, NULL, GL_FALSE, GL_FALSE},
- {4,GL_FLOAT,0, NULL, GL_FALSE, GL_FALSE},
- {4,GL_FLOAT,0, NULL, GL_FALSE, GL_FALSE},
- {3,GL_FLOAT,0, NULL, GL_FALSE, GL_FALSE},
- };
+ {GL_FALSE, GL_FALSE},
+ {GL_MODULATE, GL_FALSE},
+ {0x7fffffff, GL_FALSE},
+ {4, GL_FLOAT, 0, NULL, GL_FALSE, GL_FALSE},
+ {4, GL_FLOAT, 0, NULL, GL_FALSE, GL_FALSE},
+ {4, GL_FLOAT, 0, NULL, GL_FALSE, GL_FALSE},
+ {3, GL_FLOAT, 0, NULL, GL_FALSE, GL_FALSE},
+};
-static struct nanotmuState* activetmuState = &tmuState0;
+static struct nanotmuState *activetmuState = &tmuState0;
-extern "C++" GlESInterface* glEsImpl;
+extern "C++" GlESInterface *glEsImpl;
static GLenum wrapperPrimitiveMode = GL_QUADS;
-GLboolean useTexCoordArray = GL_FALSE;
-static GLenum activetmu = GL_TEXTURE0;
-static GLenum clientactivetmu = GL_TEXTURE0;
+GLboolean useTexCoordArray = GL_FALSE;
+static GLenum activetmu = GL_TEXTURE0;
+static GLenum clientactivetmu = GL_TEXTURE0;
-#if defined(__MULTITEXTURE_SUPPORT__)
+#if defined( __MULTITEXTURE_SUPPORT__ )
GLboolean useMultiTexCoordArray = GL_FALSE;
#endif
-
-#if !defined (__WINS__)
+#if !defined( __WINS__ )
//#define __FORCEINLINE __forceinline
#define __FORCEINLINE inline
#else
#endif
static GLboolean delayedttmuchange = GL_FALSE;
-static GLenum delayedtmutarget = GL_TEXTURE0;
+static GLenum delayedtmutarget = GL_TEXTURE0;
struct VertexAttrib
- {
- float x;
- float y;
- float z;
-#if !defined(__MULTITEXTURE_SUPPORT__)
- float padding;
+{
+ float x;
+ float y;
+ float z;
+#if !defined( __MULTITEXTURE_SUPPORT__ )
+ float padding;
#endif
- unsigned char red;
- unsigned char green;
- unsigned char blue;
- unsigned char alpha;
-
- float s;
- float t;
-#if defined(__MULTITEXTURE_SUPPORT__)
- float s_multi;
- float t_multi;
+ unsigned char red;
+ unsigned char green;
+ unsigned char blue;
+ unsigned char alpha;
+
+ float s;
+ float t;
+#if defined( __MULTITEXTURE_SUPPORT__ )
+ float s_multi;
+ float t_multi;
#endif
- };
+};
static VertexAttrib vertexattribs[60000];
static GLushort indexArray[50000];
static GLuint vertexCount = 0;
-static GLuint indexCount = 0;
-static GLuint vertexMark = 0;
-static int indexbase = 0;
+static GLuint indexCount = 0;
+static GLuint vertexMark = 0;
+static int indexbase = 0;
-static VertexAttrib* ptrVertexAttribArray = NULL;
-static VertexAttrib* ptrVertexAttribArrayMark = NULL;
+static VertexAttrib *ptrVertexAttribArray = NULL;
+static VertexAttrib *ptrVertexAttribArrayMark = NULL;
static VertexAttrib currentVertexAttrib;
-#if defined(__MULTITEXTURE_SUPPORT__)
-static VertexAttrib currentVertexAttribInit = {0.0f,0.0f,0.0f,
- 255,255,255,255,
- 0.0f,0.0f,
- 0.0f,0.0f
- };
+#if defined( __MULTITEXTURE_SUPPORT__ )
+static VertexAttrib currentVertexAttribInit = {0.0f, 0.0f, 0.0f, 255, 255, 255, 255, 0.0f, 0.0f, 0.0f, 0.0f};
#else
-static VertexAttrib currentVertexAttribInit = {0.0f,0.0f,0.0f,0.0f,
- 255,255,255,255,
- 0.0f,0.0f,
- };
+static VertexAttrib currentVertexAttribInit = {
+ 0.0f, 0.0f, 0.0f, 0.0f, 255, 255, 255, 255, 0.0f, 0.0f,
+};
#endif
-static GLushort* ptrIndexArray = NULL;
+static GLushort *ptrIndexArray = NULL;
static GLboolean arraysValid = GL_FALSE;
-void InitGLStructs()
- {
- ptrVertexAttribArray = vertexattribs;
- ptrVertexAttribArrayMark = ptrVertexAttribArray;
- ptrIndexArray = indexArray;
-
- memcpy(&nanoglState, &nanoglInitState, sizeof(struct nanoState));
- memcpy(&tmuState0,&tmuInitState,sizeof(struct nanotmuState));
- memcpy(&tmuState1,&tmuInitState,sizeof(struct nanotmuState));
- memcpy(¤tVertexAttrib,¤tVertexAttribInit,sizeof(struct VertexAttrib));
-
- activetmuState = &tmuState0;
- wrapperPrimitiveMode = GL_QUADS;
- useTexCoordArray = GL_FALSE;
- activetmu = GL_TEXTURE0;
- clientactivetmu = GL_TEXTURE0;
- delayedttmuchange = GL_FALSE;
- delayedtmutarget = GL_TEXTURE0;
- vertexCount = 0;
- indexCount = 0;
- vertexMark = 0;
- indexbase = 0;
- arraysValid = GL_FALSE;
- }
-
-void ResetNanoState()
-{
-
- if (tmuState0.color_array.enabled)
- {
- glEsImpl->glEnableClientState(GL_COLOR_ARRAY);
+void InitGLStructs( )
+{
+ ptrVertexAttribArray = vertexattribs;
+ ptrVertexAttribArrayMark = ptrVertexAttribArray;
+ ptrIndexArray = indexArray;
+
+ memcpy( &nanoglState, &nanoglInitState, sizeof( struct nanoState ) );
+ memcpy( &tmuState0, &tmuInitState, sizeof( struct nanotmuState ) );
+ memcpy( &tmuState1, &tmuInitState, sizeof( struct nanotmuState ) );
+ memcpy( ¤tVertexAttrib, ¤tVertexAttribInit, sizeof( struct VertexAttrib ) );
+
+ activetmuState = &tmuState0;
+ wrapperPrimitiveMode = GL_QUADS;
+ useTexCoordArray = GL_FALSE;
+ activetmu = GL_TEXTURE0;
+ clientactivetmu = GL_TEXTURE0;
+ delayedttmuchange = GL_FALSE;
+ delayedtmutarget = GL_TEXTURE0;
+ vertexCount = 0;
+ indexCount = 0;
+ vertexMark = 0;
+ indexbase = 0;
+ arraysValid = GL_FALSE;
+}
+
+void ResetNanoState( )
+{
+
+ if ( tmuState0.color_array.enabled )
+ {
+ glEsImpl->glEnableClientState( GL_COLOR_ARRAY );
}
else
{
- glEsImpl->glDisableClientState(GL_COLOR_ARRAY);
+ glEsImpl->glDisableClientState( GL_COLOR_ARRAY );
}
- if (tmuState0.vertex_array.enabled)
+ if ( tmuState0.vertex_array.enabled )
{
- glEsImpl->glEnableClientState(GL_VERTEX_ARRAY);
+ glEsImpl->glEnableClientState( GL_VERTEX_ARRAY );
}
else
{
- glEsImpl->glDisableClientState(GL_VERTEX_ARRAY);
+ glEsImpl->glDisableClientState( GL_VERTEX_ARRAY );
}
- if (tmuState0.texture_coord_array.enabled)
+ if ( tmuState0.texture_coord_array.enabled )
{
- glEsImpl->glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+ glEsImpl->glEnableClientState( GL_TEXTURE_COORD_ARRAY );
}
else
{
- glEsImpl->glDisableClientState(GL_TEXTURE_COORD_ARRAY);
+ glEsImpl->glDisableClientState( GL_TEXTURE_COORD_ARRAY );
}
- if (tmuState0.normal_array.enabled)
- {
- glEsImpl->glEnableClientState(GL_NORMAL_ARRAY);
- }
- else
- {
- glEsImpl->glDisableClientState(GL_NORMAL_ARRAY);
- }
- glEsImpl->glVertexPointer(tmuState0.vertex_array.size,
- tmuState0.vertex_array.type,
- tmuState0.vertex_array.stride,
- tmuState0.vertex_array.ptr);
-
- glEsImpl->glTexCoordPointer(tmuState0.texture_coord_array.size,
- tmuState0.texture_coord_array.type,
- tmuState0.texture_coord_array.stride,
- tmuState0.texture_coord_array.ptr);
-
- glEsImpl->glColorPointer(tmuState0.color_array.size,
- tmuState0.color_array.type,
- tmuState0.color_array.stride,
- tmuState0.color_array.ptr);
+ if ( tmuState0.normal_array.enabled )
+ {
+ glEsImpl->glEnableClientState( GL_NORMAL_ARRAY );
+ }
+ else
+ {
+ glEsImpl->glDisableClientState( GL_NORMAL_ARRAY );
+ }
+ glEsImpl->glVertexPointer( tmuState0.vertex_array.size,
+ tmuState0.vertex_array.type,
+ tmuState0.vertex_array.stride,
+ tmuState0.vertex_array.ptr );
- glEsImpl->glNormalPointer(
- tmuState0.normal_array.type,
- tmuState0.normal_array.stride,
- tmuState0.normal_array.ptr);
+ glEsImpl->glTexCoordPointer( tmuState0.texture_coord_array.size,
+ tmuState0.texture_coord_array.type,
+ tmuState0.texture_coord_array.stride,
+ tmuState0.texture_coord_array.ptr );
- glEsImpl->glMatrixMode(nanoglState.matrixmode);
+ glEsImpl->glColorPointer( tmuState0.color_array.size,
+ tmuState0.color_array.type,
+ tmuState0.color_array.stride,
+ tmuState0.color_array.ptr );
+ glEsImpl->glNormalPointer(
+ tmuState0.normal_array.type,
+ tmuState0.normal_array.stride,
+ tmuState0.normal_array.ptr );
+ glEsImpl->glMatrixMode( nanoglState.matrixmode );
- glEsImpl->glColor4f (currentVertexAttrib.red, currentVertexAttrib.green, currentVertexAttrib.blue, currentVertexAttrib.alpha);
+ glEsImpl->glColor4f( currentVertexAttrib.red, currentVertexAttrib.green, currentVertexAttrib.blue, currentVertexAttrib.alpha );
- glEsImpl->glBlendFunc(nanoglState.sfactor, nanoglState.dfactor);
+ glEsImpl->glBlendFunc( nanoglState.sfactor, nanoglState.dfactor );
//glEsImpl->glBindTexture(GL_TEXTURE_2D, stackTextureState);
- glEsImpl->glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, activetmuState->texture_env_mode.value);
+ glEsImpl->glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, activetmuState->texture_env_mode.value );
arraysValid = GL_FALSE;
}
-void FlushOnStateChange()
- {
- if (delayedttmuchange)
- {
- delayedttmuchange = GL_FALSE;
+void FlushOnStateChange( )
+{
+ if ( delayedttmuchange )
+ {
+ delayedttmuchange = GL_FALSE;
#ifndef USE_CORE_PROFILE
- glEsImpl->glActiveTexture(delayedtmutarget);
-#endif
- }
-
- if (!vertexCount)
- return;
-
- if (!arraysValid)
- {
- glEsImpl->glClientActiveTexture(GL_TEXTURE0);
- glEsImpl->glVertexPointer(3, GL_FLOAT, sizeof(VertexAttrib), &vertexattribs[0].x);
- glEsImpl->glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(VertexAttrib), &vertexattribs[0].red);
- glEsImpl->glTexCoordPointer(2, GL_FLOAT, sizeof(VertexAttrib), &vertexattribs[0].s);
- glEsImpl->glEnableClientState(GL_VERTEX_ARRAY);
- glEsImpl->glEnableClientState(GL_TEXTURE_COORD_ARRAY);
- glEsImpl->glEnableClientState(GL_COLOR_ARRAY);
-#if defined(__MULTITEXTURE_SUPPORT__)
- glEsImpl->glClientActiveTexture(GL_TEXTURE1);
- glEsImpl->glTexCoordPointer(2, GL_FLOAT, sizeof(VertexAttrib), &vertexattribs[0].s_multi);
- glEsImpl->glEnableClientState(GL_TEXTURE_COORD_ARRAY);
- glEsImpl->glClientActiveTexture(GL_TEXTURE0);
+ glEsImpl->glActiveTexture( delayedtmutarget );
#endif
- arraysValid = GL_TRUE;
- }
-
- glEsImpl->glDrawElements( GL_TRIANGLES,vertexCount,GL_UNSIGNED_SHORT, indexArray );
+ }
+ if ( !vertexCount )
+ return;
-#if defined(__MULTITEXTURE_SUPPORT__)
- useMultiTexCoordArray = GL_FALSE;
-#endif
- vertexCount = 0;
- indexCount = 0;
- ptrVertexAttribArray = vertexattribs;
- ptrVertexAttribArrayMark = ptrVertexAttribArray;
- ptrIndexArray = indexArray;
- useTexCoordArray = GL_FALSE;
- }
-void nanoGL_Flush()
+ if ( !arraysValid )
{
- FlushOnStateChange();
+ glEsImpl->glClientActiveTexture( GL_TEXTURE0 );
+ glEsImpl->glVertexPointer( 3, GL_FLOAT, sizeof( VertexAttrib ), &vertexattribs[0].x );
+ glEsImpl->glColorPointer( 4, GL_UNSIGNED_BYTE, sizeof( VertexAttrib ), &vertexattribs[0].red );
+ glEsImpl->glTexCoordPointer( 2, GL_FLOAT, sizeof( VertexAttrib ), &vertexattribs[0].s );
+ glEsImpl->glEnableClientState( GL_VERTEX_ARRAY );
+ glEsImpl->glEnableClientState( GL_TEXTURE_COORD_ARRAY );
+ glEsImpl->glEnableClientState( GL_COLOR_ARRAY );
+#if defined( __MULTITEXTURE_SUPPORT__ )
+ glEsImpl->glClientActiveTexture( GL_TEXTURE1 );
+ glEsImpl->glTexCoordPointer( 2, GL_FLOAT, sizeof( VertexAttrib ), &vertexattribs[0].s_multi );
+ glEsImpl->glEnableClientState( GL_TEXTURE_COORD_ARRAY );
+ glEsImpl->glClientActiveTexture( GL_TEXTURE0 );
+#endif
+ arraysValid = GL_TRUE;
}
-void nanoGL_Reset()
+
+ glEsImpl->glDrawElements( GL_TRIANGLES, vertexCount, GL_UNSIGNED_SHORT, indexArray );
+
+#if defined( __MULTITEXTURE_SUPPORT__ )
+ useMultiTexCoordArray = GL_FALSE;
+#endif
+ vertexCount = 0;
+ indexCount = 0;
+ ptrVertexAttribArray = vertexattribs;
+ ptrVertexAttribArrayMark = ptrVertexAttribArray;
+ ptrIndexArray = indexArray;
+ useTexCoordArray = GL_FALSE;
+}
+void nanoGL_Flush( )
{
- ResetNanoState();
+ FlushOnStateChange( );
+}
+void nanoGL_Reset( )
+{
+ ResetNanoState( );
+}
+void glBegin( GLenum mode )
+{
+ wrapperPrimitiveMode = mode;
+ vertexMark = vertexCount;
+ ptrVertexAttribArrayMark = ptrVertexAttribArray;
+ indexbase = indexCount;
}
-void glBegin(GLenum mode)
- {
- wrapperPrimitiveMode = mode;
- vertexMark = vertexCount;
- ptrVertexAttribArrayMark = ptrVertexAttribArray;
- indexbase = indexCount;
- }
-
-void glEnd(void)
- {
- vertexCount+=((unsigned char*)ptrVertexAttribArray-(unsigned char*)ptrVertexAttribArrayMark)/sizeof(VertexAttrib);
- if (vertexCount < 3)
- {
- return;
- }
- switch (wrapperPrimitiveMode)
- {
- case GL_QUADS:
- {
- *ptrIndexArray++ = indexCount;
- *ptrIndexArray++ = indexCount+1;
- *ptrIndexArray++ = indexCount+2;
- *ptrIndexArray++ = indexCount;
- *ptrIndexArray++ = indexCount+2;
- *ptrIndexArray++ = indexCount+3;
- indexCount+=4;
- vertexCount+=2;
- }
- break;
- case GL_TRIANGLES:
- {
- int vcount = (vertexCount-vertexMark)/3;
- for (int count = 0; count < vcount; count++)
- {
- *ptrIndexArray++ = indexCount;
- *ptrIndexArray++ = indexCount+1;
- *ptrIndexArray++ = indexCount+2;
- indexCount+=3;
- }
- }
- break;
- case GL_TRIANGLE_STRIP:
- {
- *ptrIndexArray++ = indexCount;
- *ptrIndexArray++ = indexCount+1;
- *ptrIndexArray++ = indexCount+2;
- indexCount+=3;
- int vcount = ((vertexCount-vertexMark)-3);
- if (vcount && ((long)ptrIndexArray & 0x02))
- {
- *ptrIndexArray++ = indexCount-1; // 2
- *ptrIndexArray++ = indexCount-2; // 1
- *ptrIndexArray++ = indexCount; // 3
- indexCount++;
- vcount-=1;
- int odd = vcount&1;
- vcount/=2;
- unsigned int* longptr = (unsigned int*) ptrIndexArray;
-
- for (int count = 0; count < vcount; count++)
- {
- *(longptr++) = (indexCount-2) | ((indexCount-1)<<16);
- *(longptr++) = (indexCount) | ((indexCount)<<16);
- *(longptr++) = (indexCount-1) | ((indexCount+1)<<16);
- indexCount+=2;
- }
- ptrIndexArray = (unsigned short*)(longptr);
- if (odd)
- {
- *ptrIndexArray++ = indexCount-2; // 2
- *ptrIndexArray++ = indexCount-1; // 1
- *ptrIndexArray++ = indexCount; // 3
- indexCount++;
- }
- }
- else
- {
- //already aligned
- int odd = vcount&1;
- vcount/=2;
- unsigned int* longptr = (unsigned int*) ptrIndexArray;
-
- for (int count = 0; count < vcount; count++)
- {
- *(longptr++) = (indexCount-1) | ((indexCount-2)<<16);
- *(longptr++) = (indexCount) | ((indexCount-1)<<16);
- *(longptr++) = (indexCount) | ((indexCount+1)<<16);
- indexCount+=2;
-
- }
- ptrIndexArray = (unsigned short*)(longptr);
- if (odd)
- {
-
- *ptrIndexArray++ = indexCount-1; // 2
- *ptrIndexArray++ = indexCount-2; // 1
- *ptrIndexArray++ = indexCount; // 3
- indexCount++;
- }
- }
- vertexCount+=(vertexCount-vertexMark-3)*2;
- }
- break;
- case GL_POLYGON:
- case GL_TRIANGLE_FAN:
- {
- *ptrIndexArray++ = indexCount++;
- *ptrIndexArray++ = indexCount++;
- *ptrIndexArray++ = indexCount++;
- int vcount = ((vertexCount-vertexMark)-3);
- for (int count = 0; count < vcount; count++)
- {
- *ptrIndexArray++ = indexbase;
- *ptrIndexArray++ = indexCount-1;
- *ptrIndexArray++ = indexCount++;
- vertexCount+=2;
- }
- }
- break;
- default:
- break;
- }
- if( ptrVertexAttribArray - vertexattribs > 20000 * sizeof(VertexAttrib) ||
- ptrIndexArray - indexArray > 15000 * sizeof(GLushort) )
- FlushOnStateChange();
- }
+void glEnd( void )
+{
+ vertexCount += ( (unsigned char *)ptrVertexAttribArray - (unsigned char *)ptrVertexAttribArrayMark ) / sizeof( VertexAttrib );
+ if ( vertexCount < 3 )
+ {
+ return;
+ }
+ switch ( wrapperPrimitiveMode )
+ {
+ case GL_QUADS:
+ {
+ *ptrIndexArray++ = indexCount;
+ *ptrIndexArray++ = indexCount + 1;
+ *ptrIndexArray++ = indexCount + 2;
+ *ptrIndexArray++ = indexCount;
+ *ptrIndexArray++ = indexCount + 2;
+ *ptrIndexArray++ = indexCount + 3;
+ indexCount += 4;
+ vertexCount += 2;
+ }
+ break;
+ case GL_TRIANGLES:
+ {
+ int vcount = ( vertexCount - vertexMark ) / 3;
+ for ( int count = 0; count < vcount; count++ )
+ {
+ *ptrIndexArray++ = indexCount;
+ *ptrIndexArray++ = indexCount + 1;
+ *ptrIndexArray++ = indexCount + 2;
+ indexCount += 3;
+ }
+ }
+ break;
+ case GL_TRIANGLE_STRIP:
+ {
+ *ptrIndexArray++ = indexCount;
+ *ptrIndexArray++ = indexCount + 1;
+ *ptrIndexArray++ = indexCount + 2;
+ indexCount += 3;
+ int vcount = ( ( vertexCount - vertexMark ) - 3 );
+ if ( vcount && ( (long)ptrIndexArray & 0x02 ) )
+ {
+ *ptrIndexArray++ = indexCount - 1; // 2
+ *ptrIndexArray++ = indexCount - 2; // 1
+ *ptrIndexArray++ = indexCount; // 3
+ indexCount++;
+ vcount -= 1;
+ int odd = vcount & 1;
+ vcount /= 2;
+ unsigned int *longptr = (unsigned int *)ptrIndexArray;
+
+ for ( int count = 0; count < vcount; count++ )
+ {
+ *( longptr++ ) = ( indexCount - 2 ) | ( ( indexCount - 1 ) << 16 );
+ *( longptr++ ) = ( indexCount ) | ( ( indexCount ) << 16 );
+ *( longptr++ ) = ( indexCount - 1 ) | ( ( indexCount + 1 ) << 16 );
+ indexCount += 2;
+ }
+ ptrIndexArray = (unsigned short *)( longptr );
+ if ( odd )
+ {
+ *ptrIndexArray++ = indexCount - 2; // 2
+ *ptrIndexArray++ = indexCount - 1; // 1
+ *ptrIndexArray++ = indexCount; // 3
+ indexCount++;
+ }
+ }
+ else
+ {
+ //already aligned
+ int odd = vcount & 1;
+ vcount /= 2;
+ unsigned int *longptr = (unsigned int *)ptrIndexArray;
-void glEnable (GLenum cap)
- {
- GLboolean statechanged = GL_FALSE;
- switch(cap)
- {
- case GL_ALPHA_TEST:
+ for ( int count = 0; count < vcount; count++ )
+ {
+ *( longptr++ ) = ( indexCount - 1 ) | ( ( indexCount - 2 ) << 16 );
+ *( longptr++ ) = ( indexCount ) | ( ( indexCount - 1 ) << 16 );
+ *( longptr++ ) = ( indexCount ) | ( ( indexCount + 1 ) << 16 );
+ indexCount += 2;
+ }
+ ptrIndexArray = (unsigned short *)( longptr );
+ if ( odd )
+ {
+
+ *ptrIndexArray++ = indexCount - 1; // 2
+ *ptrIndexArray++ = indexCount - 2; // 1
+ *ptrIndexArray++ = indexCount; // 3
+ indexCount++;
+ }
+ }
+ vertexCount += ( vertexCount - vertexMark - 3 ) * 2;
+ }
+ break;
+ case GL_POLYGON:
+ case GL_TRIANGLE_FAN:
+ {
+ *ptrIndexArray++ = indexCount++;
+ *ptrIndexArray++ = indexCount++;
+ *ptrIndexArray++ = indexCount++;
+ int vcount = ( ( vertexCount - vertexMark ) - 3 );
+ for ( int count = 0; count < vcount; count++ )
+ {
+ *ptrIndexArray++ = indexbase;
+ *ptrIndexArray++ = indexCount - 1;
+ *ptrIndexArray++ = indexCount++;
+ vertexCount += 2;
+ }
+ }
+ break;
+
+ default:
+ break;
+ }
+ if ( ptrVertexAttribArray - vertexattribs > 20000 * sizeof( VertexAttrib ) ||
+ ptrIndexArray - indexArray > 15000 * sizeof( GLushort ) )
+ FlushOnStateChange( );
+}
+
+void glEnable( GLenum cap )
+{
+ GLboolean statechanged = GL_FALSE;
+ switch ( cap )
+ {
+ case GL_ALPHA_TEST:
+ {
+ if ( !nanoglState.alpha_test )
+ {
+ nanoglState.alpha_test = GL_TRUE;
+ statechanged = GL_TRUE;
+ }
+ break;
+ }
+ case GL_BLEND:
+ {
+ if ( !nanoglState.blend )
+ {
+ nanoglState.blend = GL_TRUE;
+ statechanged = GL_TRUE;
+ }
+ break;
+ }
+ //case GL_CLIP_PLANEi
+ case GL_COLOR_LOGIC_OP:
+ {
+ if ( !nanoglState.color_logic_op )
+ {
+ nanoglState.color_logic_op = GL_TRUE;
+ statechanged = GL_TRUE;
+ }
+ break;
+ }
+ case GL_COLOR_MATERIAL:
+ {
+ if ( !nanoglState.color_material )
+ {
+ nanoglState.color_material = GL_TRUE;
+ statechanged = GL_TRUE;
+ }
+ break;
+ }
+ case GL_CULL_FACE:
+ {
+ if ( !nanoglState.cull_face )
+ {
+ nanoglState.cull_face = GL_TRUE;
+ statechanged = GL_TRUE;
+ }
+ break;
+ }
+ case GL_DEPTH_TEST:
+ {
+ if ( !nanoglState.depth_test )
+ {
+ nanoglState.depth_test = GL_TRUE;
+ statechanged = GL_TRUE;
+ }
+ break;
+ }
+ case GL_DITHER:
+ {
+ if ( !nanoglState.dither )
+ {
+ nanoglState.dither = GL_TRUE;
+ statechanged = GL_TRUE;
+ }
+ break;
+ }
+ case GL_FOG:
+ //case GL_LIGHTi
+ {
+ if ( !nanoglState.fog )
+ {
+ nanoglState.fog = GL_TRUE;
+ statechanged = GL_TRUE;
+ }
+ break;
+ }
+ case GL_LIGHTING:
+ {
+ if ( !nanoglState.lighting )
+ {
+ nanoglState.lighting = GL_TRUE;
+ statechanged = GL_TRUE;
+ }
+ break;
+ }
+ case GL_LINE_SMOOTH:
+ {
+ if ( !nanoglState.line_smooth )
+ {
+ nanoglState.line_smooth = GL_TRUE;
+ statechanged = GL_TRUE;
+ }
+ break;
+ }
+ /* case GL_MATRIX_PALETTE_OES:
{
- if (!nanoglState.alpha_test)
+ if (!nanoglState.matrix_palette_oes)
{
- nanoglState.alpha_test = GL_TRUE;
+ nanoglState.matrix_palette_oes = GL_TRUE;
statechanged = GL_TRUE;
}
break;
- }
- case GL_BLEND:
+ }*/
+ case GL_MULTISAMPLE:
+ {
+ if ( !nanoglState.multisample )
+ {
+ nanoglState.multisample = GL_TRUE;
+ statechanged = GL_TRUE;
+ }
+ break;
+ }
+ case GL_NORMALIZE:
+ {
+ if ( !nanoglState.normalize )
+ {
+ nanoglState.normalize = GL_TRUE;
+ statechanged = GL_TRUE;
+ }
+ break;
+ }
+ /* case GL_POINT_SPRITE_OES:
{
- if (!nanoglState.blend)
+ if (!nanoglState.point_sprite_oes)
{
- nanoglState.blend = GL_TRUE;
+ nanoglState.point_sprite_oes = GL_TRUE;
statechanged = GL_TRUE;
}
break;
- }
- //case GL_CLIP_PLANEi
- case GL_COLOR_LOGIC_OP:
+ }*/
+ case GL_POLYGON_OFFSET_FILL:
+ {
+ if ( !nanoglState.polygon_offset_fill )
+ {
+ nanoglState.polygon_offset_fill = GL_TRUE;
+ statechanged = GL_TRUE;
+ }
+ break;
+ }
+ case GL_RESCALE_NORMAL:
+ {
+ if ( !nanoglState.rescale_normal )
+ {
+ nanoglState.rescale_normal = GL_TRUE;
+ statechanged = GL_TRUE;
+ }
+ break;
+ }
+ case GL_SAMPLE_ALPHA_TO_COVERAGE:
+ {
+ if ( !nanoglState.sample_alpha_to_coverage )
+ {
+ nanoglState.sample_alpha_to_coverage = GL_TRUE;
+ statechanged = GL_TRUE;
+ }
+ break;
+ }
+ case GL_SAMPLE_ALPHA_TO_ONE:
+ {
+ if ( !nanoglState.sample_alpha_to_one )
+ {
+ nanoglState.sample_alpha_to_one = GL_TRUE;
+ statechanged = GL_TRUE;
+ }
+ break;
+ }
+ case GL_SAMPLE_COVERAGE:
+ {
+ if ( !nanoglState.sample_coverage )
+ {
+ nanoglState.sample_coverage = GL_TRUE;
+ statechanged = GL_TRUE;
+ }
+ break;
+ }
+ case GL_SCISSOR_TEST:
+ {
+ if ( !nanoglState.scissor_test )
+ {
+ nanoglState.scissor_test = GL_TRUE;
+ statechanged = GL_TRUE;
+ }
+ break;
+ }
+ case GL_STENCIL_TEST:
+ {
+ return;
+ /* if (!nanoglState.stencil_test)
+ {
+ nanoglState.stencil_test = GL_TRUE;
+ statechanged = GL_TRUE;
+ }*/
+ break;
+ }
+ case GL_TEXTURE_2D:
+ {
+ if ( !activetmuState->texture_2d.value )
+ {
+ FlushOnStateChange( );
+ glEsImpl->glEnable( cap );
+ activetmuState->texture_2d.value = GL_TRUE;
+ return;
+ }
+ break;
+ }
+ default:
+ break;
+ }
+
+ if ( statechanged )
+ {
+ FlushOnStateChange( );
+ glEsImpl->glEnable( cap );
+ }
+}
+
+void glDisable( GLenum cap )
+{
+ GLboolean statechanged = GL_FALSE;
+ switch ( cap )
+ {
+ case GL_ALPHA_TEST:
+ {
+ if ( nanoglState.alpha_test )
+ {
+ nanoglState.alpha_test = GL_FALSE;
+ statechanged = GL_TRUE;
+ }
+ break;
+ }
+ case GL_BLEND:
+ {
+ if ( nanoglState.blend )
+ {
+ nanoglState.blend = GL_FALSE;
+ statechanged = GL_TRUE;
+ }
+ break;
+ }
+ //case GL_CLIP_PLANEi
+ case GL_COLOR_LOGIC_OP:
+ {
+ if ( nanoglState.color_logic_op )
+ {
+ nanoglState.color_logic_op = GL_FALSE;
+ statechanged = GL_TRUE;
+ }
+ break;
+ }
+ case GL_COLOR_MATERIAL:
+ {
+ if ( nanoglState.color_material )
+ {
+ nanoglState.color_material = GL_FALSE;
+ statechanged = GL_TRUE;
+ }
+ break;
+ }
+ case GL_CULL_FACE:
+ {
+ if ( nanoglState.cull_face )
+ {
+ nanoglState.cull_face = GL_FALSE;
+ statechanged = GL_TRUE;
+ }
+ break;
+ }
+ case GL_DEPTH_TEST:
+ {
+ if ( nanoglState.depth_test )
+ {
+ nanoglState.depth_test = GL_FALSE;
+ statechanged = GL_TRUE;
+ }
+ break;
+ }
+ case GL_DITHER:
+ {
+ if ( nanoglState.dither )
+ {
+ nanoglState.dither = GL_FALSE;
+ statechanged = GL_TRUE;
+ }
+ break;
+ }
+ case GL_FOG:
+ //case GL_LIGHTi
+ {
+ if ( nanoglState.fog )
+ {
+ nanoglState.fog = GL_FALSE;
+ statechanged = GL_TRUE;
+ }
+ break;
+ }
+ case GL_LIGHTING:
+ {
+ if ( nanoglState.lighting )
+ {
+ nanoglState.lighting = GL_FALSE;
+ statechanged = GL_TRUE;
+ }
+ break;
+ }
+ case GL_LINE_SMOOTH:
+ {
+ if ( nanoglState.line_smooth )
+ {
+ nanoglState.line_smooth = GL_FALSE;
+ statechanged = GL_TRUE;
+ }
+ break;
+ }
+ /* case GL_MATRIX_PALETTE_OES:
{
- if (!nanoglState.color_logic_op)
+ if (nanoglState.matrix_palette_oes)
{
- nanoglState.color_logic_op = GL_TRUE;
+ nanoglState.matrix_palette_oes = GL_FALSE;
statechanged = GL_TRUE;
}
break;
- }
- case GL_COLOR_MATERIAL:
+ }*/
+ case GL_MULTISAMPLE:
+ {
+ if ( nanoglState.multisample )
+ {
+ nanoglState.multisample = GL_FALSE;
+ statechanged = GL_TRUE;
+ }
+ break;
+ }
+ case GL_NORMALIZE:
+ {
+ if ( nanoglState.normalize )
+ {
+ nanoglState.normalize = GL_FALSE;
+ statechanged = GL_TRUE;
+ }
+ break;
+ }
+ /* case GL_POINT_SPRITE_OES:
{
- if (!nanoglState.color_material)
+ if (nanoglState.point_sprite_oes)
{
- nanoglState.color_material = GL_TRUE;
- statechanged = GL_TRUE;
- }
- break;
- }
- case GL_CULL_FACE:
- {
- if (!nanoglState.cull_face)
- {
- nanoglState.cull_face = GL_TRUE;
- statechanged = GL_TRUE;
- }
- break;
- }
- case GL_DEPTH_TEST:
- {
- if (!nanoglState.depth_test)
- {
- nanoglState.depth_test = GL_TRUE;
- statechanged = GL_TRUE;
- }
- break;
- }
- case GL_DITHER:
- {
- if (!nanoglState.dither)
- {
- nanoglState.dither = GL_TRUE;
- statechanged = GL_TRUE;
- }
- break;
- }
- case GL_FOG:
- //case GL_LIGHTi
- {
- if (!nanoglState.fog)
- {
- nanoglState.fog = GL_TRUE;
- statechanged = GL_TRUE;
- }
- break;
- }
- case GL_LIGHTING:
- {
- if (!nanoglState.lighting)
- {
- nanoglState.lighting = GL_TRUE;
- statechanged = GL_TRUE;
- }
- break;
- }
- case GL_LINE_SMOOTH:
- {
- if (!nanoglState.line_smooth)
- {
- nanoglState.line_smooth = GL_TRUE;
- statechanged = GL_TRUE;
- }
- break;
- }
-/* case GL_MATRIX_PALETTE_OES:
- {
- if (!nanoglState.matrix_palette_oes)
- {
- nanoglState.matrix_palette_oes = GL_TRUE;
- statechanged = GL_TRUE;
- }
- break;
- }*/
- case GL_MULTISAMPLE:
- {
- if (!nanoglState.multisample)
- {
- nanoglState.multisample = GL_TRUE;
- statechanged = GL_TRUE;
- }
- break;
- }
- case GL_NORMALIZE:
- {
- if (!nanoglState.normalize)
- {
- nanoglState.normalize = GL_TRUE;
- statechanged = GL_TRUE;
- }
- break;
- }
-/* case GL_POINT_SPRITE_OES:
- {
- if (!nanoglState.point_sprite_oes)
- {
- nanoglState.point_sprite_oes = GL_TRUE;
- statechanged = GL_TRUE;
- }
- break;
- }*/
- case GL_POLYGON_OFFSET_FILL:
- {
- if (!nanoglState.polygon_offset_fill)
- {
- nanoglState.polygon_offset_fill = GL_TRUE;
- statechanged = GL_TRUE;
- }
- break;
- }
- case GL_RESCALE_NORMAL:
- {
- if (!nanoglState.rescale_normal)
- {
- nanoglState.rescale_normal = GL_TRUE;
- statechanged = GL_TRUE;
- }
- break;
- }
- case GL_SAMPLE_ALPHA_TO_COVERAGE:
- {
- if (!nanoglState.sample_alpha_to_coverage)
- {
- nanoglState.sample_alpha_to_coverage = GL_TRUE;
- statechanged = GL_TRUE;
- }
- break;
- }
- case GL_SAMPLE_ALPHA_TO_ONE:
- {
- if (!nanoglState.sample_alpha_to_one)
- {
- nanoglState.sample_alpha_to_one = GL_TRUE;
- statechanged = GL_TRUE;
- }
- break;
- }
- case GL_SAMPLE_COVERAGE:
- {
- if (!nanoglState.sample_coverage)
- {
- nanoglState.sample_coverage = GL_TRUE;
- statechanged = GL_TRUE;
- }
- break;
- }
- case GL_SCISSOR_TEST:
- {
- if (!nanoglState.scissor_test)
- {
- nanoglState.scissor_test = GL_TRUE;
- statechanged = GL_TRUE;
- }
- break;
- }
- case GL_STENCIL_TEST:
- {
- return;
-/* if (!nanoglState.stencil_test)
- {
- nanoglState.stencil_test = GL_TRUE;
- statechanged = GL_TRUE;
- }*/
- break;
- }
- case GL_TEXTURE_2D:
- {
- if (!activetmuState->texture_2d.value)
- {
- FlushOnStateChange();
- glEsImpl->glEnable(cap);
- activetmuState->texture_2d.value = GL_TRUE;
- return;
- }
- break;
- }
- default:
- break;
- }
-
- if (statechanged)
- {
- FlushOnStateChange();
- glEsImpl->glEnable(cap);
- }
- }
-
-void glDisable (GLenum cap)
- {
- GLboolean statechanged = GL_FALSE;
- switch(cap)
- {
- case GL_ALPHA_TEST:
- {
- if (nanoglState.alpha_test)
- {
- nanoglState.alpha_test = GL_FALSE;
- statechanged = GL_TRUE;
- }
- break;
- }
- case GL_BLEND:
- {
- if (nanoglState.blend)
- {
- nanoglState.blend = GL_FALSE;
- statechanged = GL_TRUE;
- }
- break;
- }
- //case GL_CLIP_PLANEi
- case GL_COLOR_LOGIC_OP:
- {
- if (nanoglState.color_logic_op)
- {
- nanoglState.color_logic_op = GL_FALSE;
- statechanged = GL_TRUE;
- }
- break;
- }
- case GL_COLOR_MATERIAL:
- {
- if (nanoglState.color_material)
- {
- nanoglState.color_material = GL_FALSE;
- statechanged = GL_TRUE;
- }
- break;
- }
- case GL_CULL_FACE:
- {
- if (nanoglState.cull_face)
- {
- nanoglState.cull_face = GL_FALSE;
- statechanged = GL_TRUE;
- }
- break;
- }
- case GL_DEPTH_TEST:
- {
- if (nanoglState.depth_test)
- {
- nanoglState.depth_test = GL_FALSE;
- statechanged = GL_TRUE;
- }
- break;
- }
- case GL_DITHER:
- {
- if (nanoglState.dither)
- {
- nanoglState.dither = GL_FALSE;
- statechanged = GL_TRUE;
- }
- break;
- }
- case GL_FOG:
- //case GL_LIGHTi
- {
- if (nanoglState.fog)
- {
- nanoglState.fog = GL_FALSE;
- statechanged = GL_TRUE;
- }
- break;
- }
- case GL_LIGHTING:
- {
- if (nanoglState.lighting)
- {
- nanoglState.lighting = GL_FALSE;
- statechanged = GL_TRUE;
- }
- break;
- }
- case GL_LINE_SMOOTH:
- {
- if (nanoglState.line_smooth)
- {
- nanoglState.line_smooth = GL_FALSE;
- statechanged = GL_TRUE;
- }
- break;
- }
-/* case GL_MATRIX_PALETTE_OES:
- {
- if (nanoglState.matrix_palette_oes)
- {
- nanoglState.matrix_palette_oes = GL_FALSE;
- statechanged = GL_TRUE;
- }
- break;
- }*/
- case GL_MULTISAMPLE:
- {
- if (nanoglState.multisample)
- {
- nanoglState.multisample = GL_FALSE;
- statechanged = GL_TRUE;
- }
- break;
- }
- case GL_NORMALIZE:
- {
- if (nanoglState.normalize)
- {
- nanoglState.normalize = GL_FALSE;
- statechanged = GL_TRUE;
- }
- break;
- }
-/* case GL_POINT_SPRITE_OES:
- {
- if (nanoglState.point_sprite_oes)
- {
- nanoglState.point_sprite_oes = GL_FALSE;
+ nanoglState.point_sprite_oes = GL_FALSE;
statechanged = GL_TRUE;
}
break;
}*/
- case GL_POLYGON_OFFSET_FILL:
- {
- if (nanoglState.polygon_offset_fill)
- {
- nanoglState.polygon_offset_fill = GL_FALSE;
- statechanged = GL_TRUE;
- }
- break;
- }
- case GL_RESCALE_NORMAL:
- {
- if (nanoglState.rescale_normal)
- {
- nanoglState.rescale_normal = GL_FALSE;
- statechanged = GL_TRUE;
- }
- break;
- }
- case GL_SAMPLE_ALPHA_TO_COVERAGE:
- {
- if (nanoglState.sample_alpha_to_coverage)
- {
- nanoglState.sample_alpha_to_coverage = GL_FALSE;
- statechanged = GL_TRUE;
- }
- break;
- }
- case GL_SAMPLE_ALPHA_TO_ONE:
- {
- if (nanoglState.sample_alpha_to_one)
- {
- nanoglState.sample_alpha_to_one = GL_FALSE;
- statechanged = GL_TRUE;
- }
- break;
- }
- case GL_SAMPLE_COVERAGE:
- {
- if (nanoglState.sample_coverage)
- {
- nanoglState.sample_coverage = GL_FALSE;
- statechanged = GL_TRUE;
- }
- break;
- }
- case GL_SCISSOR_TEST:
- {
- if (nanoglState.scissor_test)
- {
- nanoglState.scissor_test = GL_FALSE;
- statechanged = GL_TRUE;
- }
- break;
- }
- case GL_STENCIL_TEST:
- {
- return;
-/* if (nanoglState.stencil_test)
+ case GL_POLYGON_OFFSET_FILL:
+ {
+ if ( nanoglState.polygon_offset_fill )
+ {
+ nanoglState.polygon_offset_fill = GL_FALSE;
+ statechanged = GL_TRUE;
+ }
+ break;
+ }
+ case GL_RESCALE_NORMAL:
+ {
+ if ( nanoglState.rescale_normal )
+ {
+ nanoglState.rescale_normal = GL_FALSE;
+ statechanged = GL_TRUE;
+ }
+ break;
+ }
+ case GL_SAMPLE_ALPHA_TO_COVERAGE:
+ {
+ if ( nanoglState.sample_alpha_to_coverage )
+ {
+ nanoglState.sample_alpha_to_coverage = GL_FALSE;
+ statechanged = GL_TRUE;
+ }
+ break;
+ }
+ case GL_SAMPLE_ALPHA_TO_ONE:
+ {
+ if ( nanoglState.sample_alpha_to_one )
+ {
+ nanoglState.sample_alpha_to_one = GL_FALSE;
+ statechanged = GL_TRUE;
+ }
+ break;
+ }
+ case GL_SAMPLE_COVERAGE:
+ {
+ if ( nanoglState.sample_coverage )
+ {
+ nanoglState.sample_coverage = GL_FALSE;
+ statechanged = GL_TRUE;
+ }
+ break;
+ }
+ case GL_SCISSOR_TEST:
+ {
+ if ( nanoglState.scissor_test )
+ {
+ nanoglState.scissor_test = GL_FALSE;
+ statechanged = GL_TRUE;
+ }
+ break;
+ }
+ case GL_STENCIL_TEST:
+ {
+ return;
+ /* if (nanoglState.stencil_test)
{
nanoglState.stencil_test = GL_FALSE;
statechanged = GL_TRUE;
}*/
- break;
- }
- case GL_TEXTURE_2D:
- {
- if (activetmuState->texture_2d.value)
- {
- FlushOnStateChange();
- glEsImpl->glDisable(cap);
- activetmuState->texture_2d.value = GL_FALSE;
- return;
+ break;
+ }
+ case GL_TEXTURE_2D:
+ {
+ if ( activetmuState->texture_2d.value )
+ {
+ FlushOnStateChange( );
+ glEsImpl->glDisable( cap );
+ activetmuState->texture_2d.value = GL_FALSE;
+ return;
+ }
+ break;
+ }
+ default:
+ break;
+ }
+ if ( statechanged )
+ {
+ FlushOnStateChange( );
+ glEsImpl->glDisable( cap );
+ }
+}
- }
- break;
- }
- default:
- break;
- }
-
- if (statechanged)
- {
- FlushOnStateChange();
- glEsImpl->glDisable(cap);
- }
- }
-
-void glVertex2f(GLfloat x, GLfloat y)
- {
- glVertex3f(x,y,0.0f);
- }
+void glVertex2f( GLfloat x, GLfloat y )
+{
+ glVertex3f( x, y, 0.0f );
+}
+__FORCEINLINE unsigned int ClampTo255( float value )
+{
+ unsigned int retval = (unsigned int)( value );
+ if ( retval > 255 )
+ {
+ retval = 255;
+ }
+ return retval;
+}
-__FORCEINLINE unsigned int ClampTo255(float value)
- {
- unsigned int retval = (unsigned int)(value);
- if (retval > 255)
- {
- retval = 255;
- }
- return retval;
- }
-
-void glColor3f( GLfloat red, GLfloat green, GLfloat blue)
- {
- currentVertexAttrib.red = (unsigned char)ClampTo255(red*255.0f);
- currentVertexAttrib.green = (unsigned char)ClampTo255(green*255.0f);
- currentVertexAttrib.blue = (unsigned char)ClampTo255(blue*255.0f);
- currentVertexAttrib.alpha = 255;
- }
+void glColor3f( GLfloat red, GLfloat green, GLfloat blue )
+{
+ currentVertexAttrib.red = (unsigned char)ClampTo255( red * 255.0f );
+ currentVertexAttrib.green = (unsigned char)ClampTo255( green * 255.0f );
+ currentVertexAttrib.blue = (unsigned char)ClampTo255( blue * 255.0f );
+ currentVertexAttrib.alpha = 255;
+}
+
+void glTexCoord2fv( const GLfloat *v )
+{
+ memcpy( ¤tVertexAttrib.s, v, 2 * sizeof( float ) );
+}
+void glTexCoord2f( GLfloat s, GLfloat t )
+{
+ currentVertexAttrib.s = s;
+ currentVertexAttrib.t = t;
+}
-void glTexCoord2fv( const GLfloat *v )
- {
- memcpy(¤tVertexAttrib.s, v, 2*sizeof(float));
- }
+void glViewport( GLint x, GLint y, GLsizei width, GLsizei height )
+{
+ FlushOnStateChange( );
+ glEsImpl->glViewport( x, y, width, height );
+}
+void glLoadIdentity( void )
+{
+ FlushOnStateChange( );
+ glEsImpl->glLoadIdentity( );
+}
-void glTexCoord2f(GLfloat s, GLfloat t)
- {
- currentVertexAttrib.s = s;
- currentVertexAttrib.t = t;
- }
-
-void glViewport (GLint x, GLint y, GLsizei width, GLsizei height)
- {
- FlushOnStateChange();
- glEsImpl->glViewport(x,y,width,height);
- }
-
-void glLoadIdentity (void)
- {
- FlushOnStateChange();
- glEsImpl->glLoadIdentity();
- }
-
-void glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
- {
- currentVertexAttrib.red = (unsigned char)ClampTo255(red*255.0f);
- currentVertexAttrib.green = (unsigned char)ClampTo255(green*255.0f);
- currentVertexAttrib.blue = (unsigned char)ClampTo255(blue*255.0f);
- currentVertexAttrib.alpha = (unsigned char)ClampTo255(alpha*255.0f);
- }
+void glColor4f( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha )
+{
+ currentVertexAttrib.red = (unsigned char)ClampTo255( red * 255.0f );
+ currentVertexAttrib.green = (unsigned char)ClampTo255( green * 255.0f );
+ currentVertexAttrib.blue = (unsigned char)ClampTo255( blue * 255.0f );
+ currentVertexAttrib.alpha = (unsigned char)ClampTo255( alpha * 255.0f );
+}
-void glOrtho (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
- {
- FlushOnStateChange();
+void glOrtho( GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar )
+{
+ FlushOnStateChange( );
#ifdef USE_CORE_PROFILE
- glEsImpl->glOrtho(left,right,bottom,top, zNear,zFar);
+ glEsImpl->glOrtho( left, right, bottom, top, zNear, zFar );
#else
- glEsImpl->glOrthof(left,right,bottom,top, zNear,zFar);
+ glEsImpl->glOrthof( left, right, bottom, top, zNear, zFar );
#endif
- }
+}
-void glMatrixMode (GLenum mode)
- {
- if (nanoglState.matrixmode == mode)
- {
- return;
- }
- nanoglState.matrixmode = mode;
- FlushOnStateChange();
- glEsImpl->glMatrixMode(mode);
- }
+void glMatrixMode( GLenum mode )
+{
+ if ( nanoglState.matrixmode == mode )
+ {
+ return;
+ }
+ nanoglState.matrixmode = mode;
+ FlushOnStateChange( );
+ glEsImpl->glMatrixMode( mode );
+}
-void glTexParameterf (GLenum target, GLenum pname, GLfloat param)
- {
- if (pname == GL_TEXTURE_BORDER_COLOR)
- {
- return; // not supported by opengl es
- }
- if ( (pname == GL_TEXTURE_WRAP_S ||
- pname == GL_TEXTURE_WRAP_T) &&
- param == GL_CLAMP)
- {
- param = 0x812F;
- }
+void glTexParameterf( GLenum target, GLenum pname, GLfloat param )
+{
+ if ( pname == GL_TEXTURE_BORDER_COLOR )
+ {
+ return; // not supported by opengl es
+ }
+ if ( ( pname == GL_TEXTURE_WRAP_S ||
+ pname == GL_TEXTURE_WRAP_T ) &&
+ param == GL_CLAMP )
+ {
+ param = 0x812F;
+ }
- FlushOnStateChange();
- glEsImpl->glTexParameterf(target, pname,param);
- }
-
-void glTexParameterfv( GLenum target, GLenum pname, const GLfloat *params)
- {
- glTexParameterf(target, pname, params[0]);
- }
+ FlushOnStateChange( );
+ glEsImpl->glTexParameterf( target, pname, param );
+}
-void glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
- {
- FlushOnStateChange();
- internalformat = format;
- glEsImpl->glTexImage2D(target, level, internalformat, width, height,border,format,type,pixels);
- }
+void glTexParameterfv( GLenum target, GLenum pname, const GLfloat *params )
+{
+ glTexParameterf( target, pname, params[0] );
+}
-void glDrawBuffer(GLenum /*mode*/)
- {
- }
+void glTexImage2D( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels )
+{
+ FlushOnStateChange( );
+ internalformat = format;
+ glEsImpl->glTexImage2D( target, level, internalformat, width, height, border, format, type, pixels );
+}
-void glTranslatef (GLfloat x, GLfloat y, GLfloat z)
- {
- FlushOnStateChange();
- glEsImpl->glTranslatef(x,y,z);
- }
-
-void glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
- {
- FlushOnStateChange();
- glEsImpl->glRotatef(angle, x, y, z);
- }
+void glDrawBuffer( GLenum /*mode*/ )
+{
+}
-void glScalef (GLfloat x, GLfloat y, GLfloat z)
- {
- FlushOnStateChange();
- glEsImpl->glScalef(x,y,z);
- }
-
-void glDepthRange(GLclampf zNear, GLclampf zFar)
- {
- if ((nanoglState.depth_range_near == zNear) &&(nanoglState.depth_range_far == zFar))
- {
- return;
- }
- else
- {
- nanoglState.depth_range_near = zNear;
- nanoglState.depth_range_far = zFar;
- }
- FlushOnStateChange();
+void glTranslatef( GLfloat x, GLfloat y, GLfloat z )
+{
+ FlushOnStateChange( );
+ glEsImpl->glTranslatef( x, y, z );
+}
+
+void glRotatef( GLfloat angle, GLfloat x, GLfloat y, GLfloat z )
+{
+ FlushOnStateChange( );
+ glEsImpl->glRotatef( angle, x, y, z );
+}
+
+void glScalef( GLfloat x, GLfloat y, GLfloat z )
+{
+ FlushOnStateChange( );
+ glEsImpl->glScalef( x, y, z );
+}
+
+void glDepthRange( GLclampf zNear, GLclampf zFar )
+{
+ if ( ( nanoglState.depth_range_near == zNear ) && ( nanoglState.depth_range_far == zFar ) )
+ {
+ return;
+ }
+ else
+ {
+ nanoglState.depth_range_near = zNear;
+ nanoglState.depth_range_far = zFar;
+ }
+ FlushOnStateChange( );
#ifdef USE_CORE_PROFILE
- glEsImpl->glDepthRange(zNear, zFar);
+ glEsImpl->glDepthRange( zNear, zFar );
#else
- glEsImpl->glDepthRangef(zNear, zFar);
+ glEsImpl->glDepthRangef( zNear, zFar );
#endif
- }
-
-void glDepthFunc (GLenum func)
- {
- if (nanoglState.depth_func == func)
- {
- return;
- }
- else
- {
- nanoglState.depth_func = func;
- }
- FlushOnStateChange();
- glEsImpl->glDepthFunc(func);
- }
+}
-void glFinish (void)
- {
- FlushOnStateChange();
- glEsImpl->glFinish();
- }
+void glDepthFunc( GLenum func )
+{
+ if ( nanoglState.depth_func == func )
+ {
+ return;
+ }
+ else
+ {
+ nanoglState.depth_func = func;
+ }
+ FlushOnStateChange( );
+ glEsImpl->glDepthFunc( func );
+}
-void glGetFloatv (GLenum pname, GLfloat *params)
- {
- FlushOnStateChange();
- glEsImpl->glGetFloatv(pname, params);
- }
+void glFinish( void )
+{
+ FlushOnStateChange( );
+ glEsImpl->glFinish( );
+}
-void glCullFace (GLenum mode)
- {
- if (nanoglState.cullface == mode)
- {
- return;
- }
- else
- {
- nanoglState.cullface = mode;
- }
- FlushOnStateChange();
- glEsImpl->glCullFace(mode);
- }
+void glGetFloatv( GLenum pname, GLfloat *params )
+{
+ FlushOnStateChange( );
+ glEsImpl->glGetFloatv( pname, params );
+}
-void glFrustum (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
- {
- FlushOnStateChange();
- glEsImpl->glFrustumf(left,right,bottom,top,zNear,zFar);
- }
+void glCullFace( GLenum mode )
+{
+ if ( nanoglState.cullface == mode )
+ {
+ return;
+ }
+ else
+ {
+ nanoglState.cullface = mode;
+ }
+ FlushOnStateChange( );
+ glEsImpl->glCullFace( mode );
+}
-void glClear (GLbitfield mask)
- {
- FlushOnStateChange();
- glEsImpl->glClear(mask);
- }
+void glFrustum( GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar )
+{
+ FlushOnStateChange( );
+ glEsImpl->glFrustumf( left, right, bottom, top, zNear, zFar );
+}
+void glClear( GLbitfield mask )
+{
+ FlushOnStateChange( );
+ glEsImpl->glClear( mask );
+}
void glVertex3f( GLfloat x, GLfloat y, GLfloat z )
- {
- GLfloat* vert = (GLfloat*)ptrVertexAttribArray++;
- *vert++ = x;
- *vert++ = y;
- *vert++ = z;
-#if defined(__MULTITEXTURE_SUPPORT__)
- memcpy(vert, ¤tVertexAttrib.red, 5*sizeof(GLfloat));
+{
+ GLfloat *vert = (GLfloat *)ptrVertexAttribArray++;
+ *vert++ = x;
+ *vert++ = y;
+ *vert++ = z;
+#if defined( __MULTITEXTURE_SUPPORT__ )
+ memcpy( vert, ¤tVertexAttrib.red, 5 * sizeof( GLfloat ) );
#else
- memcpy(vert+1, ¤tVertexAttrib.red, 3*sizeof(GLfloat));
+ memcpy( vert + 1, ¤tVertexAttrib.red, 3 * sizeof( GLfloat ) );
#endif
-
- }
+}
void glColor4fv( const GLfloat *v )
- {
- currentVertexAttrib.red = (unsigned char)ClampTo255(v[0]*255.0f);
- currentVertexAttrib.green = (unsigned char)ClampTo255(v[1]*255.0f);
- currentVertexAttrib.blue = (unsigned char)ClampTo255(v[2]*255.0f);
- currentVertexAttrib.alpha = (unsigned char)ClampTo255(v[3]*255.0f);
- }
-
-void glColor3ubv( const GLubyte* v)
- {
- currentVertexAttrib.red = v[0];
- currentVertexAttrib.green = v[1];
- currentVertexAttrib.blue = v[2];
- currentVertexAttrib.alpha = 255;
- }
-
-void glColor4ubv( const GLubyte *v )
- {
- //*((unsigned int*)(¤tVertexAttrib.red)) = *((unsigned int*)(v));
- currentVertexAttrib.red = v[0];
- currentVertexAttrib.green = v[1];
- currentVertexAttrib.blue = v[2];
- currentVertexAttrib.alpha = v[3];
- }
-
-void glColor3fv( const GLfloat *v )
- {
- currentVertexAttrib.red = (unsigned char)ClampTo255(v[0]*255.0f);
- currentVertexAttrib.green = (unsigned char)ClampTo255(v[1]*255.0f);
- currentVertexAttrib.blue = (unsigned char)ClampTo255(v[2]*255.0f);
- currentVertexAttrib.alpha = 255;
- }
+{
+ currentVertexAttrib.red = (unsigned char)ClampTo255( v[0] * 255.0f );
+ currentVertexAttrib.green = (unsigned char)ClampTo255( v[1] * 255.0f );
+ currentVertexAttrib.blue = (unsigned char)ClampTo255( v[2] * 255.0f );
+ currentVertexAttrib.alpha = (unsigned char)ClampTo255( v[3] * 255.0f );
+}
+
+void glColor3ubv( const GLubyte *v )
+{
+ currentVertexAttrib.red = v[0];
+ currentVertexAttrib.green = v[1];
+ currentVertexAttrib.blue = v[2];
+ currentVertexAttrib.alpha = 255;
+}
+
+void glColor4ubv( const GLubyte *v )
+{
+ //*((unsigned int*)(¤tVertexAttrib.red)) = *((unsigned int*)(v));
+ currentVertexAttrib.red = v[0];
+ currentVertexAttrib.green = v[1];
+ currentVertexAttrib.blue = v[2];
+ currentVertexAttrib.alpha = v[3];
+}
+
+void glColor3fv( const GLfloat *v )
+{
+ currentVertexAttrib.red = (unsigned char)ClampTo255( v[0] * 255.0f );
+ currentVertexAttrib.green = (unsigned char)ClampTo255( v[1] * 255.0f );
+ currentVertexAttrib.blue = (unsigned char)ClampTo255( v[2] * 255.0f );
+ currentVertexAttrib.alpha = 255;
+}
//-- nicknekit: xash3d funcs --
-void glColor4ub( GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)
- {
- currentVertexAttrib.red = red;
- currentVertexAttrib.green = green;
- currentVertexAttrib.blue = blue;
- currentVertexAttrib.alpha = alpha;
- }
+void glColor4ub( GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha )
+{
+ currentVertexAttrib.red = red;
+ currentVertexAttrib.green = green;
+ currentVertexAttrib.blue = blue;
+ currentVertexAttrib.alpha = alpha;
+}
-void glColor3ub( GLubyte red, GLubyte green, GLubyte blue)
- {
- currentVertexAttrib.red = red;
- currentVertexAttrib.green = green;
- currentVertexAttrib.blue = blue;
- currentVertexAttrib.alpha = 255;
- }
+void glColor3ub( GLubyte red, GLubyte green, GLubyte blue )
+{
+ currentVertexAttrib.red = red;
+ currentVertexAttrib.green = green;
+ currentVertexAttrib.blue = blue;
+ currentVertexAttrib.alpha = 255;
+}
-void glNormal3fv( const GLfloat *v )
- {
- FlushOnStateChange();
- glEsImpl->glNormal3f(v[0],v[1],v[2]);
- }
+void glNormal3fv( const GLfloat *v )
+{
+ FlushOnStateChange( );
+ glEsImpl->glNormal3f( v[0], v[1], v[2] );
+}
void glCopyTexImage2D( GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border )
- {
- FlushOnStateChange();
- glEsImpl->glCopyTexImage2D(target, level, internalformat, x, y, width, height, border);
- }
+{
+ FlushOnStateChange( );
+ glEsImpl->glCopyTexImage2D( target, level, internalformat, x, y, width, height, border );
+}
-void glTexImage1D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
- {
- glTexImage2D(GL_TEXTURE_2D, level, internalformat, width, 1, border, format, type, pixels);
- }
+void glTexImage1D( GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels )
+{
+ glTexImage2D( GL_TEXTURE_2D, level, internalformat, width, 1, border, format, type, pixels );
+}
-void glTexImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
- {
- glTexImage2D(GL_TEXTURE_2D, level, internalformat, width, height, border, format, type, pixels);
- }
+void glTexImage3D( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels )
+{
+ glTexImage2D( GL_TEXTURE_2D, level, internalformat, width, height, border, format, type, pixels );
+}
void glTexSubImage1D( GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels )
- {
- glTexSubImage2D(target,level,xoffset,0,width,1,format,type,pixels);
- }
+{
+ glTexSubImage2D( target, level, xoffset, 0, width, 1, format, type, pixels );
+}
void glTexSubImage3D( GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLint zoffset, GLsizei width,
- GLsizei height, GLsizei depth,
- GLenum format,
- GLenum type, const GLvoid *pixels)
- {
- glTexSubImage2D(target,level,xoffset,yoffset,width,height,format,type,pixels);
- }
-
-
-
-GLboolean glIsTexture(GLuint texture)
- {
- FlushOnStateChange();
- return glEsImpl->glIsTexture(texture);
- }
+ GLint xoffset, GLint yoffset,
+ GLint zoffset, GLsizei width,
+ GLsizei height, GLsizei depth,
+ GLenum format,
+ GLenum type, const GLvoid *pixels )
+{
+ glTexSubImage2D( target, level, xoffset, yoffset, width, height, format, type, pixels );
+}
+GLboolean glIsTexture( GLuint texture )
+{
+ FlushOnStateChange( );
+ return glEsImpl->glIsTexture( texture );
+}
void glTexGeni( GLenum coord, GLenum pname, GLint param )
{
-//for mirrors? not needed for original hl?
+ //for mirrors? not needed for original hl?
}
void glTexGenfv( GLenum coord, GLenum pname, const GLfloat *params )
{
-//for mirrors? not needed for original hl?
+ //for mirrors? not needed for original hl?
}
//-- --//
-void glHint (GLenum target, GLenum mode)
- {
- FlushOnStateChange();
- glEsImpl->glHint(target, mode);
- }
+void glHint( GLenum target, GLenum mode )
+{
+ FlushOnStateChange( );
+ glEsImpl->glHint( target, mode );
+}
-void glBlendFunc (GLenum sfactor, GLenum dfactor)
- {
- if ((nanoglState.sfactor == sfactor) && (nanoglState.dfactor == dfactor))
- {
- return;
- }
- nanoglState.sfactor = sfactor;
- nanoglState.dfactor = dfactor;
- FlushOnStateChange();
- glEsImpl->glBlendFunc(sfactor, dfactor);
- }
+void glBlendFunc( GLenum sfactor, GLenum dfactor )
+{
+ if ( ( nanoglState.sfactor == sfactor ) && ( nanoglState.dfactor == dfactor ) )
+ {
+ return;
+ }
+ nanoglState.sfactor = sfactor;
+ nanoglState.dfactor = dfactor;
+ FlushOnStateChange( );
+ glEsImpl->glBlendFunc( sfactor, dfactor );
+}
-void glPopMatrix (void)
- {
- FlushOnStateChange();
- glEsImpl->glPopMatrix();
- }
+void glPopMatrix( void )
+{
+ FlushOnStateChange( );
+ glEsImpl->glPopMatrix( );
+}
-void glShadeModel (GLenum mode)
- {
- if (nanoglState.shademodel == mode)
- {
- return;
- }
- nanoglState.shademodel = mode;
- FlushOnStateChange();
- glEsImpl->glShadeModel(mode);
- }
+void glShadeModel( GLenum mode )
+{
+ if ( nanoglState.shademodel == mode )
+ {
+ return;
+ }
+ nanoglState.shademodel = mode;
+ FlushOnStateChange( );
+ glEsImpl->glShadeModel( mode );
+}
-void glPushMatrix (void)
- {
- FlushOnStateChange();
- glEsImpl->glPushMatrix();
- }
+void glPushMatrix( void )
+{
+ FlushOnStateChange( );
+ glEsImpl->glPushMatrix( );
+}
-void glTexEnvf (GLenum target, GLenum pname, GLfloat param)
- {
- if (target == GL_TEXTURE_ENV)
- {
- if (pname == GL_TEXTURE_ENV_MODE)
- {
- if (param == activetmuState->texture_env_mode.value)
- {
- return;
- }
- else
- {
- FlushOnStateChange();
- glEsImpl->glTexEnvf(target, pname, param);
- activetmuState->texture_env_mode.value = param;
- return;
- }
- }
- }
- FlushOnStateChange();
- glEsImpl->glTexEnvf(target, pname, param);
- }
+void glTexEnvf( GLenum target, GLenum pname, GLfloat param )
+{
+ if ( target == GL_TEXTURE_ENV )
+ {
+ if ( pname == GL_TEXTURE_ENV_MODE )
+ {
+ if ( param == activetmuState->texture_env_mode.value )
+ {
+ return;
+ }
+ else
+ {
+ FlushOnStateChange( );
+ glEsImpl->glTexEnvf( target, pname, param );
+ activetmuState->texture_env_mode.value = param;
+ return;
+ }
+ }
+ }
+ FlushOnStateChange( );
+ glEsImpl->glTexEnvf( target, pname, param );
+}
void glVertex3fv( const GLfloat *v )
- {
- GLfloat* vert = (GLfloat*)ptrVertexAttribArray++;
- memcpy(vert, v, 3*sizeof(GLfloat));
-#if defined(__MULTITEXTURE_SUPPORT__)
- memcpy(vert+3, ¤tVertexAttrib.red, 5*sizeof(GLfloat));
+{
+ GLfloat *vert = (GLfloat *)ptrVertexAttribArray++;
+ memcpy( vert, v, 3 * sizeof( GLfloat ) );
+#if defined( __MULTITEXTURE_SUPPORT__ )
+ memcpy( vert + 3, ¤tVertexAttrib.red, 5 * sizeof( GLfloat ) );
#else
- memcpy(vert+4, ¤tVertexAttrib.red, 3*sizeof(GLfloat));
+ memcpy( vert + 4, ¤tVertexAttrib.red, 3 * sizeof( GLfloat ) );
#endif
- }
-
-
-void glDepthMask (GLboolean flag)
- {
- if (nanoglState.depthmask == flag)
- {
- return;
- }
- nanoglState.depthmask = flag;
- FlushOnStateChange();
- glEsImpl->glDepthMask(flag);
- }
+}
-void glBindTexture (GLenum target, GLuint texture)
- {
- if (activetmuState->boundtexture.value == texture)
- {
- return;
- }
- FlushOnStateChange();
- activetmuState->boundtexture.value = texture;
- glEsImpl->glBindTexture(target, texture);
- }
+void glDepthMask( GLboolean flag )
+{
+ if ( nanoglState.depthmask == flag )
+ {
+ return;
+ }
+ nanoglState.depthmask = flag;
+ FlushOnStateChange( );
+ glEsImpl->glDepthMask( flag );
+}
+void glBindTexture( GLenum target, GLuint texture )
+{
+ if ( activetmuState->boundtexture.value == texture )
+ {
+ return;
+ }
+ FlushOnStateChange( );
+ activetmuState->boundtexture.value = texture;
+ glEsImpl->glBindTexture( target, texture );
+}
-void glGetIntegerv (GLenum pname, GLint *params)
- {
- FlushOnStateChange();
- glEsImpl->glGetIntegerv(pname, params);
- }
+void glGetIntegerv( GLenum pname, GLint *params )
+{
+ FlushOnStateChange( );
+ glEsImpl->glGetIntegerv( pname, params );
+}
GLubyte nano_extensions_string[4096];
-const GLubyte* glGetString (GLenum name)
- {
+const GLubyte *glGetString( GLenum name )
+{
- if (name == GL_EXTENSIONS)
- {
-#if defined(__MULTITEXTURE_SUPPORT__)
- sprintf((char*)nano_extensions_string,"%s %s",glEsImpl->glGetString(name),"GL_ARB_multitexture EXT_texture_env_add");
+ if ( name == GL_EXTENSIONS )
+ {
+#if defined( __MULTITEXTURE_SUPPORT__ )
+ sprintf( (char *)nano_extensions_string, "%s %s", glEsImpl->glGetString( name ), "GL_ARB_multitexture EXT_texture_env_add" );
#else
- sprintf((char*)nano_extensions_string,"%s %s",glEsImpl->glGetString(name),"EXT_texture_env_add");
+ sprintf( (char *)nano_extensions_string, "%s %s", glEsImpl->glGetString( name ), "EXT_texture_env_add" );
#endif
- return nano_extensions_string;
- }
- return glEsImpl->glGetString(name);
- }
+ return nano_extensions_string;
+ }
+ return glEsImpl->glGetString( name );
+}
-void glAlphaFunc (GLenum func, GLclampf ref)
- {
- FlushOnStateChange();
- glEsImpl->glAlphaFunc(func,ref);
- }
+void glAlphaFunc( GLenum func, GLclampf ref )
+{
+ FlushOnStateChange( );
+ glEsImpl->glAlphaFunc( func, ref );
+}
-void glFlush (void)
- {
- FlushOnStateChange();
- glEsImpl->glFlush();
- }
+void glFlush( void )
+{
+ FlushOnStateChange( );
+ glEsImpl->glFlush( );
+}
-void glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels)
- {
- if (format == GL_DEPTH_COMPONENT)
- {
- // OpenglEs 1.1 does not support reading depth buffer without an extension
- memset(pixels, 0xff,4);
- return;
- }
- FlushOnStateChange();
- glEsImpl->glReadPixels(x,y,width,height,format,type,pixels);
- }
+void glReadPixels( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels )
+{
+ if ( format == GL_DEPTH_COMPONENT )
+ {
+ // OpenglEs 1.1 does not support reading depth buffer without an extension
+ memset( pixels, 0xff, 4 );
+ return;
+ }
+ FlushOnStateChange( );
+ glEsImpl->glReadPixels( x, y, width, height, format, type, pixels );
+}
void glReadBuffer( GLenum /*mode*/ )
- {
-
- }
+{
+}
-void glLoadMatrixf (const GLfloat *m)
- {
- FlushOnStateChange();
- glEsImpl->glLoadMatrixf(m);
- }
+void glLoadMatrixf( const GLfloat *m )
+{
+ FlushOnStateChange( );
+ glEsImpl->glLoadMatrixf( m );
+}
-void glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels)
- {
- FlushOnStateChange();
- glEsImpl->glTexSubImage2D(target,level,xoffset,yoffset,width,height,format,type,pixels);
- }
+void glTexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels )
+{
+ FlushOnStateChange( );
+ glEsImpl->glTexSubImage2D( target, level, xoffset, yoffset, width, height, format, type, pixels );
+}
-void glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
- {
- FlushOnStateChange();
- glEsImpl->glClearColor(red,green,blue,alpha);
- }
+void glClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha )
+{
+ FlushOnStateChange( );
+ glEsImpl->glClearColor( red, green, blue, alpha );
+}
-GLenum glGetError (void)
- {
- //FlushOnStateChange();
- return GL_NO_ERROR;//glEsImpl->glGetError();
- }
+GLenum glGetError( void )
+{
+ //FlushOnStateChange();
+ return GL_NO_ERROR; //glEsImpl->glGetError();
+}
+
+void glActiveTexture( GLenum texture )
+{
+ if ( activetmu == texture )
+ {
+ return;
+ }
+ if ( delayedttmuchange )
+ {
+ delayedttmuchange = GL_FALSE;
+ }
+ else
+ {
+ delayedttmuchange = GL_TRUE;
+ delayedtmutarget = texture;
+ }
+ if ( texture == GL_TEXTURE0 )
+ {
+ activetmuState = &tmuState0;
+ }
+ else
+ {
+ activetmuState = &tmuState1;
+ }
+ activetmu = texture;
+}
+
+void glClientActiveTexture( GLenum texture )
+{
+ clientactivetmu = texture;
+}
-void glActiveTexture (GLenum texture)
- {
- if (activetmu == texture)
- {
- return;
- }
- if (delayedttmuchange)
- {
- delayedttmuchange = GL_FALSE;
- }
- else
- {
- delayedttmuchange = GL_TRUE;
- delayedtmutarget = texture;
- }
- if (texture == GL_TEXTURE0)
- {
- activetmuState = &tmuState0;
- }
- else
- {
- activetmuState = &tmuState1;
- }
- activetmu = texture;
- }
-
-void glClientActiveTexture (GLenum texture)
- {
- clientactivetmu = texture;
- }
-
void glPolygonMode( GLenum face, GLenum mode )
- {
- }
+{
+}
-void glDeleteTextures( GLsizei n, const GLuint *textures )
- {
- FlushOnStateChange();
- glEsImpl->glDeleteTextures(n,textures);
- }
+void glDeleteTextures( GLsizei n, const GLuint *textures )
+{
+ FlushOnStateChange( );
+ glEsImpl->glDeleteTextures( n, textures );
+}
-void glClearDepth( GLclampf depth )
- {
- FlushOnStateChange();
- glEsImpl->glClearDepthf( depth );
- }
+void glClearDepth( GLclampf depth )
+{
+ FlushOnStateChange( );
+ glEsImpl->glClearDepthf( depth );
+}
-void glClipPlane( GLenum plane, const GLdouble *equation )
- {
- FlushOnStateChange();
- float array[4];
- array[0] = (GLfloat)(equation[0]);
- array[1] = (GLfloat)(equation[1]);
- array[2] = (GLfloat)(equation[2]);
- array[3] = (GLfloat)(equation[3]);
- glEsImpl->glClipPlanef( plane, array );
- }
-
-void glScissor( GLint x, GLint y, GLsizei width, GLsizei height )
- {
- FlushOnStateChange();
- glEsImpl->glScissor( x, y, width,height);
- }
+void glClipPlane( GLenum plane, const GLdouble *equation )
+{
+ FlushOnStateChange( );
+ float array[4];
+ array[0] = ( GLfloat )( equation[0] );
+ array[1] = ( GLfloat )( equation[1] );
+ array[2] = ( GLfloat )( equation[2] );
+ array[3] = ( GLfloat )( equation[3] );
+ glEsImpl->glClipPlanef( plane, array );
+}
+
+void glScissor( GLint x, GLint y, GLsizei width, GLsizei height )
+{
+ FlushOnStateChange( );
+ glEsImpl->glScissor( x, y, width, height );
+}
+
+void glPointSize( GLfloat size )
+{
+ FlushOnStateChange( );
+ glEsImpl->glPointSize( size );
+}
+
+void glArrayElement( GLint i )
+{
+}
+void glLineWidth( GLfloat width )
+{
+}
+void glCallList( GLuint list )
+{
+}
+void glColorMask( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha )
+{
+}
+void glStencilFunc( GLenum func, GLint ref, GLuint mask )
+{
+}
+void glStencilOp( GLenum fail, GLenum zfail, GLenum zpass )
+{
+}
+
+struct ptrstate vertex_array;
+struct ptrstate color_array;
+struct ptrstate texture_coord_array;
+
+void glDrawElements( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices )
+{
+ // ensure that all primitives specified between glBegin/glEnd pairs
+ // are rendered first, and that we have correct tmu in use..
+ FlushOnStateChange( );
+ // setup correct vertex/color/texcoord pointers
+ if ( arraysValid ||
+ tmuState0.vertex_array.changed ||
+ tmuState0.color_array.changed ||
+ tmuState0.texture_coord_array.changed || tmuState0.normal_array.changed )
+ {
+ glEsImpl->glClientActiveTexture( GL_TEXTURE0 );
+ }
+ if ( arraysValid || tmuState0.vertex_array.changed )
+ {
+ if ( tmuState0.vertex_array.enabled )
+ {
+ glEsImpl->glEnableClientState( GL_VERTEX_ARRAY );
+ }
+ else
+ {
+ glEsImpl->glDisableClientState( GL_VERTEX_ARRAY );
+ }
+ glEsImpl->glVertexPointer( tmuState0.vertex_array.size,
+ tmuState0.vertex_array.type,
+ tmuState0.vertex_array.stride,
+ tmuState0.vertex_array.ptr );
+ tmuState0.vertex_array.changed = GL_FALSE;
+ }
+ if ( arraysValid || tmuState0.color_array.changed )
+ {
+ if ( tmuState0.color_array.enabled )
+ {
+ glEsImpl->glEnableClientState( GL_COLOR_ARRAY );
+ }
+ else
+ {
+ glEsImpl->glDisableClientState( GL_COLOR_ARRAY );
+ }
+ glEsImpl->glColorPointer( tmuState0.color_array.size,
+ tmuState0.color_array.type,
+ tmuState0.color_array.stride,
+ tmuState0.color_array.ptr );
+ tmuState0.color_array.changed = GL_FALSE;
+ }
+ if ( arraysValid || tmuState0.normal_array.changed )
+ {
+ if ( tmuState0.normal_array.enabled )
+ {
+ glEsImpl->glEnableClientState( GL_NORMAL_ARRAY );
+ }
+ else
+ {
+ glEsImpl->glDisableClientState( GL_NORMAL_ARRAY );
+ }
+ glEsImpl->glNormalPointer( tmuState0.normal_array.type,
+ tmuState0.normal_array.stride,
+ tmuState0.normal_array.ptr );
+ tmuState0.normal_array.changed = GL_FALSE;
+ }
+ if ( arraysValid || tmuState0.texture_coord_array.changed )
+ {
+ tmuState0.texture_coord_array.changed = GL_FALSE;
+ if ( tmuState0.texture_coord_array.enabled )
+ {
+ glEsImpl->glEnableClientState( GL_TEXTURE_COORD_ARRAY );
+ }
+ else
+ {
+ glEsImpl->glDisableClientState( GL_TEXTURE_COORD_ARRAY );
+ }
+ glEsImpl->glTexCoordPointer( tmuState0.texture_coord_array.size,
+ tmuState0.texture_coord_array.type,
+ tmuState0.texture_coord_array.stride,
+ tmuState0.texture_coord_array.ptr );
+ }
-void glPointSize( GLfloat size )
- {
- FlushOnStateChange();
- glEsImpl->glPointSize( size );
- }
+ if ( arraysValid || tmuState1.texture_coord_array.changed )
+ {
+ tmuState1.texture_coord_array.changed = GL_FALSE;
+ glEsImpl->glClientActiveTexture( GL_TEXTURE1 );
+ if ( tmuState1.texture_coord_array.enabled )
+ {
+ glEsImpl->glEnableClientState( GL_TEXTURE_COORD_ARRAY );
+ }
+ else
+ {
+ glEsImpl->glDisableClientState( GL_TEXTURE_COORD_ARRAY );
+ }
+ glEsImpl->glTexCoordPointer( tmuState1.texture_coord_array.size,
+ tmuState1.texture_coord_array.type,
+ tmuState1.texture_coord_array.stride,
+ tmuState1.texture_coord_array.ptr );
+ }
-void glArrayElement(GLint i) {}
-void glLineWidth(GLfloat width) {}
-void glCallList( GLuint list ) {}
-void glColorMask( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha ) {}
-void glStencilFunc( GLenum func, GLint ref, GLuint mask ) {}
-void glStencilOp( GLenum fail, GLenum zfail, GLenum zpass ) {}
+ arraysValid = GL_FALSE;
+ glEsImpl->glDrawElements( mode, count, type, indices );
+}
-struct ptrstate vertex_array;
-struct ptrstate color_array;
-struct ptrstate texture_coord_array;
+void glEnableClientState( GLenum array )
+{
+ struct nanotmuState *clientstate = NULL;
+ if ( clientactivetmu == GL_TEXTURE0 )
+ {
+ clientstate = &tmuState0;
+ }
+ else if ( clientactivetmu == GL_TEXTURE1 )
+ {
+ clientstate = &tmuState1;
+ }
+ else
+ {
+ return;
+ }
+ switch ( array )
+ {
+ case GL_VERTEX_ARRAY:
+ if ( clientstate->vertex_array.enabled )
+ {
+ return;
+ }
+ clientstate->vertex_array.enabled = GL_TRUE;
+ clientstate->vertex_array.changed = GL_TRUE;
+ break;
+ case GL_COLOR_ARRAY:
+ if ( clientstate->color_array.enabled )
+ {
+ return;
+ }
+ clientstate->color_array.enabled = GL_TRUE;
+ clientstate->color_array.changed = GL_TRUE;
-void glDrawElements( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices )
- {
- // ensure that all primitives specified between glBegin/glEnd pairs
- // are rendered first, and that we have correct tmu in use..
- FlushOnStateChange();
- // setup correct vertex/color/texcoord pointers
- if (arraysValid ||
- tmuState0.vertex_array.changed ||
- tmuState0.color_array.changed ||
- tmuState0.texture_coord_array.changed || tmuState0.normal_array.changed)
- {
- glEsImpl->glClientActiveTexture(GL_TEXTURE0);
- }
- if (arraysValid || tmuState0.vertex_array.changed)
- {
- if (tmuState0.vertex_array.enabled)
- {
- glEsImpl->glEnableClientState(GL_VERTEX_ARRAY);
- }
- else
- {
- glEsImpl->glDisableClientState(GL_VERTEX_ARRAY);
- }
- glEsImpl->glVertexPointer(tmuState0.vertex_array.size,
- tmuState0.vertex_array.type,
- tmuState0.vertex_array.stride,
- tmuState0.vertex_array.ptr);
- tmuState0.vertex_array.changed = GL_FALSE;
- }
- if (arraysValid || tmuState0.color_array.changed)
- {
- if (tmuState0.color_array.enabled)
- {
- glEsImpl->glEnableClientState(GL_COLOR_ARRAY);
- }
- else
- {
- glEsImpl->glDisableClientState(GL_COLOR_ARRAY);
- }
- glEsImpl->glColorPointer(tmuState0.color_array.size,
- tmuState0.color_array.type,
- tmuState0.color_array.stride,
- tmuState0.color_array.ptr);
- tmuState0.color_array.changed = GL_FALSE;
- }
- if (arraysValid || tmuState0.normal_array.changed)
- {
- if (tmuState0.normal_array.enabled)
- {
- glEsImpl->glEnableClientState(GL_NORMAL_ARRAY);
- }
- else
- {
- glEsImpl->glDisableClientState(GL_NORMAL_ARRAY);
- }
- glEsImpl->glNormalPointer(tmuState0.normal_array.type,
- tmuState0.normal_array.stride,
- tmuState0.normal_array.ptr);
- tmuState0.normal_array.changed = GL_FALSE;
- }
- if (arraysValid || tmuState0.texture_coord_array.changed)
- {
- tmuState0.texture_coord_array.changed = GL_FALSE;
- if (tmuState0.texture_coord_array.enabled)
- {
- glEsImpl->glEnableClientState(GL_TEXTURE_COORD_ARRAY);
- }
- else
- {
- glEsImpl->glDisableClientState(GL_TEXTURE_COORD_ARRAY);
- }
- glEsImpl->glTexCoordPointer(tmuState0.texture_coord_array.size,
- tmuState0.texture_coord_array.type,
- tmuState0.texture_coord_array.stride,
- tmuState0.texture_coord_array.ptr);
- }
-
- if (arraysValid || tmuState1.texture_coord_array.changed)
- {
- tmuState1.texture_coord_array.changed = GL_FALSE;
- glEsImpl->glClientActiveTexture(GL_TEXTURE1);
- if (tmuState1.texture_coord_array.enabled)
- {
- glEsImpl->glEnableClientState(GL_TEXTURE_COORD_ARRAY);
- }
- else
- {
- glEsImpl->glDisableClientState(GL_TEXTURE_COORD_ARRAY);
- }
- glEsImpl->glTexCoordPointer(tmuState1.texture_coord_array.size,
- tmuState1.texture_coord_array.type,
- tmuState1.texture_coord_array.stride,
- tmuState1.texture_coord_array.ptr);
- }
-
- arraysValid = GL_FALSE;
- glEsImpl->glDrawElements(mode, count, type, indices);
- }
-
-void glEnableClientState(GLenum array)
- {
- struct nanotmuState* clientstate = NULL;
- if (clientactivetmu == GL_TEXTURE0)
- {
- clientstate = &tmuState0;
- }
- else if (clientactivetmu == GL_TEXTURE1)
- {
- clientstate = &tmuState1;
- }
- else
- {
- return;
- }
- switch (array)
- {
- case GL_VERTEX_ARRAY:
- if (clientstate->vertex_array.enabled)
- {
- return;
- }
- clientstate->vertex_array.enabled = GL_TRUE;
- clientstate->vertex_array.changed = GL_TRUE;
- break;
- case GL_COLOR_ARRAY:
- if (clientstate->color_array.enabled)
- {
- return;
- }
- clientstate->color_array.enabled = GL_TRUE;
- clientstate->color_array.changed = GL_TRUE;
+ break;
+ case GL_NORMAL_ARRAY:
+ if ( clientstate->normal_array.enabled )
+ {
+ return;
+ }
+ clientstate->normal_array.enabled = GL_TRUE;
+ clientstate->normal_array.changed = GL_TRUE;
- break;
- case GL_NORMAL_ARRAY:
- if (clientstate->normal_array.enabled)
- {
- return;
- }
- clientstate->normal_array.enabled = GL_TRUE;
- clientstate->normal_array.changed = GL_TRUE;
+ break;
+ case GL_TEXTURE_COORD_ARRAY:
+ if ( clientstate->texture_coord_array.enabled )
+ {
+ return;
+ }
+ clientstate->texture_coord_array.enabled = GL_TRUE;
+ clientstate->texture_coord_array.changed = GL_TRUE;
+ break;
+ default:
+ break;
+ }
+}
+void glDisableClientState( GLenum array )
+{
+ struct nanotmuState *clientstate = NULL;
+ if ( clientactivetmu == GL_TEXTURE0 )
+ {
+ clientstate = &tmuState0;
+ }
+ else if ( clientactivetmu == GL_TEXTURE1 )
+ {
+ clientstate = &tmuState1;
+ }
+ else
+ {
+ return;
+ }
+ switch ( array )
+ {
+ case GL_VERTEX_ARRAY:
+ if ( !clientstate->vertex_array.enabled )
+ {
+ return;
+ }
+ clientstate->vertex_array.enabled = GL_FALSE;
+ clientstate->vertex_array.changed = GL_TRUE;
+ break;
+ case GL_COLOR_ARRAY:
+ if ( !clientstate->color_array.enabled )
+ {
+ return;
+ }
+ clientstate->color_array.enabled = GL_FALSE;
+ clientstate->color_array.changed = GL_TRUE;
- break;
- case GL_TEXTURE_COORD_ARRAY:
- if (clientstate->texture_coord_array.enabled)
- {
- return;
- }
- clientstate->texture_coord_array.enabled = GL_TRUE;
- clientstate->texture_coord_array.changed = GL_TRUE;
- break;
- default:
- break;
- }
- }
-void glDisableClientState(GLenum array)
- {
- struct nanotmuState* clientstate = NULL;
- if (clientactivetmu == GL_TEXTURE0)
- {
- clientstate = &tmuState0;
- }
- else if (clientactivetmu == GL_TEXTURE1)
- {
- clientstate = &tmuState1;
- }
- else
- {
- return;
- }
- switch (array)
- {
- case GL_VERTEX_ARRAY:
- if (!clientstate->vertex_array.enabled)
- {
- return;
- }
- clientstate->vertex_array.enabled = GL_FALSE;
- clientstate->vertex_array.changed = GL_TRUE;
- break;
- case GL_COLOR_ARRAY:
- if (!clientstate->color_array.enabled)
- {
- return;
- }
- clientstate->color_array.enabled = GL_FALSE;
- clientstate->color_array.changed = GL_TRUE;
+ break;
+ case GL_NORMAL_ARRAY:
+ if ( !clientstate->normal_array.enabled )
+ {
+ return;
+ }
+ clientstate->normal_array.enabled = GL_FALSE;
+ clientstate->normal_array.changed = GL_TRUE;
- break;
- case GL_NORMAL_ARRAY:
- if (!clientstate->normal_array.enabled)
- {
- return;
- }
- clientstate->normal_array.enabled = GL_FALSE;
- clientstate->normal_array.changed = GL_TRUE;
+ break;
+ case GL_TEXTURE_COORD_ARRAY:
+ if ( !clientstate->texture_coord_array.enabled )
+ {
+ return;
+ }
+ clientstate->texture_coord_array.enabled = GL_FALSE;
+ clientstate->texture_coord_array.changed = GL_TRUE;
+ break;
+ default:
+ break;
+ }
+}
+void glVertexPointer( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer )
+{
+ if ( tmuState0.vertex_array.size == size &&
+ tmuState0.vertex_array.stride == stride &&
+ tmuState0.vertex_array.type == type &&
+ tmuState0.vertex_array.ptr == pointer )
+ {
+ return;
+ }
+ tmuState0.vertex_array.size = size;
+ tmuState0.vertex_array.stride = stride;
+ tmuState0.vertex_array.type = type;
+ tmuState0.vertex_array.ptr = (GLvoid *)pointer;
+ tmuState0.vertex_array.changed = GL_TRUE;
+}
+void glTexCoordPointer( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer )
+{
+ struct nanotmuState *clientstate = NULL;
+ if ( clientactivetmu == GL_TEXTURE0 )
+ {
+ clientstate = &tmuState0;
+ }
+ else if ( clientactivetmu == GL_TEXTURE1 )
+ {
+ clientstate = &tmuState1;
+ }
+ if ( clientstate->texture_coord_array.size == size &&
+ clientstate->texture_coord_array.stride == stride &&
+ clientstate->texture_coord_array.type == type &&
+ clientstate->texture_coord_array.ptr == pointer )
+ {
+ return;
+ }
+ clientstate->texture_coord_array.size = size;
+ clientstate->texture_coord_array.stride = stride;
+ clientstate->texture_coord_array.type = type;
+ clientstate->texture_coord_array.ptr = (GLvoid *)pointer;
+ clientstate->texture_coord_array.changed = GL_TRUE;
+}
+void glColorPointer( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer )
+{
+ if ( tmuState0.color_array.size == size &&
+ tmuState0.color_array.stride == stride &&
+ tmuState0.color_array.type == type &&
+ tmuState0.color_array.ptr == pointer )
+ {
+ return;
+ }
+ tmuState0.color_array.size = size;
+ tmuState0.color_array.stride = stride;
+ tmuState0.color_array.type = type;
+ tmuState0.color_array.ptr = (GLvoid *)pointer;
+ tmuState0.color_array.changed = GL_TRUE;
+}
- break;
- case GL_TEXTURE_COORD_ARRAY:
- if (!clientstate->texture_coord_array.enabled)
- {
- return;
- }
- clientstate->texture_coord_array.enabled = GL_FALSE;
- clientstate->texture_coord_array.changed = GL_TRUE;
- break;
- default:
- break;
- }
- }
-void glVertexPointer( GLint size, GLenum type,GLsizei stride, const GLvoid *pointer )
- {
- if (tmuState0.vertex_array.size == size &&
- tmuState0.vertex_array.stride == stride &&
- tmuState0.vertex_array.type == type &&
- tmuState0.vertex_array.ptr == pointer)
- {
- return;
- }
- tmuState0.vertex_array.size = size;
- tmuState0.vertex_array.stride = stride;
- tmuState0.vertex_array.type = type;
- tmuState0.vertex_array.ptr = (GLvoid*)pointer;
- tmuState0.vertex_array.changed = GL_TRUE;
- }
-void glTexCoordPointer( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer )
- {
- struct nanotmuState* clientstate = NULL;
- if (clientactivetmu == GL_TEXTURE0)
- {
- clientstate = &tmuState0;
- }
- else if (clientactivetmu == GL_TEXTURE1)
- {
- clientstate = &tmuState1;
- }
- if (clientstate->texture_coord_array.size == size &&
- clientstate->texture_coord_array.stride == stride &&
- clientstate->texture_coord_array.type == type &&
- clientstate->texture_coord_array.ptr == pointer)
- {
- return;
- }
- clientstate->texture_coord_array.size = size;
- clientstate->texture_coord_array.stride = stride;
- clientstate->texture_coord_array.type = type;
- clientstate->texture_coord_array.ptr = (GLvoid*)pointer;
- clientstate->texture_coord_array.changed = GL_TRUE;
- }
-void glColorPointer( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer )
- {
- if (tmuState0.color_array.size == size &&
- tmuState0.color_array.stride == stride &&
- tmuState0.color_array.type == type &&
- tmuState0.color_array.ptr == pointer)
- {
- return;
- }
- tmuState0.color_array.size = size;
- tmuState0.color_array.stride = stride;
- tmuState0.color_array.type = type;
- tmuState0.color_array.ptr = (GLvoid*)pointer;
- tmuState0.color_array.changed = GL_TRUE;
- }
-
-void glNormalPointer( GLenum type, GLsizei stride, const GLvoid *pointer )
- {
- int size = 0;
- if (tmuState0.normal_array.size == size &&
- tmuState0.normal_array.stride == stride &&
- tmuState0.normal_array.type == type &&
- tmuState0.normal_array.ptr == pointer)
- {
- return;
- }
- tmuState0.normal_array.size = size;
- tmuState0.normal_array.stride = stride;
- tmuState0.normal_array.type = type;
- tmuState0.normal_array.ptr = (GLvoid*)pointer;
- tmuState0.normal_array.changed = GL_TRUE;
- }
-void glPolygonOffset( GLfloat factor, GLfloat units )
- {
- FlushOnStateChange();
- glEsImpl->glPolygonOffset(factor, units);
- }
-void glStencilMask( GLuint mask ) {}
-void glClearStencil( GLint s ) {}
+void glNormalPointer( GLenum type, GLsizei stride, const GLvoid *pointer )
+{
+ int size = 0;
+ if ( tmuState0.normal_array.size == size &&
+ tmuState0.normal_array.stride == stride &&
+ tmuState0.normal_array.type == type &&
+ tmuState0.normal_array.ptr == pointer )
+ {
+ return;
+ }
+ tmuState0.normal_array.size = size;
+ tmuState0.normal_array.stride = stride;
+ tmuState0.normal_array.type = type;
+ tmuState0.normal_array.ptr = (GLvoid *)pointer;
+ tmuState0.normal_array.changed = GL_TRUE;
+}
+void glPolygonOffset( GLfloat factor, GLfloat units )
+{
+ FlushOnStateChange( );
+ glEsImpl->glPolygonOffset( factor, units );
+}
+void glStencilMask( GLuint mask )
+{
+}
+void glClearStencil( GLint s )
+{
+}
-#if defined(__MULTITEXTURE_SUPPORT__)
+#if defined( __MULTITEXTURE_SUPPORT__ )
extern "C" void glMultiTexCoord2fARB( GLenum target, GLfloat s, GLfloat t );
void glMultiTexCoord2fARB( GLenum target, GLfloat s, GLfloat t )
- {
- if (target == GL_TEXTURE0)
- {
- glTexCoord2f(s,t);
- }
- else
- {
- currentVertexAttrib.s_multi = s;
- currentVertexAttrib.t_multi = t;
- }
- }
+{
+ if ( target == GL_TEXTURE0 )
+ {
+ glTexCoord2f( s, t );
+ }
+ else
+ {
+ currentVertexAttrib.s_multi = s;
+ currentVertexAttrib.t_multi = t;
+ }
+}
#endif
/* Vladimir */
FlushOnStateChange();
glEsImpl->glDrawArrays(mode, first , count);
}*/
-void glMultMatrixf (const GLfloat *m)
+void glMultMatrixf( const GLfloat *m )
{
- FlushOnStateChange();
- glEsImpl->glMultMatrixf(m);
+ FlushOnStateChange( );
+ glEsImpl->glMultMatrixf( m );
}
-void glPixelStorei (GLenum pname, GLint param)
+void glPixelStorei( GLenum pname, GLint param )
{
- FlushOnStateChange();
- glEsImpl->glPixelStorei(pname, param);
+ FlushOnStateChange( );
+ glEsImpl->glPixelStorei( pname, param );
}
-
-void glFogf (GLenum pname, GLfloat param)
+void glFogf( GLenum pname, GLfloat param )
{
- FlushOnStateChange();
- glEsImpl->glFogf(pname, param);
+ FlushOnStateChange( );
+ glEsImpl->glFogf( pname, param );
}
-void glFogfv (GLenum pname, const GLfloat *params)
+void glFogfv( GLenum pname, const GLfloat *params )
{
- FlushOnStateChange();
- glEsImpl->glFogfv(pname, params);
+ FlushOnStateChange( );
+ glEsImpl->glFogfv( pname, params );
}
-void glGetTexParameteriv (GLenum target, GLenum pname, GLint *params)
+void glGetTexParameteriv( GLenum target, GLenum pname, GLint *params )
{
- FlushOnStateChange();
- glEsImpl->glGetTexParameteriv(target, pname, params);
+ FlushOnStateChange( );
+ glEsImpl->glGetTexParameteriv( target, pname, params );
}
-
// This gives: called unimplemented OpenGL ES API (Android)
-void glTexParameteri (GLenum target, GLenum pname, GLint param)
+void glTexParameteri( GLenum target, GLenum pname, GLint param )
{
- if (pname == GL_TEXTURE_BORDER_COLOR) {
+ if ( pname == GL_TEXTURE_BORDER_COLOR )
+ {
return; // not supported by opengl es
}
- if ( (pname == GL_TEXTURE_WRAP_S ||
- pname == GL_TEXTURE_WRAP_T) &&
- param == GL_CLAMP) {
+ if ( ( pname == GL_TEXTURE_WRAP_S ||
+ pname == GL_TEXTURE_WRAP_T ) &&
+ param == GL_CLAMP )
+ {
param = 0x812F;
}
- FlushOnStateChange();
- glEsImpl->glTexParameteri(target, pname, param);
+ FlushOnStateChange( );
+ glEsImpl->glTexParameteri( target, pname, param );
}
-void glTexParameterx (GLenum target, GLenum pname, GLfixed param)
+void glTexParameterx( GLenum target, GLenum pname, GLfixed param )
{
- if (pname == GL_TEXTURE_BORDER_COLOR) {
+ if ( pname == GL_TEXTURE_BORDER_COLOR )
+ {
return; // not supported by opengl es
}
- if ( (pname == GL_TEXTURE_WRAP_S ||
- pname == GL_TEXTURE_WRAP_T) &&
- param == GL_CLAMP) {
+ if ( ( pname == GL_TEXTURE_WRAP_S ||
+ pname == GL_TEXTURE_WRAP_T ) &&
+ param == GL_CLAMP )
+ {
param = 0x812F;
}
- FlushOnStateChange();
- glEsImpl->glTexParameterx(target, pname, param);
+ FlushOnStateChange( );
+ glEsImpl->glTexParameterx( target, pname, param );
}
-void glGenTextures (GLsizei n, GLuint *textures)
+void glGenTextures( GLsizei n, GLuint *textures )
{
- FlushOnStateChange();
- glEsImpl->glGenTextures(n, textures);
+ FlushOnStateChange( );
+ glEsImpl->glGenTextures( n, textures );
}
-void glFrontFace (GLenum mode)
+void glFrontFace( GLenum mode )
{
- FlushOnStateChange();
- glEsImpl->glFrontFace(mode);
+ FlushOnStateChange( );
+ glEsImpl->glFrontFace( mode );
}
// End Vladimir
-void glTexEnvi (GLenum target, GLenum pname, GLint param)
- {
- if (target == GL_TEXTURE_ENV)
- {
- if (pname == GL_TEXTURE_ENV_MODE)
- {
- if (param == activetmuState->texture_env_mode.value)
- {
- return;
- }
- else
- {
- FlushOnStateChange();
- glEsImpl->glTexEnvi(target, pname, param);
- activetmuState->texture_env_mode.value = param;
- return;
- }
- }
- }
- FlushOnStateChange();
- glEsImpl->glTexEnvi(target, pname, param);
- }
+void glTexEnvi( GLenum target, GLenum pname, GLint param )
+{
+ if ( target == GL_TEXTURE_ENV )
+ {
+ if ( pname == GL_TEXTURE_ENV_MODE )
+ {
+ if ( param == activetmuState->texture_env_mode.value )
+ {
+ return;
+ }
+ else
+ {
+ FlushOnStateChange( );
+ glEsImpl->glTexEnvi( target, pname, param );
+ activetmuState->texture_env_mode.value = param;
+ return;
+ }
+ }
+ }
+ FlushOnStateChange( );
+ glEsImpl->glTexEnvi( target, pname, param );
+}
#ifdef __MULTITEXTURE_SUPPORT__
-void glMultiTexCoord3fARB(GLenum a, GLfloat b, GLfloat c, GLfloat)
+void glMultiTexCoord3fARB( GLenum a, GLfloat b, GLfloat c, GLfloat )
{
- return glMultiTexCoord2fARB(a, b, c);
+ return glMultiTexCoord2fARB( a, b, c );
}
-void glMultiTexCoord2f(GLenum, GLfloat, GLfloat)
+void glMultiTexCoord2f( GLenum, GLfloat, GLfloat )
{
-
}
#endif
void glDrawArrays( GLenum mode, GLint first, GLsizei count )
- {
+{
// ensure that all primitives specified between glBegin/glEnd pairs
// are rendered first, and that we have correct tmu in use..
- if( mode == GL_QUADS ) mode = GL_TRIANGLE_FAN;
- FlushOnStateChange();
+ if ( mode == GL_QUADS )
+ mode = GL_TRIANGLE_FAN;
+ FlushOnStateChange( );
// setup correct vertex/color/texcoord pointers
- if (arraysValid ||
- tmuState0.vertex_array.changed ||
- tmuState0.color_array.changed ||
- tmuState0.texture_coord_array.changed || tmuState0.normal_array.changed)
+ if ( arraysValid ||
+ tmuState0.vertex_array.changed ||
+ tmuState0.color_array.changed ||
+ tmuState0.texture_coord_array.changed || tmuState0.normal_array.changed )
+ {
+ glEsImpl->glClientActiveTexture( GL_TEXTURE0 );
+ }
+ if ( arraysValid || tmuState0.vertex_array.changed )
+ {
+ if ( tmuState0.vertex_array.enabled )
{
- glEsImpl->glClientActiveTexture(GL_TEXTURE0);
+ glEsImpl->glEnableClientState( GL_VERTEX_ARRAY );
}
- if (arraysValid || tmuState0.vertex_array.changed)
- {
- if (tmuState0.vertex_array.enabled)
- {
- glEsImpl->glEnableClientState(GL_VERTEX_ARRAY);
- }
else
- {
- glEsImpl->glDisableClientState(GL_VERTEX_ARRAY);
- }
- glEsImpl->glVertexPointer(tmuState0.vertex_array.size,
- tmuState0.vertex_array.type,
- tmuState0.vertex_array.stride,
- tmuState0.vertex_array.ptr);
- tmuState0.vertex_array.changed = GL_FALSE;
+ {
+ glEsImpl->glDisableClientState( GL_VERTEX_ARRAY );
}
- if (arraysValid || tmuState0.color_array.changed)
+ glEsImpl->glVertexPointer( tmuState0.vertex_array.size,
+ tmuState0.vertex_array.type,
+ tmuState0.vertex_array.stride,
+ tmuState0.vertex_array.ptr );
+ tmuState0.vertex_array.changed = GL_FALSE;
+ }
+ if ( arraysValid || tmuState0.color_array.changed )
+ {
+ if ( tmuState0.color_array.enabled )
{
- if (tmuState0.color_array.enabled)
- {
- glEsImpl->glEnableClientState(GL_COLOR_ARRAY);
- }
+ glEsImpl->glEnableClientState( GL_COLOR_ARRAY );
+ }
else
- {
- glEsImpl->glDisableClientState(GL_COLOR_ARRAY);
- }
- glEsImpl->glColorPointer(tmuState0.color_array.size,
- tmuState0.color_array.type,
- tmuState0.color_array.stride,
- tmuState0.color_array.ptr);
- tmuState0.color_array.changed = GL_FALSE;
+ {
+ glEsImpl->glDisableClientState( GL_COLOR_ARRAY );
}
- if (arraysValid || tmuState0.normal_array.changed)
+ glEsImpl->glColorPointer( tmuState0.color_array.size,
+ tmuState0.color_array.type,
+ tmuState0.color_array.stride,
+ tmuState0.color_array.ptr );
+ tmuState0.color_array.changed = GL_FALSE;
+ }
+ if ( arraysValid || tmuState0.normal_array.changed )
+ {
+ if ( tmuState0.normal_array.enabled )
{
- if (tmuState0.normal_array.enabled)
- {
- glEsImpl->glEnableClientState(GL_NORMAL_ARRAY);
- }
- else
- {
- glEsImpl->glDisableClientState(GL_NORMAL_ARRAY);
- }
- glEsImpl->glNormalPointer(tmuState0.normal_array.type,
- tmuState0.normal_array.stride,
- tmuState0.normal_array.ptr);
- tmuState0.normal_array.changed = GL_FALSE;
+ glEsImpl->glEnableClientState( GL_NORMAL_ARRAY );
}
- if (arraysValid || tmuState0.texture_coord_array.changed)
+ else
{
+ glEsImpl->glDisableClientState( GL_NORMAL_ARRAY );
+ }
+ glEsImpl->glNormalPointer( tmuState0.normal_array.type,
+ tmuState0.normal_array.stride,
+ tmuState0.normal_array.ptr );
+ tmuState0.normal_array.changed = GL_FALSE;
+ }
+ if ( arraysValid || tmuState0.texture_coord_array.changed )
+ {
tmuState0.texture_coord_array.changed = GL_FALSE;
- if (tmuState0.texture_coord_array.enabled)
- {
- glEsImpl->glEnableClientState(GL_TEXTURE_COORD_ARRAY);
- }
+ if ( tmuState0.texture_coord_array.enabled )
+ {
+ glEsImpl->glEnableClientState( GL_TEXTURE_COORD_ARRAY );
+ }
else
- {
- glEsImpl->glDisableClientState(GL_TEXTURE_COORD_ARRAY);
- }
- glEsImpl->glTexCoordPointer(tmuState0.texture_coord_array.size,
- tmuState0.texture_coord_array.type,
- tmuState0.texture_coord_array.stride,
- tmuState0.texture_coord_array.ptr);
+ {
+ glEsImpl->glDisableClientState( GL_TEXTURE_COORD_ARRAY );
}
+ glEsImpl->glTexCoordPointer( tmuState0.texture_coord_array.size,
+ tmuState0.texture_coord_array.type,
+ tmuState0.texture_coord_array.stride,
+ tmuState0.texture_coord_array.ptr );
+ }
- if (arraysValid || tmuState1.texture_coord_array.changed)
- {
+ if ( arraysValid || tmuState1.texture_coord_array.changed )
+ {
tmuState1.texture_coord_array.changed = GL_FALSE;
- glEsImpl->glClientActiveTexture(GL_TEXTURE1);
- if (tmuState1.texture_coord_array.enabled)
- {
- glEsImpl->glEnableClientState(GL_TEXTURE_COORD_ARRAY);
- }
+ glEsImpl->glClientActiveTexture( GL_TEXTURE1 );
+ if ( tmuState1.texture_coord_array.enabled )
+ {
+ glEsImpl->glEnableClientState( GL_TEXTURE_COORD_ARRAY );
+ }
else
- {
- glEsImpl->glDisableClientState(GL_TEXTURE_COORD_ARRAY);
- }
- glEsImpl->glTexCoordPointer(tmuState1.texture_coord_array.size,
- tmuState1.texture_coord_array.type,
- tmuState1.texture_coord_array.stride,
- tmuState1.texture_coord_array.ptr);
+ {
+ glEsImpl->glDisableClientState( GL_TEXTURE_COORD_ARRAY );
}
+ glEsImpl->glTexCoordPointer( tmuState1.texture_coord_array.size,
+ tmuState1.texture_coord_array.type,
+ tmuState1.texture_coord_array.stride,
+ tmuState1.texture_coord_array.ptr );
+ }
arraysValid = GL_FALSE;
- glEsImpl->glDrawArrays(mode, first, count);
- }
+ glEsImpl->glDrawArrays( mode, first, count );
+}
/*void glNormalPointer(GLenum type, GLsizei stride, const void *ptr)
{
glEsImpl->glNormalPointer( type, stride, ptr );
}*/
-void glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
+void glCopyTexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height )
{
- FlushOnStateChange();
- glEsImpl->glCopyTexSubImage2D( target, level, xoffset, yoffset, x, y, width, height );
+ FlushOnStateChange( );
+ glEsImpl->glCopyTexSubImage2D( target, level, xoffset, yoffset, x, y, width, height );
}
-void glGenFramebuffers (GLsizei n, GLuint* framebuffers)
+void glGenFramebuffers( GLsizei n, GLuint *framebuffers )
{
- FlushOnStateChange();
- glEsImpl->glGenFramebuffers( n, framebuffers );
+ FlushOnStateChange( );
+ glEsImpl->glGenFramebuffers( n, framebuffers );
}
-
-void glGenRenderbuffers( GLsizei n, GLuint* renderbuffers )
+void glGenRenderbuffers( GLsizei n, GLuint *renderbuffers )
{
- FlushOnStateChange();
+ FlushOnStateChange( );
glEsImpl->glGenRenderbuffers( n, renderbuffers );
}
-void glBindRenderbuffer(GLenum target, GLuint renderbuffer)
+void glBindRenderbuffer( GLenum target, GLuint renderbuffer )
{
- FlushOnStateChange();
- glEsImpl->glBindRenderbuffer( target, renderbuffer );
+ FlushOnStateChange( );
+ glEsImpl->glBindRenderbuffer( target, renderbuffer );
}
-void glBindFramebuffer(GLenum target, GLuint framebuffer)\
+void glBindFramebuffer( GLenum target, GLuint framebuffer )
{
- FlushOnStateChange();
- glEsImpl->glBindFramebuffer( target, framebuffer );
+ FlushOnStateChange( );
+ glEsImpl->glBindFramebuffer( target, framebuffer );
}
-void glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
+void glFramebufferRenderbuffer( GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer )
{
- FlushOnStateChange();
- glEsImpl->glFramebufferRenderbuffer( target, attachment, renderbuffertarget, renderbuffer );
+ FlushOnStateChange( );
+ glEsImpl->glFramebufferRenderbuffer( target, attachment, renderbuffertarget, renderbuffer );
}
-void glDeleteFramebuffers(GLsizei n, const GLuint *framebuffers)
+void glDeleteFramebuffers( GLsizei n, const GLuint *framebuffers )
{
- FlushOnStateChange();
- glEsImpl->glDeleteFramebuffers(n, framebuffers);
+ FlushOnStateChange( );
+ glEsImpl->glDeleteFramebuffers( n, framebuffers );
}
-void glDeleteRenderbuffers(GLsizei n, const GLuint *renderbuffers)
+void glDeleteRenderbuffers( GLsizei n, const GLuint *renderbuffers )
{
- FlushOnStateChange();
- glEsImpl->glDeleteRenderbuffers( n, renderbuffers );
+ FlushOnStateChange( );
+ glEsImpl->glDeleteRenderbuffers( n, renderbuffers );
}
-void glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
+void glFramebufferTexture2D( GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level )
{
- FlushOnStateChange();
- glEsImpl->glFramebufferTexture2D(target, attachment,textarget,texture,level);
+ FlushOnStateChange( );
+ glEsImpl->glFramebufferTexture2D( target, attachment, textarget, texture, level );
}
-void glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
+void glRenderbufferStorage( GLenum target, GLenum internalformat, GLsizei width, GLsizei height )
{
- FlushOnStateChange();
- glEsImpl->glRenderbufferStorage(target, internalformat, width, height );
+ FlushOnStateChange( );
+ glEsImpl->glRenderbufferStorage( target, internalformat, width, height );
}
-
diff --git a/nanogl.cpp b/nanogl.cpp
index 53b6384848c5c47f115266f46baaf3fcb299e9f8..9af6d1d36a6fdc9f898f4c19809a6052b881024e 100644 (file)
--- a/nanogl.cpp
+++ b/nanogl.cpp
#include <stdio.h>
#include <stdlib.h>
-
//#include <cutils/log.h>
#include "nanogl.h"
#include "glesinterface.h"
#include "gl.h"
-
#define DEBUG_NANO 0
#ifdef __ANDROID__
#include <android/log.h>
#define LOG __android_log_print
-#define LOGI(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)
-#define LOGD(...) if (DEBUG_NANO) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__)
-#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG,__VA_ARGS__)
-#define LOGW(...) __android_log_print(ANDROID_LOG_WARN, LOG_TAG,__VA_ARGS__)
+#define LOGI( ... ) __android_log_print( ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__ )
+#define LOGD( ... ) \
+ if ( DEBUG_NANO ) \
+ __android_log_print( ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__ )
+#define LOGE( ... ) __android_log_print( ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__ )
+#define LOGW( ... ) __android_log_print( ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__ )
#else
#ifndef _MSC_VER
-#define LOGI(...) printf("I: "__VA_ARGS__);printf("\n")
-#define LOGD(...) if(DEBUG_NANO) {printf("D: "__VA_ARGS__);printf("\n");}
-#define LOGE(...) printf("E: "__VA_ARGS__);printf("\n")
-#define LOGW(...) printf("W: "__VA_ARGS__);printf("\n")
+#define LOGI( ... ) \
+ printf( "I: "__VA_ARGS__ ); \
+ printf( "\n" )
+#define LOGD( ... ) \
+ if ( DEBUG_NANO ) \
+ { \
+ printf( "D: "__VA_ARGS__ ); \
+ printf( "\n" ); \
+ }
+#define LOGE( ... ) \
+ printf( "E: "__VA_ARGS__ ); \
+ printf( "\n" )
+#define LOGW( ... ) \
+ printf( "W: "__VA_ARGS__ ); \
+ printf( "\n" )
#else
#define LOGI printf
#define LOGD printf
#ifdef _WIN32
#include <windows.h>
-#define dlopen(x,y) LoadLibraryA(x)
-#define dlsym(x,y) (void*)GetProcAddress((HINSTANCE)x,y)
-#define dlclose(x) FreeLibrary((HINSTANCE)x)
+#define dlopen( x, y ) LoadLibraryA( x )
+#define dlsym( x, y ) ( void * ) GetProcAddress( (HINSTANCE)x, y )
+#define dlclose( x ) FreeLibrary( (HINSTANCE)x )
#else
#include <dlfcn.h>
#endif
-
//#define GL_ENTRY(_r, _api, ...) #_api,
-static char const * const gl_names[] = {
- #include "funcnames.h"
- NULL
-};
+static char const *const gl_names[] = {
+#include "funcnames.h"
+ NULL};
//const char * driver;
-static void* glesLib = NULL;
+static void *glesLib = NULL;
-GlESInterface* glEsImpl = NULL;
+GlESInterface *glEsImpl = NULL;
-extern void InitGLStructs();
+extern void InitGLStructs( );
-void APIENTRY gl_unimplemented(GLenum none) {
+void APIENTRY gl_unimplemented( GLenum none )
+{
#ifndef USE_CORE_PROFILE
- LOGE ("Called unimplemented OpenGL ES API\n");
+ LOGE( "Called unimplemented OpenGL ES API\n" );
#endif
}
#include "SDL.h"
#endif
-void *nanoGL_GetProcAddress(const char *name)
+void *nanoGL_GetProcAddress( const char *name )
{
void *addr = NULL;
#ifdef XASH_SDL
- addr = SDL_GL_GetProcAddress( name );
- if( !addr )
+ addr = SDL_GL_GetProcAddress( name );
+ if ( !addr )
#endif
- addr = dlsym(glesLib, name);
+ addr = dlsym( glesLib, name );
return addr;
}
-static int CreateGlEsInterface( const char * name, void * lib, void * lib1, void * default_func )
+static int CreateGlEsInterface( const char *name, void *lib, void *lib1, void *default_func )
{
// alloc space
if ( !glEsImpl )
- glEsImpl = (GlESInterface *) malloc(sizeof(GlESInterface));
+ glEsImpl = (GlESInterface *)malloc( sizeof( GlESInterface ) );
- if (!glEsImpl) {
- return 0;
- }
+ if ( !glEsImpl )
+ {
+ return 0;
+ }
// load GL API calls
- char const * const * api;
+ char const *const *api;
api = gl_names;
// nanoGL interface pointer
- void ** ptr = (void **)(glEsImpl);
+ void **ptr = (void **)( glEsImpl );
- while (*api)
+ while ( *api )
{
- void * f;
-
- f = dlsym(lib, *api); // try libGLESxx_CM.so
+ void *f;
+
+ f = dlsym( lib, *api ); // try libGLESxx_CM.so
#ifdef USE_CORE_PROFILE
// Hack: try ARB and EXT suffix
- if (f == NULL) {
+ if ( f == NULL )
+ {
char namearb[256];
snprintf( namearb, 256, "%sARB", *api );
f = dlsym( lib, namearb );
}
- if (f == NULL) {
+ if ( f == NULL )
+ {
char namearb[256];
snprintf( namearb, 256, "%sEXT", *api );
f = dlsym( lib, namearb );
}
#endif
- if (f == NULL) {
- LOGW( "<%s> not found in %s. Trying libEGL.so.", *api, name); //driver);
-
- // try lib1
- if ( lib1 ) {
- f = dlsym(lib1, *api); // libEGL.so
-
- if ( f == NULL ) {
- LOGE ( "<%s> not found in libEGL.so", *api);
- if( glEsImpl->eglGetProcAddress && ( (void*)glEsImpl->eglGetProcAddress != (void*)gl_unimplemented ) )
- f = (void*)glEsImpl->eglGetProcAddress( *api );
- if(f == NULL)
- f = (void*)default_func; //(void*)gl_unimplemented;
+ if ( f == NULL )
+ {
+ LOGW( "<%s> not found in %s. Trying libEGL.so.", *api, name ); //driver);
+ // try lib1
+ if ( lib1 )
+ {
+ f = dlsym( lib1, *api ); // libEGL.so
+
+ if ( f == NULL )
+ {
+ LOGE( "<%s> not found in libEGL.so", *api );
+ if ( glEsImpl->eglGetProcAddress && ( (void *)glEsImpl->eglGetProcAddress != (void *)gl_unimplemented ) )
+ f = (void *)glEsImpl->eglGetProcAddress( *api );
+ if ( f == NULL )
+ f = (void *)default_func; //(void*)gl_unimplemented;
}
- else {
- LOGD ("<%s> @ 0x%p\n", *api, f);
+ else
+ {
+ LOGD( "<%s> @ 0x%p\n", *api, f );
}
}
else
{
- LOGE ( "libEGL.so not loaded!");
- if( glEsImpl->eglGetProcAddress && ( (void*)glEsImpl->eglGetProcAddress != (void*)gl_unimplemented ) )
- f = (void*)glEsImpl->eglGetProcAddress( *api );
- if( !f )
- f = (void*)default_func;
+ LOGE( "libEGL.so not loaded!" );
+ if ( glEsImpl->eglGetProcAddress && ( (void *)glEsImpl->eglGetProcAddress != (void *)gl_unimplemented ) )
+ f = (void *)glEsImpl->eglGetProcAddress( *api );
+ if ( !f )
+ f = (void *)default_func;
}
}
- else {
- LOGD ("<%s> @ 0x%p\n", *api, f);
+ else
+ {
+ LOGD( "<%s> @ 0x%p\n", *api, f );
}
-
- *ptr++ = f;
- api++;
- }
+
+ *ptr++ = f;
+ api++;
+ }
return 1;
}
// Load using the dynamic loader
-static int loadDriver(const char * name) {
- glesLib = dlopen(name, RTLD_NOW | RTLD_LOCAL);
- int rc = (glesLib) ? 1 : 0;
+static int loadDriver( const char *name )
+{
+ glesLib = dlopen( name, RTLD_NOW | RTLD_LOCAL );
+ int rc = ( glesLib ) ? 1 : 0;
return rc;
}
* Init
*/
#ifdef _WIN32
-int nanoGL_Init()
+int nanoGL_Init( )
{
- const char * lib1 = "opengl32.dll"; // Has both gl* & egl* funcs SDK < 1.5
- const char * lib2 = "opengl32.dll"; // Only gl* funcs SDK >= 1.5
- const char * lib3 = "opengl32.dll"; // Only egl* funcs SDK >= 1.5
- const char * driver;
-
+ const char *lib1 = "opengl32.dll"; // Has both gl* & egl* funcs SDK < 1.5
+ const char *lib2 = "opengl32.dll"; // Only gl* funcs SDK >= 1.5
+ const char *lib3 = "opengl32.dll"; // Only egl* funcs SDK >= 1.5
+ const char *driver;
+
// load lib
- LOGI("nanoGL: Init loading driver %s\n", lib1);
+ LOGI( "nanoGL: Init loading driver %s\n", lib1 );
//LOG (ANDROID_LOG_DEBUG, LOG_TAG, "nanoGL: Init loading driver %s\n", lib1);
- if ( ! loadDriver(lib1) )
+ if ( !loadDriver( lib1 ) )
{
- LOGE("Failed to load driver %s. Trying %s\n", lib1, lib2);
+ LOGE( "Failed to load driver %s. Trying %s\n", lib1, lib2 );
- if ( ! loadDriver(lib2) ) {
- LOGE ("Failed to load %s.\n", lib2);
+ if ( !loadDriver( lib2 ) )
+ {
+ LOGE( "Failed to load %s.\n", lib2 );
return 0;
}
else
else
driver = lib1;
- void * eglLib;
-
+ void *eglLib;
+
//if ( strcmp(driver, lib2) == 0 ) {
- LOGD ("**** Will Load EGL subs from %s ****", lib3);
-
- eglLib = dlopen(lib3, RTLD_NOW | RTLD_LOCAL);
-
- if ( ! eglLib ) {
- LOGE ( "Failed to load %s", lib3);
- }
+ LOGD( "**** Will Load EGL subs from %s ****", lib3 );
+
+ eglLib = dlopen( lib3, RTLD_NOW | RTLD_LOCAL );
+
+ if ( !eglLib )
+ {
+ LOGE( "Failed to load %s", lib3 );
+ }
//}
-
- // Load API gl* for 1.5+ else egl* gl*
+
+ // Load API gl* for 1.5+ else egl* gl*
//if (CreateGlEsInterface(driver, glesLib, eglLib, NULL) == -1)
- if ( !CreateGlEsInterface(driver, glesLib, eglLib, (void *) gl_unimplemented) == -1)
- {
+ if ( !CreateGlEsInterface( driver, glesLib, eglLib, (void *)gl_unimplemented ) == -1 )
+ {
// release lib
- LOGE ( "CreateGlEsInterface failed.");
+ LOGE( "CreateGlEsInterface failed." );
- dlclose(glesLib);
- return 0;
- }
+ dlclose( glesLib );
+ return 0;
+ }
// Init nanoGL
- InitGLStructs();
+ InitGLStructs( );
return 1;
}
#else
-int nanoGL_Init()
+int nanoGL_Init( )
{
- const char * lib1 = "libGLESv1_CM.so"; // Has both gl* & egl* funcs SDK < 1.5
- const char * lib2 = "libGLESv2.so"; // Only gl* funcs SDK >= 1.5
- const char * lib3 = "libEGL.so"; // Only egl* funcs SDK >= 1.5
- const char * driver;
-
+ const char *lib1 = "libGLESv1_CM.so"; // Has both gl* & egl* funcs SDK < 1.5
+ const char *lib2 = "libGLESv2.so"; // Only gl* funcs SDK >= 1.5
+ const char *lib3 = "libEGL.so"; // Only egl* funcs SDK >= 1.5
+ const char *driver;
+
// load lib
- LOGI("nanoGL: Init loading driver %s\n", lib1);
+ LOGI( "nanoGL: Init loading driver %s\n", lib1 );
//LOG (ANDROID_LOG_DEBUG, LOG_TAG, "nanoGL: Init loading driver %s\n", lib1);
- if ( ! loadDriver(lib1) )
+ if ( !loadDriver( lib1 ) )
{
- LOGE("Failed to load driver %s. Trying %s\n", lib1, lib2);
+ LOGE( "Failed to load driver %s. Trying %s\n", lib1, lib2 );
- if ( ! loadDriver(lib2) ) {
- LOGE ("Failed to load %s.\n", lib2);
+ if ( !loadDriver( lib2 ) )
+ {
+ LOGE( "Failed to load %s.\n", lib2 );
return 0;
}
else
else
driver = lib1;
- void * eglLib;
-
+ void *eglLib;
+
//if ( strcmp(driver, lib2) == 0 ) {
- LOGD ("**** Will Load EGL subs from %s ****", lib3);
-
- eglLib = dlopen(lib3, RTLD_NOW | RTLD_LOCAL);
-
- if ( ! eglLib ) {
- LOGE ( "Failed to load %s", lib3);
- }
+ LOGD( "**** Will Load EGL subs from %s ****", lib3 );
+
+ eglLib = dlopen( lib3, RTLD_NOW | RTLD_LOCAL );
+
+ if ( !eglLib )
+ {
+ LOGE( "Failed to load %s", lib3 );
+ }
//}
-
- // Load API gl* for 1.5+ else egl* gl*
+
+ // Load API gl* for 1.5+ else egl* gl*
//if (CreateGlEsInterface(driver, glesLib, eglLib, NULL) == -1)
- if ( !CreateGlEsInterface(driver, glesLib, eglLib, (void *) gl_unimplemented) == -1)
- {
+ if ( !CreateGlEsInterface( driver, glesLib, eglLib, (void *)gl_unimplemented ) == -1 )
+ {
// release lib
- LOGE ( "CreateGlEsInterface failed.");
+ LOGE( "CreateGlEsInterface failed." );
- dlclose(glesLib);
- return 0;
- }
+ dlclose( glesLib );
+ return 0;
+ }
#ifdef __ANDROID__
// somewhy it does not initialize correctly
- *((void**)&glEsImpl->glGenFramebuffers) = (void*)glEsImpl->eglGetProcAddress( "glGenFramebuffersOES" );
- *((void**)&glEsImpl->glGenRenderbuffers) = (void*)glEsImpl->eglGetProcAddress( "glGenRenderbuffersOES" );
- *((void**)&glEsImpl->glRenderbufferStorage) = (void*)glEsImpl->eglGetProcAddress( "glRenderbufferStorageOES" );
- *((void**)&glEsImpl->glBindFramebuffer) = (void*)glEsImpl->eglGetProcAddress( "glBindFramebufferOES" );
- *((void**)&glEsImpl->glBindRenderbuffer) = (void*)glEsImpl->eglGetProcAddress( "glBindRenderbufferOES" );
- *((void**)&glEsImpl->glFramebufferTexture2D) = (void*)glEsImpl->eglGetProcAddress( "glFramebufferTexture2DOES" );
- *((void**)&glEsImpl->glDeleteRenderbuffers) = (void*)glEsImpl->eglGetProcAddress( "glDeleteRenderbuffersOES" );
- *((void**)&glEsImpl->glDeleteFramebuffers) = (void*)glEsImpl->eglGetProcAddress( "glDeleteFramebuffersOES" );
- *((void**)&glEsImpl->glFramebufferRenderbuffer) = (void*)glEsImpl->eglGetProcAddress( "glFramebufferRenderbufferOES" );
+ *( (void **)&glEsImpl->glGenFramebuffers ) = (void *)glEsImpl->eglGetProcAddress( "glGenFramebuffersOES" );
+ *( (void **)&glEsImpl->glGenRenderbuffers ) = (void *)glEsImpl->eglGetProcAddress( "glGenRenderbuffersOES" );
+ *( (void **)&glEsImpl->glRenderbufferStorage ) = (void *)glEsImpl->eglGetProcAddress( "glRenderbufferStorageOES" );
+ *( (void **)&glEsImpl->glBindFramebuffer ) = (void *)glEsImpl->eglGetProcAddress( "glBindFramebufferOES" );
+ *( (void **)&glEsImpl->glBindRenderbuffer ) = (void *)glEsImpl->eglGetProcAddress( "glBindRenderbufferOES" );
+ *( (void **)&glEsImpl->glFramebufferTexture2D ) = (void *)glEsImpl->eglGetProcAddress( "glFramebufferTexture2DOES" );
+ *( (void **)&glEsImpl->glDeleteRenderbuffers ) = (void *)glEsImpl->eglGetProcAddress( "glDeleteRenderbuffersOES" );
+ *( (void **)&glEsImpl->glDeleteFramebuffers ) = (void *)glEsImpl->eglGetProcAddress( "glDeleteFramebuffersOES" );
+ *( (void **)&glEsImpl->glFramebufferRenderbuffer ) = (void *)glEsImpl->eglGetProcAddress( "glFramebufferRenderbufferOES" );
#endif
// Init nanoGL
- InitGLStructs();
+ InitGLStructs( );
return 1;
}
#endif
-void nanoGL_Destroy()
+void nanoGL_Destroy( )
{
- LOGD ("nanoGL_Destroy");
-
- if (glEsImpl) {
- free( glEsImpl);
- glEsImpl = NULL;
- }
-
+ LOGD( "nanoGL_Destroy" );
+
+ if ( glEsImpl )
+ {
+ free( glEsImpl );
+ glEsImpl = NULL;
+ }
+
// release lib
- dlclose(glesLib);
+ dlclose( glesLib );
}