blob: c9592a5f969d58ecb843621d51861d0c3ef9091e [file] [log] [blame]
twiz@google.com59a190b2011-03-14 21:23:01 +00001/*
2 Copyright 2011 Google Inc.
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15 */
16
17
18#ifndef GrGLInterface_DEFINED
19#define GrGLInterface_DEFINED
20
bsalomon@google.comf987d1b2011-04-04 17:13:52 +000021#include "GrGLConfig.h"
twiz@google.com59a190b2011-03-14 21:23:01 +000022
23#if !defined(GR_GL_FUNCTION_TYPE)
24 #define GR_GL_FUNCTION_TYPE
25#endif
26
27////////////////////////////////////////////////////////////////////////////////
28
29/**
30 * Helpers for glGetString()
31 */
bsalomon@google.comf987d1b2011-04-04 17:13:52 +000032
33void gl_version_from_string(int* major, int* minor,
34 const char* versionString);
35bool has_gl_extension_from_string(const char* ext,
36 const char* extensionString);
37
twiz@google.com59a190b2011-03-14 21:23:01 +000038bool has_gl_extension(const char* ext);
39void gl_version(int* major, int* minor);
40
bsalomon@google.comf987d1b2011-04-04 17:13:52 +000041
twiz@google.com59a190b2011-03-14 21:23:01 +000042////////////////////////////////////////////////////////////////////////////////
43
44/*
45 * Routines managing the global interface used to invoke OpenGL calls.
46 */
47struct GrGLInterface;
bsalomon@google.com91826102011-03-21 19:51:57 +000048GR_API GrGLInterface* GrGLGetGLInterface();
49GR_API void GrGLSetGLInterface(GrGLInterface* gl_interface);
twiz@google.com59a190b2011-03-14 21:23:01 +000050
51/*
bsalomon@google.comf987d1b2011-04-04 17:13:52 +000052 * This is called when GrGLSetGLInterface() hasn't been called before creating a
53 * GrGpuGL object. It provides a default implementation. The actual implementation
54 * depends on which GrGLDefaultInterface_*.cpp has been linked. There are some
55 * platform-specific implementations provided as well as
56 * GrGLDefaultInterface_none.cpp which does nothing (effectively requiring an
57 * explicit GrGLSetGLInterface call by the host).
twiz@google.com59a190b2011-03-14 21:23:01 +000058 */
bsalomon@google.comf987d1b2011-04-04 17:13:52 +000059void GrGLSetDefaultGLInterface();
twiz@google.com59a190b2011-03-14 21:23:01 +000060
twiz@google.com0f31ca72011-03-18 17:38:11 +000061typedef unsigned int GrGLenum;
62typedef unsigned char GrGLboolean;
63typedef unsigned int GrGLbitfield;
64typedef signed char GrGLbyte;
65typedef short GrGLshort;
66typedef int GrGLint;
67typedef int GrGLsizei;
68typedef unsigned char GrGLubyte;
69typedef unsigned short GrGLushort;
70typedef unsigned int GrGLuint;
71typedef float GrGLfloat;
72typedef float GrGLclampf;
73typedef double GrGLdouble;
74typedef double GrGLclampd;
75typedef void GrGLvoid;
bsalomon@google.comf987d1b2011-04-04 17:13:52 +000076typedef long GrGLintptr;
77typedef long GrGLsizeiptr;
twiz@google.com0f31ca72011-03-18 17:38:11 +000078
twiz@google.comb65e0cb2011-03-18 20:41:44 +000079enum GrGLBinding {
80 kDesktop_GrGLBinding = 0x01,
81 kES1_GrGLBinding = 0x02,
82 kES2_GrGLBinding = 0x04
83};
84
twiz@google.com59a190b2011-03-14 21:23:01 +000085extern "C" {
86/*
87 * The following interface exports the OpenGL entry points used by the system.
88 * Use of OpenGL calls is disallowed. All calls should be invoked through
89 * the global instance of this struct, defined above.
90 *
91 * IMPORTANT NOTE: The OpenGL entry points exposed here include both core GL
92 * functions, and extensions. The system assumes that the address of the
93 * extension pointer will be valid across contexts.
94 */
95struct GrGLInterface {
twiz@google.com0f31ca72011-03-18 17:38:11 +000096 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLActiveTextureProc)(GrGLenum texture);
97 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLAttachShaderProc)(GrGLuint program, GrGLuint shader);
98 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLBindAttribLocationProc)(GrGLuint program, GrGLuint index, const char* name);
99 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLBindBufferProc)(GrGLenum target, GrGLuint buffer);
100 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLBindTextureProc)(GrGLenum target, GrGLuint texture);
101 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLBlendColorProc)(GrGLclampf red, GrGLclampf green, GrGLclampf blue, GrGLclampf alpha);
102 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLBlendFuncProc)(GrGLenum sfactor, GrGLenum dfactor);
bsalomon@google.comf987d1b2011-04-04 17:13:52 +0000103 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLBufferDataProc)(GrGLenum target, GrGLsizeiptr size, const GrGLvoid* data, GrGLenum usage);
104 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLBufferSubDataProc)(GrGLenum target, GrGLintptr offset, GrGLsizeiptr size, const GrGLvoid* data);
twiz@google.com0f31ca72011-03-18 17:38:11 +0000105 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLClearProc)(GrGLbitfield mask);
106 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLClearColorProc)(GrGLclampf red, GrGLclampf green, GrGLclampf blue, GrGLclampf alpha);
107 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLClearStencilProc)(GrGLint s);
108 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLClientActiveTextureProc)(GrGLenum texture);
109 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLColor4ubProc)(GrGLubyte red, GrGLubyte green, GrGLubyte blue, GrGLubyte alpha);
110 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLColorMaskProc)(GrGLboolean red, GrGLboolean green, GrGLboolean blue, GrGLboolean alpha);
111 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLColorPointerProc)(GrGLint size, GrGLenum type, GrGLsizei stride, const GrGLvoid* pointer);
112 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLCompileShaderProc)(GrGLuint shader);
113 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLCompressedTexImage2DProc)(GrGLenum target, GrGLint level, GrGLenum internalformat, GrGLsizei width, GrGLsizei height, GrGLint border, GrGLsizei imageSize, const GrGLvoid* data);
114 typedef GrGLuint (GR_GL_FUNCTION_TYPE *GrGLCreateProgramProc)(void);
115 typedef GrGLuint (GR_GL_FUNCTION_TYPE *GrGLCreateShaderProc)(GrGLenum type);
116 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLCullFaceProc)(GrGLenum mode);
117 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDeleteBuffersProc)(GrGLsizei n, const GrGLuint* buffers);
118 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDeleteProgramProc)(GrGLuint program);
119 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDeleteShaderProc)(GrGLuint shader);
120 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDeleteTexturesProc)(GrGLsizei n, const GrGLuint* textures);
121 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDepthMaskProc)(GrGLboolean flag);
122 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDisableProc)(GrGLenum cap);
123 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDisableClientStateProc)(GrGLenum array);
124 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDisableVertexAttribArrayProc)(GrGLuint index);
125 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDrawArraysProc)(GrGLenum mode, GrGLint first, GrGLsizei count);
126 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDrawElementsProc)(GrGLenum mode, GrGLsizei count, GrGLenum type, const GrGLvoid* indices);
127 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLEnableProc)(GrGLenum cap);
128 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLEnableClientStateProc)(GrGLenum cap);
129 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLEnableVertexAttribArrayProc)(GrGLuint index);
130 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLFrontFaceProc)(GrGLenum mode);
131 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGenBuffersProc)(GrGLsizei n, GrGLuint* buffers);
twiz@google.com0f31ca72011-03-18 17:38:11 +0000132 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGenTexturesProc)(GrGLsizei n, GrGLuint* textures);
133 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGetBufferParameterivProc)(GrGLenum target, GrGLenum pname, GrGLint* params);
bsalomon@google.comf987d1b2011-04-04 17:13:52 +0000134 typedef GrGLenum (GR_GL_FUNCTION_TYPE *GrGLGetErrorProc)(void);
twiz@google.com0f31ca72011-03-18 17:38:11 +0000135 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGetIntegervProc)(GrGLenum pname, GrGLint* params);
136 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGetProgramInfoLogProc)(GrGLuint program, GrGLsizei bufsize, GrGLsizei* length, char* infolog);
137 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGetProgramivProc)(GrGLuint program, GrGLenum pname, GrGLint* params);
138 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGetShaderInfoLogProc)(GrGLuint shader, GrGLsizei bufsize, GrGLsizei* length, char* infolog);
139 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGetShaderivProc)(GrGLuint shader, GrGLenum pname, GrGLint* params);
140 typedef const GrGLubyte* (GR_GL_FUNCTION_TYPE *GrGLGetStringProc)(GrGLenum name);
141 typedef GrGLint (GR_GL_FUNCTION_TYPE *GrGLGetUniformLocationProc)(GrGLuint program, const char* name);
142 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLLineWidthProc)(GrGLfloat width);
143 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLLinkProgramProc)(GrGLuint program);
144 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLLoadMatrixfProc)(const GrGLfloat* m);
145 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLMatrixModeProc)(GrGLenum mode);
146 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLPixelStoreiProc)(GrGLenum pname, GrGLint param);
147 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLPointSizeProc)(GrGLfloat size);
148 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLReadPixelsProc)(GrGLint x, GrGLint y, GrGLsizei width, GrGLsizei height, GrGLenum format, GrGLenum type, GrGLvoid* pixels);
149 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLScissorProc)(GrGLint x, GrGLint y, GrGLsizei width, GrGLsizei height);
150 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLShadeModelProc)(GrGLenum mode);
151 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLShaderSourceProc)(GrGLuint shader, GrGLsizei count, const char** str, const GrGLint* length);
152 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLStencilFuncProc)(GrGLenum func, GrGLint ref, GrGLuint mask);
153 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLStencilFuncSeparateProc)(GrGLenum face, GrGLenum func, GrGLint ref, GrGLuint mask);
154 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLStencilMaskProc)(GrGLuint mask);
155 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLStencilMaskSeparateProc)(GrGLenum face, GrGLuint mask);
156 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLStencilOpProc)(GrGLenum fail, GrGLenum zfail, GrGLenum zpass);
157 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLStencilOpSeparateProc)(GrGLenum face, GrGLenum fail, GrGLenum zfail, GrGLenum zpass);
158 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLTexCoordPointerProc)(GrGLint size, GrGLenum type, GrGLsizei stride, const GrGLvoid* pointer);
159 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLTexEnviProc)(GrGLenum target, GrGLenum pname, GrGLint param);
160 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLTexImage2DProc)(GrGLenum target, GrGLint level, GrGLint internalformat, GrGLsizei width, GrGLsizei height, GrGLint border, GrGLenum format, GrGLenum type, const GrGLvoid* pixels);
161 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLTexParameteriProc)(GrGLenum target, GrGLenum pname, GrGLint param);
162 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLTexSubImage2DProc)(GrGLenum target, GrGLint level, GrGLint xoffset, GrGLint yoffset, GrGLsizei width, GrGLsizei height, GrGLenum format, GrGLenum type, const GrGLvoid* pixels);
163 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform1fvProc)(GrGLint location, GrGLsizei count, const GrGLfloat* v);
164 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform1iProc)(GrGLint location, GrGLint x);
165 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform4fvProc)(GrGLint location, GrGLsizei count, const GrGLfloat* v);
166 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniformMatrix3fvProc)(GrGLint location, GrGLsizei count, GrGLboolean transpose, const GrGLfloat* value);
167 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUseProgramProc)(GrGLuint program);
168 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLVertexAttrib4fvProc)(GrGLuint indx, const GrGLfloat* values);
169 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLVertexAttribPointerProc)(GrGLuint indx, GrGLint size, GrGLenum type, GrGLboolean normalized, GrGLsizei stride, const GrGLvoid* ptr);
170 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLVertexPointerProc)(GrGLint size, GrGLenum type, GrGLsizei stride, const GrGLvoid* pointer);
171 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLViewportProc)(GrGLint x, GrGLint y, GrGLsizei width, GrGLsizei height);
twiz@google.com59a190b2011-03-14 21:23:01 +0000172
173 // FBO Extension Functions
twiz@google.com0f31ca72011-03-18 17:38:11 +0000174 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLBindFramebufferProc)(GrGLenum target, GrGLuint framebuffer);
175 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLBindRenderbufferProc)(GrGLenum target, GrGLuint renderbuffer);
176 typedef GrGLenum (GR_GL_FUNCTION_TYPE *GrGLCheckFramebufferStatusProc)(GrGLenum target);
177 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDeleteFramebuffersProc)(GrGLsizei n, const GrGLuint *framebuffers);
178 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDeleteRenderbuffersProc)(GrGLsizei n, const GrGLuint *renderbuffers);
179 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLFramebufferRenderbufferProc)(GrGLenum target, GrGLenum attachment, GrGLenum renderbuffertarget, GrGLuint renderbuffer);
180 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLFramebufferTexture2DProc)(GrGLenum target, GrGLenum attachment, GrGLenum textarget, GrGLuint texture, GrGLint level);
181 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGenFramebuffersProc)(GrGLsizei n, GrGLuint *framebuffers);
182 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGenRenderbuffersProc)(GrGLsizei n, GrGLuint *renderbuffers);
183 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLRenderbufferStorageProc)(GrGLenum target, GrGLenum internalformat, GrGLsizei width, GrGLsizei height);
twiz@google.com59a190b2011-03-14 21:23:01 +0000184
185 // Multisampling Extension Functions
186 // same prototype for ARB_FBO, EXT_FBO, GL 3.0, & Apple ES extension
twiz@google.com0f31ca72011-03-18 17:38:11 +0000187 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLRenderbufferStorageMultisampleProc)(GrGLenum target, GrGLsizei samples, GrGLenum internalformat, GrGLsizei width, GrGLsizei height);
twiz@google.com59a190b2011-03-14 21:23:01 +0000188 // desktop: ext_fbo_blit, arb_fbo, gl 3.0
twiz@google.com0f31ca72011-03-18 17:38:11 +0000189 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLBlitFramebufferProc)(GrGLint srcX0, GrGLint srcY0, GrGLint srcX1, GrGLint srcY1, GrGLint dstX0, GrGLint dstY0, GrGLint dstX1, GrGLint dstY1, GrGLbitfield mask, GrGLenum filter);
twiz@google.com59a190b2011-03-14 21:23:01 +0000190 // apple's es extension
twiz@google.com0f31ca72011-03-18 17:38:11 +0000191 typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLResolveMultisampleFramebufferProc)();
twiz@google.com59a190b2011-03-14 21:23:01 +0000192
twiz@google.com59a190b2011-03-14 21:23:01 +0000193 // Buffer mapping (extension in ES).
twiz@google.com0f31ca72011-03-18 17:38:11 +0000194 typedef GrGLvoid* (GR_GL_FUNCTION_TYPE *GrGLMapBufferProc)(GrGLenum target, GrGLenum access);
195 typedef GrGLboolean (GR_GL_FUNCTION_TYPE *GrGLUnmapBufferProc)(GrGLenum target);
twiz@google.com59a190b2011-03-14 21:23:01 +0000196
twiz@google.comb65e0cb2011-03-18 20:41:44 +0000197 // Indicator variable specifying the type of GL implementation
198 // exported: GLES{1|2} or Desktop.
199 GrGLBinding fBindingsExported;
200
twiz@google.com59a190b2011-03-14 21:23:01 +0000201 GrGLActiveTextureProc fActiveTexture;
202 GrGLAttachShaderProc fAttachShader;
203 GrGLBindAttribLocationProc fBindAttribLocation;
204 GrGLBindBufferProc fBindBuffer;
205 GrGLBindTextureProc fBindTexture;
bsalomon@google.com080773c2011-03-15 19:09:25 +0000206 GrGLBlendColorProc fBlendColor;
bsalomon@google.comf987d1b2011-04-04 17:13:52 +0000207 GrGLBlendFuncProc fBlendFunc;
twiz@google.com59a190b2011-03-14 21:23:01 +0000208 GrGLBufferDataProc fBufferData;
209 GrGLBufferSubDataProc fBufferSubData;
210 GrGLClearProc fClear;
211 GrGLClearColorProc fClearColor;
212 GrGLClearStencilProc fClearStencil;
213 GrGLClientActiveTextureProc fClientActiveTexture;
214 GrGLColor4ubProc fColor4ub;
215 GrGLColorMaskProc fColorMask;
216 GrGLColorPointerProc fColorPointer;
217 GrGLCompileShaderProc fCompileShader;
218 GrGLCompressedTexImage2DProc fCompressedTexImage2D;
219 GrGLCreateProgramProc fCreateProgram;
220 GrGLCreateShaderProc fCreateShader;
221 GrGLCullFaceProc fCullFace;
222 GrGLDeleteBuffersProc fDeleteBuffers;
223 GrGLDeleteProgramProc fDeleteProgram;
224 GrGLDeleteShaderProc fDeleteShader;
225 GrGLDeleteTexturesProc fDeleteTextures;
226 GrGLDepthMaskProc fDepthMask;
227 GrGLDisableProc fDisable;
228 GrGLDisableClientStateProc fDisableClientState;
229 GrGLDisableVertexAttribArrayProc fDisableVertexAttribArray;
230 GrGLDrawArraysProc fDrawArrays;
231 GrGLDrawElementsProc fDrawElements;
232 GrGLEnableProc fEnable;
233 GrGLEnableClientStateProc fEnableClientState;
234 GrGLEnableVertexAttribArrayProc fEnableVertexAttribArray;
235 GrGLFrontFaceProc fFrontFace;
236 GrGLGenBuffersProc fGenBuffers;
237 GrGLGenTexturesProc fGenTextures;
238 GrGLGetBufferParameterivProc fGetBufferParameteriv;
239 GrGLGetErrorProc fGetError;
240 GrGLGetIntegervProc fGetIntegerv;
241 GrGLGetProgramInfoLogProc fGetProgramInfoLog;
242 GrGLGetProgramivProc fGetProgramiv;
243 GrGLGetShaderInfoLogProc fGetShaderInfoLog;
244 GrGLGetShaderivProc fGetShaderiv;
245 GrGLGetStringProc fGetString;
246 GrGLGetUniformLocationProc fGetUniformLocation;
247 GrGLLineWidthProc fLineWidth;
248 GrGLLinkProgramProc fLinkProgram;
249 GrGLLoadMatrixfProc fLoadMatrixf;
250 GrGLMatrixModeProc fMatrixMode;
251 GrGLPixelStoreiProc fPixelStorei;
252 GrGLPointSizeProc fPointSize;
253 GrGLReadPixelsProc fReadPixels;
254 GrGLScissorProc fScissor;
255 GrGLShadeModelProc fShadeModel;
256 GrGLShaderSourceProc fShaderSource;
257 GrGLStencilFuncProc fStencilFunc;
258 GrGLStencilFuncSeparateProc fStencilFuncSeparate;
259 GrGLStencilMaskProc fStencilMask;
260 GrGLStencilMaskSeparateProc fStencilMaskSeparate;
261 GrGLStencilOpProc fStencilOp;
262 GrGLStencilOpSeparateProc fStencilOpSeparate;
263 GrGLTexCoordPointerProc fTexCoordPointer;
264 GrGLTexEnviProc fTexEnvi;
265 GrGLTexImage2DProc fTexImage2D;
266 GrGLTexParameteriProc fTexParameteri;
267 GrGLTexSubImage2DProc fTexSubImage2D;
268 GrGLUniform1fvProc fUniform1fv;
269 GrGLUniform1iProc fUniform1i;
270 GrGLUniform4fvProc fUniform4fv;
271 GrGLUniformMatrix3fvProc fUniformMatrix3fv;
272 GrGLUseProgramProc fUseProgram;
273 GrGLVertexAttrib4fvProc fVertexAttrib4fv;
274 GrGLVertexAttribPointerProc fVertexAttribPointer;
275 GrGLVertexPointerProc fVertexPointer;
276 GrGLViewportProc fViewport;
277
278 // FBO Extension Functions
279 GrGLBindFramebufferProc fBindFramebuffer;
280 GrGLBindRenderbufferProc fBindRenderbuffer;
281 GrGLCheckFramebufferStatusProc fCheckFramebufferStatus;
282 GrGLDeleteFramebuffersProc fDeleteFramebuffers;
283 GrGLDeleteRenderbuffersProc fDeleteRenderbuffers;
284 GrGLFramebufferRenderbufferProc fFramebufferRenderbuffer;
285 GrGLFramebufferTexture2DProc fFramebufferTexture2D;
286 GrGLGenFramebuffersProc fGenFramebuffers;
287 GrGLGenRenderbuffersProc fGenRenderbuffers;
288 GrGLRenderbufferStorageProc fRenderbufferStorage;
289
290 // Multisampling Extension Functions
291 // same prototype for ARB_FBO, EXT_FBO, GL 3.0, & Apple ES extension
292 GrGLRenderbufferStorageMultisampleProc fRenderbufferStorageMultisample;
293 // desktop: ext_fbo_blit, arb_fbo, gl 3.0
294 GrGLBlitFramebufferProc fBlitFramebuffer;
295 // apple's es extension
296 GrGLResolveMultisampleFramebufferProc fResolveMultisampleFramebuffer;
297
twiz@google.com59a190b2011-03-14 21:23:01 +0000298 // Buffer mapping (extension in ES).
299 GrGLMapBufferProc fMapBuffer;
300 GrGLUnmapBufferProc fUnmapBuffer;
bsalomon@google.comf987d1b2011-04-04 17:13:52 +0000301
302 // Code that initializes this struct using a static initializer should
303 // make this the last entry in the static initializer. It can help to guard
304 // against failing to initialize newly-added members of this struct.
305 enum { kStaticInitEndGuard } fStaticInitEndGuard;
twiz@google.com59a190b2011-03-14 21:23:01 +0000306};
307
308} // extern "C"
309
310#endif