|
1 /* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
2 * |
|
3 * Permission is hereby granted, free of charge, to any person obtaining a |
|
4 * copy of this software and /or associated documentation files |
|
5 * (the "Materials "), to deal in the Materials without restriction, |
|
6 * including without limitation the rights to use, copy, modify, merge, |
|
7 * publish, distribute, sublicense, and/or sell copies of the Materials, |
|
8 * and to permit persons to whom the Materials are furnished to do so, |
|
9 * subject to the following conditions: |
|
10 * |
|
11 * The above copyright notice and this permission notice shall be included |
|
12 * in all copies or substantial portions of the Materials. |
|
13 * |
|
14 * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
|
15 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
|
16 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
|
17 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
|
18 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR |
|
19 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR |
|
20 * THE USE OR OTHER DEALINGS IN THE MATERIALS. |
|
21 * |
|
22 * Initial Contributors: |
|
23 * Nokia Corporation - initial contribution. |
|
24 * |
|
25 * Contributors: |
|
26 * |
|
27 * Description: |
|
28 * |
|
29 */ |
|
30 |
|
31 #ifndef _DESKTOPGL_H_ |
|
32 #define _DESKTOPGL_H_ |
|
33 |
|
34 #include <GLES/gl.h> |
|
35 #include "glesInternal.h" |
|
36 |
|
37 class GLESDesktopGL |
|
38 { |
|
39 public: |
|
40 GLESDesktopGL(); |
|
41 |
|
42 bool Load(); |
|
43 |
|
44 void (GL_APIENTRY *glActiveTexture) ( GLenum texture ); |
|
45 void (GL_APIENTRY *glAlphaFunc) (GLenum func, GLclampf ref); |
|
46 void (GL_APIENTRY *glBegin)( GLenum mode ); |
|
47 void (GL_APIENTRY *glBindBuffer) (GLenum target, GLuint buffer); |
|
48 void (GL_APIENTRY *glBindTexture) (GLenum target, GLuint texture); |
|
49 void (GL_APIENTRY *glBlendFunc) (GLenum sfactor, GLenum dfactor); |
|
50 void (GL_APIENTRY *glBufferData) (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage); |
|
51 void (GL_APIENTRY *glBufferSubData) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data); |
|
52 void (GL_APIENTRY *glClear) (GLbitfield mask); |
|
53 void (GL_APIENTRY *glClearColor) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); |
|
54 void (GL_APIENTRY *glClearDepth) (GLclampd depth); |
|
55 void (GL_APIENTRY *glClearStencil) (GLint s); |
|
56 void (GL_APIENTRY *glClientActiveTexture) ( GLenum texture ); |
|
57 void (GL_APIENTRY *glClipPlane) (GLenum plane, const GLdouble *equation); |
|
58 void (GL_APIENTRY *glColor4d) (GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha); |
|
59 void (GL_APIENTRY *glColor4f) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); |
|
60 void (GL_APIENTRY *glColor4fv) ( const GLfloat *v ); |
|
61 void (GL_APIENTRY *glColor4ub) (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); |
|
62 void (GL_APIENTRY *glColor4ubv) ( const GLubyte *v ); |
|
63 void (GL_APIENTRY *glColorMask) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); |
|
64 void (GL_APIENTRY *glColorPointer) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); |
|
65 void (GL_APIENTRY *glCompressedTexImage2D) ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data ); |
|
66 void (GL_APIENTRY *glCompressedTexSubImage2D) ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data ); |
|
67 void (GL_APIENTRY *glCopyTexImage2D) (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); |
|
68 void (GL_APIENTRY *glCopyTexSubImage2D) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); |
|
69 void (GL_APIENTRY *glCullFace) (GLenum mode); |
|
70 void (GL_APIENTRY *glDeleteBuffers) (GLsizei n, const GLuint *buffers); |
|
71 void (GL_APIENTRY *glDeleteTextures) (GLsizei n, const GLuint *textures); |
|
72 void (GL_APIENTRY *glDepthFunc) (GLenum func); |
|
73 void (GL_APIENTRY *glDepthMask) (GLboolean flag); |
|
74 void (GL_APIENTRY *glDepthRange) (GLclampd zNear, GLclampd zFar); |
|
75 void (GL_APIENTRY *glDisable) (GLenum cap); |
|
76 void (GL_APIENTRY *glDisableClientState) (GLenum array); |
|
77 void (GL_APIENTRY *glDrawArrays) (GLenum mode, GLint first, GLsizei count); |
|
78 void (GL_APIENTRY *glDrawElements) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices); |
|
79 void (GL_APIENTRY *glEnable) (GLenum cap); |
|
80 void (GL_APIENTRY *glEnableClientState) (GLenum array); |
|
81 void (GL_APIENTRY *glEnd) ( void ); |
|
82 void (GL_APIENTRY *glFinish) (void); |
|
83 void (GL_APIENTRY *glFlush) (void); |
|
84 void (GL_APIENTRY *glFogf) (GLenum pname, GLfloat param); |
|
85 void (GL_APIENTRY *glFogfv) (GLenum pname, const GLfloat *params); |
|
86 void (GL_APIENTRY *glFrontFace) (GLenum mode); |
|
87 void (GL_APIENTRY *glFrustum) (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); |
|
88 void (GL_APIENTRY *glGenBuffers) (GLsizei n, GLuint *buffers); |
|
89 void (GL_APIENTRY *glGenTextures) (GLsizei n, GLuint *textures); |
|
90 void (GL_APIENTRY *glGetBooleanv) (GLenum pname, GLboolean *params); |
|
91 void (GL_APIENTRY *glGetBufferParameteriv) (GLenum, GLenum, GLint *); |
|
92 void (GL_APIENTRY *glGetClipPlane) (GLenum plane, GLdouble *equation); |
|
93 void (GL_APIENTRY *glGetDoublev) ( GLenum pname, GLdouble *params ); |
|
94 GLenum (GL_APIENTRY *glGetError) (void); |
|
95 void (GL_APIENTRY *glGetFloatv) (GLenum pname, GLfloat *params); |
|
96 void (GL_APIENTRY *glGetIntegerv) (GLenum pname, GLint *params); |
|
97 void (GL_APIENTRY *glGetLightfv) (GLenum light, GLenum pname, GLfloat *params); |
|
98 void (GL_APIENTRY *glGetMaterialfv) (GLenum face, GLenum pname, GLfloat *params); |
|
99 void (GL_APIENTRY *glGetPointerv) (GLenum pname, GLvoid* *params); |
|
100 const GLubyte * (GL_APIENTRY *glGetString) (GLenum name); |
|
101 void (GL_APIENTRY *glGetTexEnvfv) (GLenum target, GLenum pname, GLfloat *params); |
|
102 void (GL_APIENTRY *glGetTexEnviv) (GLenum target, GLenum pname, GLint *params); |
|
103 void (GL_APIENTRY *glGetTexParameterfv) (GLenum target, GLenum pname, GLfloat *params); |
|
104 void (GL_APIENTRY *glGetTexParameteriv) (GLenum target, GLenum pname, GLint *params); |
|
105 void (GL_APIENTRY *glHint) (GLenum target, GLenum mode); |
|
106 GLboolean (GL_APIENTRY *glIsBuffer) (GLuint); |
|
107 GLboolean (GL_APIENTRY *glIsEnabled) (GLenum cap); |
|
108 GLboolean (GL_APIENTRY *glIsTexture) (GLuint texture); |
|
109 void (GL_APIENTRY *glLightf) (GLenum light, GLenum pname, GLfloat param); |
|
110 void (GL_APIENTRY *glLightfv) (GLenum light, GLenum pname, const GLfloat *params); |
|
111 void (GL_APIENTRY *glLightModelf) (GLenum pname, GLfloat param); |
|
112 void (GL_APIENTRY *glLightModelfv) (GLenum pname, const GLfloat *params); |
|
113 void (GL_APIENTRY *glLineWidth) (GLfloat width); |
|
114 void (GL_APIENTRY *glLoadIdentity) (void); |
|
115 void (GL_APIENTRY *glLoadMatrixf) (const GLfloat *m); |
|
116 void (GL_APIENTRY *glLogicOp) (GLenum opcode); |
|
117 void (GL_APIENTRY *glMaterialf) (GLenum face, GLenum pname, GLfloat param); |
|
118 void (GL_APIENTRY *glMaterialfv) (GLenum face, GLenum pname, const GLfloat *params); |
|
119 void (GL_APIENTRY *glMultiTexCoord2fv) ( GLenum target, const GLfloat *v ); |
|
120 void (GL_APIENTRY *glMultiTexCoord2sv) ( GLenum target, const GLshort *v ); |
|
121 void (GL_APIENTRY *glMultiTexCoord3fv) ( GLenum target, const GLfloat *v ); |
|
122 void (GL_APIENTRY *glMultiTexCoord3sv) ( GLenum target, const GLshort *v ); |
|
123 void (GL_APIENTRY *glMultiTexCoord4f) ( GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q ); |
|
124 void (GL_APIENTRY *glMultiTexCoord4fv) ( GLenum target, const GLfloat *v ); |
|
125 void (GL_APIENTRY *glMultiTexCoord4sv) ( GLenum target, const GLshort *v ); |
|
126 void (GL_APIENTRY *glMultMatrixf) (const GLfloat *m); |
|
127 void (GL_APIENTRY *glNormal3f) (GLfloat nx, GLfloat ny, GLfloat nz); |
|
128 void (GL_APIENTRY *glNormal3fv) ( const GLfloat *v ); |
|
129 void (GL_APIENTRY *glNormal3sv) ( const GLshort *v ); |
|
130 void (GL_APIENTRY *glOrtho) (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); |
|
131 void (GL_APIENTRY *glPointParameterf) (GLenum, GLfloat); |
|
132 void (GL_APIENTRY *glPointParameterfv) (GLenum, const GLfloat *); |
|
133 void (GL_APIENTRY *glPointSize) (GLfloat size); |
|
134 void (GL_APIENTRY *glPolygonOffset) (GLfloat factor, GLfloat units); |
|
135 void (GL_APIENTRY *glRotatef) (GLfloat angle, GLfloat x, GLfloat y, GLfloat z); |
|
136 void (GL_APIENTRY *glScalef) (GLfloat x, GLfloat y, GLfloat z); |
|
137 void (GL_APIENTRY *glTexEnvf) (GLenum target, GLenum pname, GLfloat param); |
|
138 void (GL_APIENTRY *glTexEnvfv) (GLenum target, GLenum pname, const GLfloat *params); |
|
139 void (GL_APIENTRY *glTexParameterf) (GLenum target, GLenum pname, GLfloat param); |
|
140 void (GL_APIENTRY *glTexParameterfv) (GLenum target, GLenum pname, const GLfloat *params); |
|
141 void (GL_APIENTRY *glMatrixMode) (GLenum mode); |
|
142 void (GL_APIENTRY *glNormalPointer) (GLenum type, GLsizei stride, const GLvoid *pointer); |
|
143 void (GL_APIENTRY *glPixelStorei) (GLenum pname, GLint param); |
|
144 void (GL_APIENTRY *glPopMatrix) (void); |
|
145 void (GL_APIENTRY *glPushMatrix) (void); |
|
146 void (GL_APIENTRY *glReadPixels) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels); |
|
147 void (GL_APIENTRY *glSampleCoverage) ( GLclampf value, GLboolean invert ); |
|
148 void (GL_APIENTRY *glScissor) (GLint x, GLint y, GLsizei width, GLsizei height); |
|
149 void (GL_APIENTRY *glShadeModel) (GLenum mode); |
|
150 void (GL_APIENTRY *glStencilFunc) (GLenum func, GLint ref, GLuint mask); |
|
151 void (GL_APIENTRY *glStencilMask) (GLuint mask); |
|
152 void (GL_APIENTRY *glStencilOp) (GLenum fail, GLenum zfail, GLenum zpass); |
|
153 void (GL_APIENTRY *glTexCoordPointer) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); |
|
154 void (GL_APIENTRY *glTexEnvi) (GLenum target, GLenum pname, GLint param); |
|
155 void (GL_APIENTRY *glTexEnviv) (GLenum target, GLenum pname, const GLint *params); |
|
156 void (GL_APIENTRY *glTexImage2D) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); |
|
157 void (GL_APIENTRY *glTexParameteri) (GLenum target, GLenum pname, GLint param); |
|
158 void (GL_APIENTRY *glTexParameteriv) (GLenum target, GLenum pname, const GLint *params); |
|
159 void (GL_APIENTRY *glTexSubImage2D) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); |
|
160 void (GL_APIENTRY *glTranslatef) (GLfloat x, GLfloat y, GLfloat z); |
|
161 void (GL_APIENTRY *glVertex2fv) ( const GLfloat *v ); |
|
162 void (GL_APIENTRY *glVertex2sv) ( const GLshort *v ); |
|
163 void (GL_APIENTRY *glVertex3fv) ( const GLfloat *v ); |
|
164 void (GL_APIENTRY *glVertex3sv) ( const GLshort *v ); |
|
165 void (GL_APIENTRY *glVertex4fv) ( const GLfloat *v ); |
|
166 void (GL_APIENTRY *glVertex4sv) ( const GLshort *v ); |
|
167 void (GL_APIENTRY *glVertexPointer) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); |
|
168 void (GL_APIENTRY *glViewport) (GLint x, GLint y, GLsizei width, GLsizei height); |
|
169 |
|
170 // for internal use in EGLtoGLESInterface::UpdateBuffers() |
|
171 void (GL_APIENTRY *glDrawPixels) (GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); |
|
172 |
|
173 private: |
|
174 bool m_loaded; |
|
175 }; |
|
176 |
|
177 #endif // _DESKTOPGL_H_ |