DEADSOFTWARE

Apply glColor when disabling color array
[nanogl.git] / GL / glesinterface.h
1 /*
2 Copyright (C) 2007-2009 Olli Hinkka
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 See the GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 */
21 #ifndef __GLESINTERFACE_H__
22 #define __GLESINTERFACE_H__
24 #if !defined( __WINS__ )
25 #if defined( __TARGET_FPU_VFP )
26 #pragma softfp_linkage
27 #endif
28 #endif
30 #ifdef SOFTFP_LINK
31 #define S __attribute__( ( pcs( "aapcs" ) ) )
32 #else
33 #define S
34 #endif
36 #ifdef _WIN32
37 #include <windows.h> //APIENTRY
38 #endif
39 #ifndef APIENTRY
40 #ifdef _MSC_VER
41 #define APIENTRY WINAPI
42 #else
43 #define APIENTRY
44 #endif
45 #endif
47 struct GlESInterface
48 {
49 int ( *eglChooseConfig )( int dpy, const int *attrib_list, int *configs, int config_size, int *num_config ) S;
50 int ( *eglCopyBuffers )( int dpy, int surface, void *target ) S;
51 int ( *eglCreateContext )( int dpy, int config, int share_list, const int *attrib_list ) S;
52 int ( *eglCreatePbufferSurface )( int dpy, int config, const int *attrib_list ) S;
53 int ( *eglCreatePixmapSurface )( int dpy, int config, void *pixmap, const int *attrib_list ) S;
54 int ( *eglCreateWindowSurface )( int dpy, int config, void *window, const int *attrib_list ) S;
55 int ( *eglDestroyContext )( int dpy, int ctx ) S;
56 int ( *eglDestroySurface )( int dpy, int surface ) S;
57 int ( *eglGetConfigAttrib )( int dpy, int config, int attribute, int *value ) S;
58 int ( *eglGetConfigs )( int dpy, int *configs, int config_size, int *num_config ) S;
59 int ( *eglGetCurrentContext )( void ) S;
60 int ( *eglGetCurrentDisplay )( void ) S;
61 int ( *eglGetCurrentSurface )( int readdraw ) S;
62 int ( *eglGetDisplay )( int display ) S;
63 int ( *eglGetError )( void ) S;
65 void ( *( *eglGetProcAddress )( const char *procname ) )( ... ) S;
67 int ( *eglInitialize )( int dpy, int *major, int *minor ) S;
68 int ( *eglMakeCurrent )( int dpy, int draw, int read, int ctx ) S;
69 int ( *eglQueryContext )( int dpy, int ctx, int attribute, int *value ) S;
70 const char *( *eglQueryString )(int dpy, int name)S;
71 int ( *eglQuerySurface )( int dpy, int surface, int attribute, int *value ) S;
72 int ( *eglSwapBuffers )( int dpy, int draw ) S;
73 int ( *eglTerminate )( int dpy ) S;
74 int ( *eglWaitGL )( void ) S;
75 int ( *eglWaitNative )( int engine ) S;
76 void( APIENTRY *glActiveTexture )( unsigned int texture ) S;
77 void( APIENTRY *glAlphaFunc )( unsigned int func, float ref ) S;
78 void( APIENTRY *glAlphaFuncx )( unsigned int func, int ref ) S;
79 void( APIENTRY *glBindTexture )( unsigned int target, unsigned int texture ) S;
80 void( APIENTRY *glBlendFunc )( unsigned int sfactor, unsigned int dfactor ) S;
81 void( APIENTRY *glClear )( unsigned int mask ) S;
82 void( APIENTRY *glClearColor )( float red, float green, float blue, float alpha ) S;
83 void( APIENTRY *glClearColorx )( int red, int green, int blue, int alpha ) S;
84 void( APIENTRY *glClearDepthf )( float depth ) S;
85 void( APIENTRY *glClearDepthx )( int depth ) S;
86 void( APIENTRY *glClearStencil )( int s ) S;
87 void( APIENTRY *glClientActiveTexture )( unsigned int texture ) S;
88 void( APIENTRY *glColor4f )( float red, float green, float blue, float alpha ) S;
89 void( APIENTRY *glColor4x )( int red, int green, int blue, int alpha ) S;
90 void( APIENTRY *glColorMask )( unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha ) S;
91 void( APIENTRY *glColorPointer )( int size, unsigned int type, int stride, const void *pointer ) S;
92 void( APIENTRY *glCompressedTexImage2D )( unsigned int target, int level, unsigned int internalformat, int width, int height, int border, int imageSize, const void *data ) S;
93 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;
94 void( APIENTRY *glCopyTexImage2D )( unsigned int target, int level, unsigned int internalformat, int x, int y, int width, int height, int border ) S;
95 void( APIENTRY *glCopyTexSubImage2D )( unsigned int target, int level, int xoffset, int yoffset, int x, int y, int width, int height ) S;
96 void( APIENTRY *glCullFace )( unsigned int mode ) S;
97 void( APIENTRY *glDeleteTextures )( int n, const unsigned int *textures ) S;
98 void( APIENTRY *glDepthFunc )( unsigned int func ) S;
99 void( APIENTRY *glDepthMask )( unsigned char flag ) S;
100 void( APIENTRY *glDepthRangef )( float zNear, float zFar ) S;
101 void( APIENTRY *glDepthRangex )( int zNear, int zFar ) S;
102 void( APIENTRY *glDisable )( unsigned int cap ) S;
103 void( APIENTRY *glDisableClientState )( unsigned int array ) S;
104 void( APIENTRY *glDrawArrays )( unsigned int mode, int first, int count ) S;
105 void( APIENTRY *glDrawElements )( unsigned int mode, int count, unsigned int type, const void *indices ) S;
106 void( APIENTRY *glEnable )( unsigned int cap ) S;
107 void( APIENTRY *glEnableClientState )( unsigned int array ) S;
108 void( APIENTRY *glFinish )( void ) S;
109 void( APIENTRY *glFlush )( void ) S;
110 void( APIENTRY *glFogf )( unsigned int pname, float param ) S;
111 void( APIENTRY *glFogfv )( unsigned int pname, const float *params ) S;
112 void( APIENTRY *glFogx )( unsigned int pname, int param ) S;
113 void( APIENTRY *glFogxv )( unsigned int pname, const int *params ) S;
114 void( APIENTRY *glFrontFace )( unsigned int mode ) S;
115 void( APIENTRY *glFrustumf )( float left, float right, float bottom, float top, float zNear, float zFar ) S;
116 void( APIENTRY *glFrustumx )( int left, int right, int bottom, int top, int zNear, int zFar ) S;
117 void( APIENTRY *glGenTextures )( int n, unsigned int *textures ) S;
118 unsigned int( APIENTRY *glGetError )( void ) S;
119 void( APIENTRY *glGetIntegerv )( unsigned int pname, int *params ) S;
120 const unsigned char *( APIENTRY *glGetString )(unsigned int name)S;
121 void( APIENTRY *glHint )( unsigned int target, unsigned int mode ) S;
122 void( APIENTRY *glLightModelf )( unsigned int pname, float param ) S;
123 void( APIENTRY *glLightModelfv )( unsigned int pname, const float *params ) S;
124 void( APIENTRY *glLightModelx )( unsigned int pname, int param ) S;
125 void( APIENTRY *glLightModelxv )( unsigned int pname, const int *params ) S;
126 void( APIENTRY *glLightf )( unsigned int light, unsigned int pname, float param ) S;
127 void( APIENTRY *glLightfv )( unsigned int light, unsigned int pname, const float *params ) S;
128 void( APIENTRY *glLightx )( unsigned int light, unsigned int pname, int param ) S;
129 void( APIENTRY *glLightxv )( unsigned int light, unsigned int pname, const int *params ) S;
130 void( APIENTRY *glLineWidth )( float width ) S;
131 void( APIENTRY *glLineWidthx )( int width ) S;
132 void( APIENTRY *glLoadIdentity )( void ) S;
133 void( APIENTRY *glLoadMatrixf )( const float *m ) S;
134 void( APIENTRY *glLoadMatrixx )( const int *m ) S;
135 void( APIENTRY *glLogicOp )( unsigned int opcode ) S;
136 void( APIENTRY *glMaterialf )( unsigned int face, unsigned int pname, float param ) S;
137 void( APIENTRY *glMaterialfv )( unsigned int face, unsigned int pname, const float *params ) S;
138 void( APIENTRY *glMaterialx )( unsigned int face, unsigned int pname, int param ) S;
139 void( APIENTRY *glMaterialxv )( unsigned int face, unsigned int pname, const int *params ) S;
140 void( APIENTRY *glMatrixMode )( unsigned int mode ) S;
141 void( APIENTRY *glMultMatrixf )( const float *m ) S;
142 void( APIENTRY *glMultMatrixx )( const int *m ) S;
143 void( APIENTRY *glMultiTexCoord4f )( unsigned int target, float s, float t, float r, float q ) S;
144 void( APIENTRY *glMultiTexCoord4x )( unsigned int target, int s, int t, int r, int q ) S;
145 void( APIENTRY *glNormal3f )( float nx, float ny, float nz ) S;
146 void( APIENTRY *glNormal3x )( int nx, int ny, int nz ) S;
147 void( APIENTRY *glNormalPointer )( unsigned int type, int stride, const void *pointer ) S;
148 void( APIENTRY *glOrthof )( float left, float right, float bottom, float top, float zNear, float zFar ) S;
149 void( APIENTRY *glOrthox )( int left, int right, int bottom, int top, int zNear, int zFar ) S;
150 void( APIENTRY *glPixelStorei )( unsigned int pname, int param ) S;
151 void( APIENTRY *glPointSize )( float size ) S;
152 void( APIENTRY *glPointSizex )( int size ) S;
153 void( APIENTRY *glPolygonOffset )( float factor, float units ) S;
154 void( APIENTRY *glPolygonOffsetx )( int factor, int units ) S;
155 void( APIENTRY *glPopMatrix )( void ) S;
156 void( APIENTRY *glPushMatrix )( void ) S;
157 unsigned int( APIENTRY *glQueryMatrixxOES )( int mantissa[16], int exponent[16] ) S;
158 void( APIENTRY *glReadPixels )( int x, int y, int width, int height, unsigned int format, unsigned int type, void *pixels ) S;
159 void( APIENTRY *glRotatef )( float angle, float x, float y, float z ) S;
160 void( APIENTRY *glRotatex )( int angle, int x, int y, int z ) S;
161 void( APIENTRY *glSampleCoverage )( float value, unsigned char invert ) S;
162 void( APIENTRY *glSampleCoveragex )( int value, unsigned char invert ) S;
163 void( APIENTRY *glScalef )( float x, float y, float z ) S;
164 void( APIENTRY *glScalex )( int x, int y, int z ) S;
165 void( APIENTRY *glScissor )( int x, int y, int width, int height ) S;
166 void( APIENTRY *glShadeModel )( unsigned int mode ) S;
167 void( APIENTRY *glStencilFunc )( unsigned int func, int ref, unsigned int mask ) S;
168 void( APIENTRY *glStencilMask )( unsigned int mask ) S;
169 void( APIENTRY *glStencilOp )( unsigned int fail, unsigned int zfail, unsigned int zpass ) S;
170 void( APIENTRY *glTexCoordPointer )( int size, unsigned int type, int stride, const void *pointer ) S;
171 void( APIENTRY *glTexEnvf )( unsigned int target, unsigned int pname, float param ) S;
172 void( APIENTRY *glTexEnvfv )( unsigned int target, unsigned int pname, const float *params ) S;
173 void( APIENTRY *glTexEnvx )( unsigned int target, unsigned int pname, int param ) S;
174 void( APIENTRY *glTexEnvxv )( unsigned int target, unsigned int pname, const int *params ) S;
175 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;
176 void( APIENTRY *glTexParameterf )( unsigned int target, unsigned int pname, float param ) S;
177 void( APIENTRY *glTexParameterx )( unsigned int target, unsigned int pname, int param ) S;
178 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;
179 void( APIENTRY *glTranslatef )( float x, float y, float z ) S;
180 void( APIENTRY *glTranslatex )( int x, int y, int z ) S;
181 void( APIENTRY *glVertexPointer )( int size, unsigned int type, int stride, const void *pointer ) S;
182 void( APIENTRY *glViewport )( int x, int y, int width, int height ) S;
183 int ( *eglSwapInterval )( int dpy, int interval ) S;
184 void( APIENTRY *glBindBuffer )( unsigned int target, unsigned int buffer ) S;
185 void( APIENTRY *glBufferData )( unsigned int target, int size, const void *data, unsigned int usage ) S;
186 void( APIENTRY *glBufferSubData )( unsigned int target, int offset, int size, const void *data ) S;
187 void( APIENTRY *glClipPlanef )( unsigned int plane, const float *equation ) S;
188 void( APIENTRY *glClipPlanex )( unsigned int plane, const int *equation ) S;
189 void( APIENTRY *glColor4ub )( unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha ) S;
190 void( APIENTRY *glDeleteBuffers )( int n, const unsigned int *buffers ) S;
191 void( APIENTRY *glGenBuffers )( int n, unsigned int *buffers ) S;
192 void( APIENTRY *glGetBooleanv )( unsigned int pname, unsigned char *params ) S;
193 void( APIENTRY *glGetBufferParameteriv )( unsigned int target, unsigned int pname, int *params ) S;
194 void( APIENTRY *glGetClipPlanef )( unsigned int pname, float eqn[4] ) S;
195 void( APIENTRY *glGetClipPlanex )( unsigned int pname, int eqn[4] ) S;
196 void( APIENTRY *glGetFixedv )( unsigned int pname, int *params ) S;
197 void( APIENTRY *glGetFloatv )( unsigned int pname, float *params ) S;
198 void( APIENTRY *glGetLightfv )( unsigned int light, unsigned int pname, float *params ) S;
199 void( APIENTRY *glGetLightxv )( unsigned int light, unsigned int pname, int *params ) S;
200 void( APIENTRY *glGetMaterialfv )( unsigned int face, unsigned int pname, float *params ) S;
201 void( APIENTRY *glGetMaterialxv )( unsigned int face, unsigned int pname, int *params ) S;
202 void( APIENTRY *glGetPointerv )( unsigned int pname, void **params ) S;
203 void( APIENTRY *glGetTexEnvfv )( unsigned int env, unsigned int pname, float *params ) S;
204 void( APIENTRY *glGetTexEnviv )( unsigned int env, unsigned int pname, int *params ) S;
205 void( APIENTRY *glGetTexEnvxv )( unsigned int env, unsigned int pname, int *params ) S;
206 void( APIENTRY *glGetTexParameterfv )( unsigned int target, unsigned int pname, float *params ) S;
207 void( APIENTRY *glGetTexParameteriv )( unsigned int target, unsigned int pname, int *params ) S;
208 void( APIENTRY *glGetTexParameterxv )( unsigned int target, unsigned int pname, int *params ) S;
209 unsigned char( APIENTRY *glIsBuffer )( unsigned int buffer ) S;
210 unsigned char( APIENTRY *glIsEnabled )( unsigned int cap ) S;
211 unsigned char( APIENTRY *glIsTexture )( unsigned int texture ) S;
212 void( APIENTRY *glPointParameterf )( unsigned int pname, float param ) S;
213 void( APIENTRY *glPointParameterfv )( unsigned int pname, const float *params ) S;
214 void( APIENTRY *glPointParameterx )( unsigned int pname, int param ) S;
215 void( APIENTRY *glPointParameterxv )( unsigned int pname, const int *params ) S;
216 void( APIENTRY *glPointSizePointerOES )( unsigned int type, int stride, const void *pointer ) S;
217 void( APIENTRY *glTexEnvi )( unsigned int target, unsigned int pname, int param ) S;
218 void( APIENTRY *glTexEnviv )( unsigned int target, unsigned int pname, const int *params ) S;
219 void( APIENTRY *glTexParameterfv )( unsigned int target, unsigned int pname, const float *params ) S;
220 void( APIENTRY *glTexParameteri )( unsigned int target, unsigned int pname, int param ) S;
221 void( APIENTRY *glTexParameteriv )( unsigned int target, unsigned int pname, const int *params ) S;
222 void( APIENTRY *glTexParameterxv )( unsigned int target, unsigned int pname, const int *params ) S;
224 int ( *eglBindTexImage )( int dpy, int surface, int buffer ) S;
225 int ( *eglReleaseTexImage )( int dpy, int surface, int buffer ) S;
226 int ( *eglSurfaceAttrib )( int dpy, int surface, int attribute, int value ) S;
228 #ifdef USE_CORE_PROFILE
229 void( APIENTRY *glOrtho )( double left, double right, double bottom, double top, double zNear, double zFar ) S;
230 void( APIENTRY *glDepthRange )( double zNear, double zFar ) S;
231 #endif
233 // Rikku2000: Light
234 void( APIENTRY *glColorMaterial )( unsigned int face, unsigned int mode ) S;
236 void( APIENTRY *glGenFramebuffers )( unsigned int n, unsigned int *framebuffers ) S;
237 void( APIENTRY *glGenRenderbuffers )( unsigned int n, unsigned int *renderbuffers ) S;
238 void( APIENTRY *glRenderbufferStorage )( unsigned int target, unsigned int internalformat, unsigned int width, unsigned int height ) S;
239 void( APIENTRY *glBindFramebuffer )( unsigned int target, unsigned int framebuffer ) S;
240 void( APIENTRY *glBindRenderbuffer )( unsigned int target, unsigned int renderbuffer ) S;
241 void( APIENTRY *glFramebufferTexture2D )( unsigned int target, unsigned int attachment, unsigned int textarget, unsigned int texture, int level ) S;
242 void( APIENTRY *glDeleteRenderbuffers )( unsigned int n, const unsigned int *renderbuffers ) S;
243 void( APIENTRY *glDeleteFramebuffers )( unsigned int n, const unsigned int *framebuffers ) S;
244 void( APIENTRY *glFramebufferRenderbuffer )( unsigned int target, unsigned int attachment, unsigned int renderbuffertarget, unsigned int renderbuffer ) S;
245 void( APIENTRY *glTexGenfvOES )(unsigned int coord, unsigned int pname, const float *params);
246 void( APIENTRY *glTexGeniOES )(unsigned int coord, unsigned int pname, int param);
247 };
248 #if !defined( __WINS__ )
249 #if defined( __TARGET_FPU_VFP )
250 #pragma no_softfp_linkage
251 #endif
252 #endif
254 #endif