DEADSOFTWARE

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