DEADSOFTWARE

Add some checks
[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__
25 #if !defined (__WINS__)
26 #if defined(__TARGET_FPU_VFP)
27 #pragma softfp_linkage
28 #endif
29 #endif
31 #ifdef SOFTFP_LINK
32 #define S __attribute__((pcs("aapcs")))
33 #else
34 #define S
35 #endif
37 struct GlESInterface
38 {
39 int (*eglChooseConfig) (int dpy, const int *attrib_list, int *configs, int config_size, int *num_config) S;
40 int (*eglCopyBuffers) (int dpy, int surface, void* target) S;
41 int (*eglCreateContext) (int dpy, int config, int share_list, const int *attrib_list) S;
42 int (*eglCreatePbufferSurface) (int dpy, int config, const int *attrib_list) S;
43 int (*eglCreatePixmapSurface) (int dpy, int config, void* pixmap, const int *attrib_list) S;
44 int (*eglCreateWindowSurface) (int dpy, int config, void* window, const int *attrib_list) S;
45 int (*eglDestroyContext) (int dpy, int ctx) S;
46 int (*eglDestroySurface) (int dpy, int surface) S;
47 int (*eglGetConfigAttrib) (int dpy, int config, int attribute, int *value) S;
48 int (*eglGetConfigs) (int dpy, int *configs, int config_size, int *num_config) S;
49 int (*eglGetCurrentContext) (void) S;
50 int (*eglGetCurrentDisplay) (void) S;
51 int (*eglGetCurrentSurface) (int readdraw) S;
52 int (*eglGetDisplay) (int display) S;
53 int (*eglGetError) (void) S;
55 void (*(*eglGetProcAddress) (const char *procname))(...) S;
57 int (*eglInitialize) (int dpy, int *major, int *minor) S;
58 int (*eglMakeCurrent) (int dpy, int draw, int read, int ctx) S;
59 int (*eglQueryContext) (int dpy, int ctx, int attribute, int *value) S;
60 const char * (*eglQueryString) (int dpy, int name) S;
61 int (*eglQuerySurface) (int dpy, int surface, int attribute, int *value) S;
62 int (*eglSwapBuffers) (int dpy, int draw) S;
63 int (*eglTerminate) (int dpy) S;
64 int (*eglWaitGL) (void) S;
65 int (*eglWaitNative) (int engine) S;
66 void (*glActiveTexture) (unsigned int texture) S;
67 void (*glAlphaFunc) (unsigned int func, float ref) S;
68 void (*glAlphaFuncx) (unsigned int func, int ref) S;
69 void (*glBindTexture) (unsigned int target, unsigned int texture) S;
70 void (*glBlendFunc) (unsigned int sfactor, unsigned int dfactor) S;
71 void (*glClear) (unsigned int mask) S;
72 void (*glClearColor) (float red, float green, float blue, float alpha) S;
73 void (*glClearColorx) (int red, int green, int blue, int alpha) S;
74 void (*glClearDepthf) (float depth) S;
75 void (*glClearDepthx) (int depth) S;
76 void (*glClearStencil) (int s) S;
77 void (*glClientActiveTexture) (unsigned int texture) S;
78 void (*glColor4f) (float red, float green, float blue, float alpha) S;
79 void (*glColor4x) (int red, int green, int blue, int alpha) S;
80 void (*glColorMask) (unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha) S;
81 void (*glColorPointer) (int size, unsigned int type, int stride, const void *pointer) S;
82 void (*glCompressedTexImage2D) (unsigned int target, int level, unsigned int internalformat, int width, int height, int border, int imageSize, const void *data) S;
83 void (*glCompressedTexSubImage2D) (unsigned int target, int level, int xoffset, int yoffset, int width, int height, unsigned int format, int imageSize, const void *data) S;
84 void (*glCopyTexImage2D) (unsigned int target, int level, unsigned int internalformat, int x, int y, int width, int height, int border) S;
85 void (*glCopyTexSubImage2D) (unsigned int target, int level, int xoffset, int yoffset, int x, int y, int width, int height) S;
86 void (*glCullFace) (unsigned int mode) S;
87 void (*glDeleteTextures) (int n, const unsigned int *textures) S;
88 void (*glDepthFunc) (unsigned int func) S;
89 void (*glDepthMask) (unsigned char flag) S;
90 void (*glDepthRangef) (float zNear, float zFar) S;
91 void (*glDepthRangex) (int zNear, int zFar) S;
92 void (*glDisable) (unsigned int cap) S;
93 void (*glDisableClientState) (unsigned int array) S;
94 void (*glDrawArrays) (unsigned int mode, int first, int count) S;
95 void (*glDrawElements) (unsigned int mode, int count, unsigned int type, const void *indices) S;
96 void (*glEnable) (unsigned int cap) S;
97 void (*glEnableClientState) (unsigned int array) S;
98 void (*glFinish) (void) S;
99 void (*glFlush) (void) S;
100 void (*glFogf) (unsigned int pname, float param) S;
101 void (*glFogfv) (unsigned int pname, const float *params) S;
102 void (*glFogx) (unsigned int pname, int param) S;
103 void (*glFogxv) (unsigned int pname, const int *params) S;
104 void (*glFrontFace) (unsigned int mode) S;
105 void (*glFrustumf) (float left, float right, float bottom, float top, float zNear, float zFar) S;
106 void (*glFrustumx) (int left, int right, int bottom, int top, int zNear, int zFar) S;
107 void (*glGenTextures) (int n, unsigned int *textures) S;
108 unsigned int (*glGetError) (void) S;
109 void (*glGetIntegerv) (unsigned int pname, int *params) S;
110 const unsigned char * (*glGetString) (unsigned int name) S;
111 void (*glHint) (unsigned int target, unsigned int mode) S;
112 void (*glLightModelf) (unsigned int pname, float param) S;
113 void (*glLightModelfv) (unsigned int pname, const float *params) S;
114 void (*glLightModelx) (unsigned int pname, int param) S;
115 void (*glLightModelxv) (unsigned int pname, const int *params) S;
116 void (*glLightf) (unsigned int light, unsigned int pname, float param) S;
117 void (*glLightfv) (unsigned int light, unsigned int pname, const float *params) S;
118 void (*glLightx) (unsigned int light, unsigned int pname, int param) S;
119 void (*glLightxv) (unsigned int light, unsigned int pname, const int *params) S;
120 void (*glLineWidth) (float width) S;
121 void (*glLineWidthx) (int width) S;
122 void (*glLoadIdentity) (void) S;
123 void (*glLoadMatrixf) (const float *m) S;
124 void (*glLoadMatrixx) (const int *m) S;
125 void (*glLogicOp) (unsigned int opcode) S;
126 void (*glMaterialf) (unsigned int face, unsigned int pname, float param) S;
127 void (*glMaterialfv) (unsigned int face, unsigned int pname, const float *params) S;
128 void (*glMaterialx) (unsigned int face, unsigned int pname, int param) S;
129 void (*glMaterialxv) (unsigned int face, unsigned int pname, const int *params) S;
130 void (*glMatrixMode) (unsigned int mode) S;
131 void (*glMultMatrixf) (const float *m) S;
132 void (*glMultMatrixx) (const int *m) S;
133 void (*glMultiTexCoord4f) (unsigned int target, float s, float t, float r, float q) S;
134 void (*glMultiTexCoord4x) (unsigned int target, int s, int t, int r, int q) S;
135 void (*glNormal3f) (float nx, float ny, float nz) S;
136 void (*glNormal3x) (int nx, int ny, int nz) S;
137 void (*glNormalPointer) (unsigned int type, int stride, const void *pointer) S;
138 void (*glOrthof) (float left, float right, float bottom, float top, float zNear, float zFar) S;
139 void (*glOrthox) (int left, int right, int bottom, int top, int zNear, int zFar) S;
140 void (*glPixelStorei) (unsigned int pname, int param) S;
141 void (*glPointSize) (float size) S;
142 void (*glPointSizex) (int size) S;
143 void (*glPolygonOffset) (float factor, float units) S;
144 void (*glPolygonOffsetx) (int factor, int units) S;
145 void (*glPopMatrix) (void) S;
146 void (*glPushMatrix) (void) S;
147 unsigned int (*glQueryMatrixxOES) (int mantissa[16], int exponent[16]) S;
148 void (*glReadPixels) (int x, int y, int width, int height, unsigned int format, unsigned int type, void *pixels) S;
149 void (*glRotatef) (float angle, float x, float y, float z) S;
150 void (*glRotatex) (int angle, int x, int y, int z) S;
151 void (*glSampleCoverage) (float value, unsigned char invert) S;
152 void (*glSampleCoveragex) (int value, unsigned char invert) S;
153 void (*glScalef) (float x, float y, float z) S;
154 void (*glScalex) (int x, int y, int z) S;
155 void (*glScissor) (int x, int y, int width, int height) S;
156 void (*glShadeModel) (unsigned int mode) S;
157 void (*glStencilFunc) (unsigned int func, int ref, unsigned int mask) S;
158 void (*glStencilMask) (unsigned int mask) S;
159 void (*glStencilOp) (unsigned int fail, unsigned int zfail, unsigned int zpass) S;
160 void (*glTexCoordPointer) (int size, unsigned int type, int stride, const void *pointer) S;
161 void (*glTexEnvf) (unsigned int target, unsigned int pname, float param) S;
162 void (*glTexEnvfv) (unsigned int target, unsigned int pname, const float *params) S;
163 void (*glTexEnvx) (unsigned int target, unsigned int pname, int param) S;
164 void (*glTexEnvxv) (unsigned int target, unsigned int pname, const int *params) S;
165 void (*glTexImage2D) (unsigned int target, int level, int internalformat, int width, int height, int border, unsigned int format, unsigned int type, const void *pixels) S;
166 void (*glTexParameterf) (unsigned int target, unsigned int pname, float param) S;
167 void (*glTexParameterx) (unsigned int target, unsigned int pname, int param) S;
168 void (*glTexSubImage2D) (unsigned int target, int level, int xoffset, int yoffset, int width, int height, unsigned int format, unsigned int type, const void *pixels) S;
169 void (*glTranslatef) (float x, float y, float z) S;
170 void (*glTranslatex) (int x, int y, int z) S;
171 void (*glVertexPointer) (int size, unsigned int type, int stride, const void *pointer) S;
172 void (*glViewport) (int x, int y, int width, int height) S;
173 int (*eglSwapInterval) (int dpy, int interval) S;
174 void (*glBindBuffer) (unsigned int target, unsigned int buffer) S;
175 void (*glBufferData) (unsigned int target, int size, const void *data, unsigned int usage) S;
176 void (*glBufferSubData) (unsigned int target, int offset,int size, const void *data) S;
177 void (*glClipPlanef) (unsigned int plane, const float *equation) S;
178 void (*glClipPlanex) (unsigned int plane, const int *equation) S;
179 void (*glColor4ub) (unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha) S;
180 void (*glDeleteBuffers) (int n, const unsigned int *buffers) S;
181 void (*glGenBuffers) (int n, unsigned int *buffers) S;
182 void (*glGetBooleanv) (unsigned int pname, unsigned char *params) S;
183 void (*glGetBufferParameteriv) (unsigned int target, unsigned int pname, int *params) S;
184 void (*glGetClipPlanef) (unsigned int pname, float eqn[4]) S;
185 void (*glGetClipPlanex) (unsigned int pname, int eqn[4]) S;
186 void (*glGetFixedv) (unsigned int pname, int *params) S;
187 void (*glGetFloatv) (unsigned int pname, float *params) S;
188 void (*glGetLightfv) (unsigned int light, unsigned int pname, float *params) S;
189 void (*glGetLightxv) (unsigned int light, unsigned int pname, int *params) S;
190 void (*glGetMaterialfv) (unsigned int face, unsigned int pname, float *params) S;
191 void (*glGetMaterialxv) (unsigned int face, unsigned int pname, int *params) S;
192 void (*glGetPointerv) (unsigned int pname, void **params) S;
193 void (*glGetTexEnvfv) (unsigned int env, unsigned int pname, float *params) S;
194 void (*glGetTexEnviv) (unsigned int env, unsigned int pname, int *params) S;
195 void (*glGetTexEnvxv) (unsigned int env, unsigned int pname, int *params) S;
196 void (*glGetTexParameterfv) (unsigned int target, unsigned int pname, float *params) S;
197 void (*glGetTexParameteriv) (unsigned int target, unsigned int pname, int *params) S;
198 void (*glGetTexParameterxv) (unsigned int target, unsigned int pname, int *params) S;
199 unsigned char (*glIsBuffer) (unsigned int buffer) S;
200 unsigned char (*glIsEnabled) (unsigned int cap) S;
201 unsigned char (*glIsTexture) (unsigned int texture) S;
202 void (*glPointParameterf) (unsigned int pname, float param) S;
203 void (*glPointParameterfv) (unsigned int pname, const float *params) S;
204 void (*glPointParameterx) (unsigned int pname, int param) S;
205 void (*glPointParameterxv) (unsigned int pname, const int *params) S;
206 void (*glPointSizePointerOES) (unsigned int type, int stride, const void *pointer) S;
207 void (*glTexEnvi) (unsigned int target, unsigned int pname, int param) S;
208 void (*glTexEnviv) (unsigned int target, unsigned int pname, const int *params) S;
209 void (*glTexParameterfv) (unsigned int target, unsigned int pname, const float *params) S;
210 void (*glTexParameteri) (unsigned int target, unsigned int pname, int param) S;
211 void (*glTexParameteriv) (unsigned int target, unsigned int pname, const int *params) S;
212 void (*glTexParameterxv) (unsigned int target, unsigned int pname, const int *params) S;
214 int (*eglBindTexImage) (int dpy, int surface, int buffer) S;
215 int (*eglReleaseTexImage) (int dpy, int surface, int buffer) S;
216 int (*eglSurfaceAttrib) (int dpy, int surface, int attribute, int value) S;
218 };
219 #if !defined (__WINS__)
220 #if defined(__TARGET_FPU_VFP)
221 #pragma no_softfp_linkage
222 #endif
223 #endif
226 #endif