1 #include "../gl.h"
2 #include <GLES/glext.h>
3 
4 #ifndef GL_WRAP_H
5 #define GL_WRAP_H
6 
7 // misc naive wrappers
8 #ifdef USE_ES2
9 void glCompileShaderARB(GLuint shader);
10 GLuint glCreateShaderObjectARB(GLenum shaderType);
11 void glGetObjectParameterivARB(GLuint shader, GLenum pname, GLint *params);
12 void glShaderSourceARB(GLuint shader, GLsizei count, const GLchar **string, const GLint *length);
13 #endif
14 
15 void glActiveTextureARB(GLenum texture);
16 void glClearDepth(GLdouble depth);
17 void glClientActiveTextureARB(GLenum texture);
18 void glClipPlane(GLenum plane, const GLdouble *equation);
19 void glDepthRange(GLdouble nearVal, GLdouble farVal);
20 void glFogi(GLenum pname, GLint param);
21 void glFogiv(GLenum pname, GLint *params);
22 void glFrustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near, GLdouble far);
23 void glGetDoublev(GLenum pname, GLdouble *params);
24 void glLighti(GLenum light, GLenum pname, GLint param);
25 void glLightiv(GLenum light, GLenum pname, GLint *iparams);
26 void glLightModeli(GLenum pname, GLint param);
27 void glLightModeliv(GLenum pname, GLint *iparams);
28 void glMateriali(GLenum face, GLenum pname, GLint param);
29 void glMaterialiv(GLenum face, GLenum pname, GLint param);
30 void glMultiTexCoord2f(GLenum target, GLfloat s, GLfloat t);
31 void glOrtho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near, GLdouble far);
32 
33 // color
34 void glColor3f(GLfloat r, GLfloat g, GLfloat b);
35 void glColor3fv(GLfloat *c);
36 void glColor4fv(GLfloat *c);
37 void glIndexfv(const GLfloat *c);
38 void glSecondaryColor3fv(const GLfloat *v);
39 
40 // raster
41 void glRasterPos2f(GLfloat x, GLfloat y);
42 void glRasterPos2fv(const GLfloat *v);
43 void glRasterPos3f(GLfloat x, GLfloat y, GLfloat z);
44 void glRasterPos3fv(const GLfloat *v);
45 void glRasterPos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w);
46 void glRasterPos4fv(const GLfloat *v);
47 
48 // eval
49 void glEvalCoord1d(GLdouble u);
50 void glEvalCoord1dv(GLdouble *v);
51 void glEvalCoord1fv(GLfloat *v);
52 void glEvalCoord2d(GLdouble u, GLdouble v);
53 void glEvalCoord2dv(GLdouble *v);
54 void glEvalCoord2fv(GLfloat *v);
55 void glMapGrid1d(GLint un, GLdouble u1, GLdouble u2);
56 void glMapGrid2d(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2);
57 
58 // matrix
59 void glLoadMatrixd(const GLdouble *m);
60 void glMultMatrixd(const GLdouble *m);
61 
62 // normal
63 void glNormal3fv(GLfloat *v);
64 
65 // rect
66 #define GL_RECT(suffix, type)                                \
67     void glRect##suffix(type x1, type y1, type x2, type y2); \
68     void glRect##suffix##v(const type *v);
69 
70 GL_RECT(d, GLdouble)
71 GL_RECT(f, GLfloat)
72 GL_RECT(i, GLint)
73 GL_RECT(s, GLshort)
74 #undef GL_RECT
75 
76 // textures
77 void glTexCoord1f(GLfloat s);
78 void glTexCoord1fv(GLfloat *t);
79 void glTexCoord2fv(GLfloat *t);
80 void glTexCoord3f(GLfloat s, GLfloat t, GLfloat r);
81 void glTexCoord3fv(GLfloat *t);
82 void glTexCoord4f(GLfloat s, GLfloat t, GLfloat r, GLfloat q);
83 void glTexCoord4fv(GLfloat *t);
84 
85 // texgen
86 void glTexGend(GLenum coord, GLenum pname, GLdouble param);
87 void glTexGeni(GLenum coord, GLenum pname, GLint param);
88 void glTexGenf(GLenum coord, GLenum pname, GLfloat param);
89 void glTexGendv(GLenum coord, GLenum pname, GLdouble *params);
90 void glTexGenfv(GLenum coord, GLenum pname, GLfloat *params);
91 void glTexGeniv(GLenum coord, GLenum pname, GLint *params);
92 
93 // transforms
94 void glRotated(GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
95 void glScaled(GLdouble x, GLdouble y, GLdouble z);
96 void glTranslated(GLdouble x, GLdouble y, GLdouble z);
97 
98 // vertex
99 void glVertex2f(GLfloat x, GLfloat y);
100 void glVertex2fv(GLfloat *v);
101 void glVertex3fv(GLfloat *v);
102 void glVertex4f(GLfloat r, GLfloat g, GLfloat b, GLfloat w);
103 void glVertex4fv(GLfloat *v);
104 
105 // OES wrappers
106 
107 void glClearDepthfOES(GLfloat depth);
108 void glClipPlanefOES(GLenum plane, const GLfloat *equation);
109 void glDepthRangefOES(GLclampf near, GLclampf far);
110 void glFrustumfOES(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat near, GLfloat far);
111 void glGetClipPlanefOES(GLenum plane, GLfloat equation[4]);
112 void glOrthofOES(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat near, GLfloat far);
113 
114 // basic thunking
115 
116 #define THUNK(suffix, type)                                \
117 void glColor3##suffix##v(const type *v);                   \
118 void glColor3##suffix(type r, type g, type b);             \
119 void glColor4##suffix##v(const type *v);                   \
120 void glColor4##suffix(type r, type g, type b, type a);     \
121 void glSecondaryColor3##suffix##v(const type *v);          \
122 void glSecondaryColor3##suffix(type r, type g, type b);    \
123 void glIndex##suffix##v(const type *c);                    \
124 void glIndex##suffix(type c);                              \
125 void glNormal3##suffix##v(const type *v);                  \
126 void glNormal3##suffix(type x, type y, type z);            \
127 void glRasterPos2##suffix##v(type *v);                     \
128 void glRasterPos2##suffix(type x, type y);                 \
129 void glRasterPos3##suffix##v(type *v);                     \
130 void glRasterPos3##suffix(type x, type y, type z);         \
131 void glRasterPos4##suffix##v(type *v);                     \
132 void glRasterPos4##suffix(type x, type y, type z, type w); \
133 void glVertex2##suffix##v(type *v);                        \
134 void glVertex2##suffix(type x, type y);                    \
135 void glVertex3##suffix##v(type *v);                        \
136 void glVertex3##suffix(type x, type y, type z);            \
137 void glVertex4##suffix(type x, type y, type z, type w);    \
138 void glVertex4##suffix##v(type *v);                        \
139 void glTexCoord1##suffix(type s);                          \
140 void glTexCoord1##suffix##v(type *t);                      \
141 void glTexCoord2##suffix(type s, type t);                  \
142 void glTexCoord2##suffix##v(type *t);                      \
143 void glTexCoord3##suffix(type s, type t, type r);          \
144 void glTexCoord3##suffix##v(type *t);                      \
145 void glTexCoord4##suffix(type s, type t, type r, type q);  \
146 void glTexCoord4##suffix##v(type *t);
147 
148 THUNK(b, GLbyte)
149 THUNK(d, GLdouble)
150 THUNK(i, GLint)
151 THUNK(s, GLshort)
152 THUNK(ub, GLubyte)
153 THUNK(ui, GLuint)
154 THUNK(us, GLushort)
155 #undef THUNK
156 
157 #define THUNK(suffix, type) \
158     extern void glGet##suffix##v(GLenum pname, type *params);
159 
160 THUNK(Double, GLdouble)
161 THUNK(Integer, GLint)
162 #undef THUNK
163 
164 #endif
165