summaryrefslogtreecommitdiffstats
path: root/gpu
diff options
context:
space:
mode:
authorgman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-27 19:19:36 +0000
committergman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-27 19:19:36 +0000
commit586eb39fad5277d3882d5b6b330e481e3b55093c (patch)
tree0a071281c2c9b10425874447276dcc34549285f2 /gpu
parent1ecd2e7fed78fc9050f044ad6853746db9fc65ed (diff)
downloadchromium_src-586eb39fad5277d3882d5b6b330e481e3b55093c.zip
chromium_src-586eb39fad5277d3882d5b6b330e481e3b55093c.tar.gz
chromium_src-586eb39fad5277d3882d5b6b330e481e3b55093c.tar.bz2
Add eglGetProcAddress to pgl.
TEST=none BUG=none Review URL: http://codereview.chromium.org/1797001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45734 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
-rw-r--r--gpu/gpu.gyp1
-rw-r--r--gpu/pgl/egl_proc_address.c312
-rw-r--r--gpu/pgl/pgl.h3
-rw-r--r--gpu/pgl/pgl_proc_address.cc315
4 files changed, 319 insertions, 312 deletions
diff --git a/gpu/gpu.gyp b/gpu/gpu.gyp
index d6a1ea4..37d1638 100644
--- a/gpu/gpu.gyp
+++ b/gpu/gpu.gyp
@@ -410,6 +410,7 @@
'sources': [
'pgl/command_buffer_pepper.cc',
'pgl/command_buffer_pepper.h',
+ 'pgl/pgl_proc_address.cc',
'pgl/pgl.cc',
'pgl/pgl.h',
],
diff --git a/gpu/pgl/egl_proc_address.c b/gpu/pgl/egl_proc_address.c
deleted file mode 100644
index 4fe732aa..0000000
--- a/gpu/pgl/egl_proc_address.c
+++ /dev/null
@@ -1,312 +0,0 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// This file contains the implementation of eglGetProcAddress
-
-#include <stdlib.h>
-#include <GLES2/gl2.h>
-
-typedef void (*EGLFunctionPointer)(void);
-struct EGLFunctionInfo {
- EGLFunctionPointer func;
- char const * const name;
-};
-
-void (* eglGetProcAddress(char const * procname))() {
- static const struct EGLFunctionInfo gl_functions[] = {
- { (EGLFUNCTIONPOINTER)(&glActiveTexture),
- "glActiveTexture", },
- { (EGLFUNCTIONPOINTER)(&glAttachShader),
- "glAttachShader", },
- { (EGLFUNCTIONPOINTER)(&glBindAttribLocation),
- "glBindAttribLocation", },
- { (EGLFUNCTIONPOINTER)(&glBindBuffer),
- "glBindBuffer", },
- { (EGLFUNCTIONPOINTER)(&glBindFramebuffer),
- "glBindFramebuffer", },
- { (EGLFUNCTIONPOINTER)(&glBindRenderbuffer),
- "glBindRenderbuffer", },
- { (EGLFUNCTIONPOINTER)(&glBindTexture),
- "glBindTexture", },
- { (EGLFUNCTIONPOINTER)(&glBlendColor),
- "glBlendColor", },
- { (EGLFUNCTIONPOINTER)(&glBlendEquation),
- "glBlendEquation", },
- { (EGLFUNCTIONPOINTER)(&glBlendEquationSeparate),
- "glBlendEquationSeparate", },
- { (EGLFUNCTIONPOINTER)(&glBlendFunc),
- "glBlendFunc", },
- { (EGLFUNCTIONPOINTER)(&glBlendFuncSeparate),
- "glBlendFuncSeparate", },
- { (EGLFUNCTIONPOINTER)(&glBufferData),
- "glBufferData", },
- { (EGLFUNCTIONPOINTER)(&glBufferSubData),
- "glBufferSubData", },
- { (EGLFUNCTIONPOINTER)(&glCheckFramebufferStatus),
- "glCheckFramebufferStatus", },
- { (EGLFUNCTIONPOINTER)(&glClear),
- "glClear", },
- { (EGLFUNCTIONPOINTER)(&glClearColor),
- "glClearColor", },
- { (EGLFUNCTIONPOINTER)(&glClearDepthf),
- "glClearDepthf", },
- { (EGLFUNCTIONPOINTER)(&glClearStencil),
- "glClearStencil", },
- { (EGLFUNCTIONPOINTER)(&glColorMask),
- "glColorMask", },
- { (EGLFUNCTIONPOINTER)(&glCompileShader),
- "glCompileShader", },
- { (EGLFUNCTIONPOINTER)(&glCompressedTexImage2D),
- "glCompressedTexImage2D", },
- { (EGLFUNCTIONPOINTER)(&glCompressedTexSubImage2D),
- "glCompressedTexSubImage2D", },
- { (EGLFUNCTIONPOINTER)(&glCopyTexImage2D),
- "glCopyTexImage2D", },
- { (EGLFUNCTIONPOINTER)(&glCopyTexSubImage2D),
- "glCopyTexSubImage2D", },
- { (EGLFUNCTIONPOINTER)(&glCreateProgram),
- "glCreateProgram", },
- { (EGLFUNCTIONPOINTER)(&glCreateShader),
- "glCreateShader", },
- { (EGLFUNCTIONPOINTER)(&glCullFace),
- "glCullFace", },
- { (EGLFUNCTIONPOINTER)(&glDeleteBuffers),
- "glDeleteBuffers", },
- { (EGLFUNCTIONPOINTER)(&glDeleteFramebuffers),
- "glDeleteFramebuffers", },
- { (EGLFUNCTIONPOINTER)(&glDeleteProgram),
- "glDeleteProgram", },
- { (EGLFUNCTIONPOINTER)(&glDeleteRenderbuffers),
- "glDeleteRenderbuffers", },
- { (EGLFUNCTIONPOINTER)(&glDeleteShader),
- "glDeleteShader", },
- { (EGLFUNCTIONPOINTER)(&glDeleteTextures),
- "glDeleteTextures", },
- { (EGLFUNCTIONPOINTER)(&glDepthFunc),
- "glDepthFunc", },
- { (EGLFUNCTIONPOINTER)(&glDepthMask),
- "glDepthMask", },
- { (EGLFUNCTIONPOINTER)(&glDepthRangef),
- "glDepthRangef", },
- { (EGLFUNCTIONPOINTER)(&glDetachShader),
- "glDetachShader", },
- { (EGLFUNCTIONPOINTER)(&glDisable),
- "glDisable", },
- { (EGLFUNCTIONPOINTER)(&glDisableVertexAttribArray),
- "glDisableVertexAttribArray", },
- { (EGLFUNCTIONPOINTER)(&glDrawArrays),
- "glDrawArrays", },
- { (EGLFUNCTIONPOINTER)(&glDrawElements),
- "glDrawElements", },
- { (EGLFUNCTIONPOINTER)(&glEnable),
- "glEnable", },
- { (EGLFUNCTIONPOINTER)(&glEnableVertexAttribArray),
- "glEnableVertexAttribArray", },
- { (EGLFUNCTIONPOINTER)(&glFinish),
- "glFinish", },
- { (EGLFUNCTIONPOINTER)(&glFlush),
- "glFlush", },
- { (EGLFUNCTIONPOINTER)(&glFramebufferRenderbuffer),
- "glFramebufferRenderbuffer", },
- { (EGLFUNCTIONPOINTER)(&glFramebufferTexture2D),
- "glFramebufferTexture2D", },
- { (EGLFUNCTIONPOINTER)(&glFrontFace),
- "glFrontFace", },
- { (EGLFUNCTIONPOINTER)(&glGenBuffers),
- "glGenBuffers", },
- { (EGLFUNCTIONPOINTER)(&glGenerateMipmap),
- "glGenerateMipmap", },
- { (EGLFUNCTIONPOINTER)(&glGenFramebuffers),
- "glGenFramebuffers", },
- { (EGLFUNCTIONPOINTER)(&glGenRenderbuffers),
- "glGenRenderbuffers", },
- { (EGLFUNCTIONPOINTER)(&glGenTextures),
- "glGenTextures", },
- { (EGLFUNCTIONPOINTER)(&glGetActiveAttrib),
- "glGetActiveAttrib", },
- { (EGLFUNCTIONPOINTER)(&glGetActiveUniform),
- "glGetActiveUniform", },
- { (EGLFUNCTIONPOINTER)(&glGetAttachedShaders),
- "glGetAttachedShaders", },
- { (EGLFUNCTIONPOINTER)(&glGetAttribLocation),
- "glGetAttribLocation", },
- { (EGLFUNCTIONPOINTER)(&glGetBooleanv),
- "glGetBooleanv", },
- { (EGLFUNCTIONPOINTER)(&glGetBufferParameteriv),
- "glGetBufferParameteriv", },
- { (EGLFUNCTIONPOINTER)(&glGetError),
- "glGetError", },
- { (EGLFUNCTIONPOINTER)(&glGetFloatv),
- "glGetFloatv", },
- { (EGLFUNCTIONPOINTER)(&glGetFramebufferAttachmentParameteriv),
- "glGetFramebufferAttachmentParameteriv", },
- { (EGLFUNCTIONPOINTER)(&glGetIntegerv),
- "glGetIntegerv", },
- { (EGLFUNCTIONPOINTER)(&glGetProgramiv),
- "glGetProgramiv", },
- { (EGLFUNCTIONPOINTER)(&glGetProgramInfoLog),
- "glGetProgramInfoLog", },
- { (EGLFUNCTIONPOINTER)(&glGetRenderbufferParameteriv),
- "glGetRenderbufferParameteriv", },
- { (EGLFUNCTIONPOINTER)(&glGetShaderiv),
- "glGetShaderiv", },
- { (EGLFUNCTIONPOINTER)(&glGetShaderInfoLog),
- "glGetShaderInfoLog", },
- { (EGLFUNCTIONPOINTER)(&glGetShaderPrecisionFormat),
- "glGetShaderPrecisionFormat", },
- { (EGLFUNCTIONPOINTER)(&glGetShaderSource),
- "glGetShaderSource", },
- { (EGLFUNCTIONPOINTER)(&glGetString),
- "glGetString", },
- { (EGLFUNCTIONPOINTER)(&glGetTexParameterfv),
- "glGetTexParameterfv", },
- { (EGLFUNCTIONPOINTER)(&glGetTexParameteriv),
- "glGetTexParameteriv", },
- { (EGLFUNCTIONPOINTER)(&glGetUniformfv),
- "glGetUniformfv", },
- { (EGLFUNCTIONPOINTER)(&glGetUniformiv),
- "glGetUniformiv", },
- { (EGLFUNCTIONPOINTER)(&glGetUniformLocation),
- "glGetUniformLocation", },
- { (EGLFUNCTIONPOINTER)(&glGetVertexAttribfv),
- "glGetVertexAttribfv", },
- { (EGLFUNCTIONPOINTER)(&glGetVertexAttribiv),
- "glGetVertexAttribiv", },
- { (EGLFUNCTIONPOINTER)(&glGetVertexAttribPointerv),
- "glGetVertexAttribPointerv", },
- { (EGLFUNCTIONPOINTER)(&glHint),
- "glHint", },
- { (EGLFUNCTIONPOINTER)(&glIsBuffer),
- "glIsBuffer", },
- { (EGLFUNCTIONPOINTER)(&glIsEnabled),
- "glIsEnabled", },
- { (EGLFUNCTIONPOINTER)(&glIsFramebuffer),
- "glIsFramebuffer", },
- { (EGLFUNCTIONPOINTER)(&glIsProgram),
- "glIsProgram", },
- { (EGLFUNCTIONPOINTER)(&glIsRenderbuffer),
- "glIsRenderbuffer", },
- { (EGLFUNCTIONPOINTER)(&glIsShader),
- "glIsShader", },
- { (EGLFUNCTIONPOINTER)(&glIsTexture),
- "glIsTexture", },
- { (EGLFUNCTIONPOINTER)(&glLineWidth),
- "glLineWidth", },
- { (EGLFUNCTIONPOINTER)(&glLinkProgram),
- "glLinkProgram", },
- { (EGLFUNCTIONPOINTER)(&glPixelStorei),
- "glPixelStorei", },
- { (EGLFUNCTIONPOINTER)(&glPolygonOffset),
- "glPolygonOffset", },
- { (EGLFUNCTIONPOINTER)(&glReadPixels),
- "glReadPixels", },
- { (EGLFUNCTIONPOINTER)(&glReleaseShaderCompiler),
- "glReleaseShaderCompiler", },
- { (EGLFUNCTIONPOINTER)(&glRenderbufferStorage),
- "glRenderbufferStorage", },
- { (EGLFUNCTIONPOINTER)(&glSampleCoverage),
- "glSampleCoverage", },
- { (EGLFUNCTIONPOINTER)(&glScissor),
- "glScissor", },
- { (EGLFUNCTIONPOINTER)(&glShaderBinary),
- "glShaderBinary", },
- { (EGLFUNCTIONPOINTER)(&glShaderSource),
- "glShaderSource", },
- { (EGLFUNCTIONPOINTER)(&glStencilFunc),
- "glStencilFunc", },
- { (EGLFUNCTIONPOINTER)(&glStencilFuncSeparate),
- "glStencilFuncSeparate", },
- { (EGLFUNCTIONPOINTER)(&glStencilMask),
- "glStencilMask", },
- { (EGLFUNCTIONPOINTER)(&glStencilMaskSeparate),
- "glStencilMaskSeparate", },
- { (EGLFUNCTIONPOINTER)(&glStencilOp),
- "glStencilOp", },
- { (EGLFUNCTIONPOINTER)(&glStencilOpSeparate),
- "glStencilOpSeparate", },
- { (EGLFUNCTIONPOINTER)(&glTexImage2D),
- "glTexImage2D", },
- { (EGLFUNCTIONPOINTER)(&glTexParameterf),
- "glTexParameterf", },
- { (EGLFUNCTIONPOINTER)(&glTexParameterfv),
- "glTexParameterfv", },
- { (EGLFUNCTIONPOINTER)(&glTexParameteri),
- "glTexParameteri", },
- { (EGLFUNCTIONPOINTER)(&glTexParameteriv),
- "glTexParameteriv", },
- { (EGLFUNCTIONPOINTER)(&glTexSubImage2D),
- "glTexSubImage2D", },
- { (EGLFUNCTIONPOINTER)(&glUniform1f),
- "glUniform1f", },
- { (EGLFUNCTIONPOINTER)(&glUniform1fv),
- "glUniform1fv", },
- { (EGLFUNCTIONPOINTER)(&glUniform1i),
- "glUniform1i", },
- { (EGLFUNCTIONPOINTER)(&glUniform1iv),
- "glUniform1iv", },
- { (EGLFUNCTIONPOINTER)(&glUniform2f),
- "glUniform2f", },
- { (EGLFUNCTIONPOINTER)(&glUniform2fv),
- "glUniform2fv", },
- { (EGLFUNCTIONPOINTER)(&glUniform2i),
- "glUniform2i", },
- { (EGLFUNCTIONPOINTER)(&glUniform2iv),
- "glUniform2iv", },
- { (EGLFUNCTIONPOINTER)(&glUniform3f),
- "glUniform3f", },
- { (EGLFUNCTIONPOINTER)(&glUniform3fv),
- "glUniform3fv", },
- { (EGLFUNCTIONPOINTER)(&glUniform3i),
- "glUniform3i", },
- { (EGLFUNCTIONPOINTER)(&glUniform3iv),
- "glUniform3iv", },
- { (EGLFUNCTIONPOINTER)(&glUniform4f),
- "glUniform4f", },
- { (EGLFUNCTIONPOINTER)(&glUniform4fv),
- "glUniform4fv", },
- { (EGLFUNCTIONPOINTER)(&glUniform4i),
- "glUniform4i", },
- { (EGLFUNCTIONPOINTER)(&glUniform4iv),
- "glUniform4iv", },
- { (EGLFUNCTIONPOINTER)(&glUniformMatrix2fv),
- "glUniformMatrix2fv", },
- { (EGLFUNCTIONPOINTER)(&glUniformMatrix3fv),
- "glUniformMatrix3fv", },
- { (EGLFUNCTIONPOINTER)(&glUniformMatrix4fv),
- "glUniformMatrix4fv", },
- { (EGLFUNCTIONPOINTER)(&glUseProgram),
- "glUseProgram", },
- { (EGLFUNCTIONPOINTER)(&glValidateProgram),
- "glValidateProgram", },
- { (EGLFUNCTIONPOINTER)(&glVertexAttrib1f),
- "glVertexAttrib1f", },
- { (EGLFUNCTIONPOINTER)(&glVertexAttrib1fv),
- "glVertexAttrib1fv", },
- { (EGLFUNCTIONPOINTER)(&glVertexAttrib2f),
- "glVertexAttrib2f", },
- { (EGLFUNCTIONPOINTER)(&glVertexAttrib2fv),
- "glVertexAttrib2fv", },
- { (EGLFUNCTIONPOINTER)(&glVertexAttrib3f),
- "glVertexAttrib3f", },
- { (EGLFUNCTIONPOINTER)(&glVertexAttrib3fv),
- "glVertexAttrib3fv", },
- { (EGLFUNCTIONPOINTER)(&glVertexAttrib4f),
- "glVertexAttrib4f", },
- { (EGLFUNCTIONPOINTER)(&glVertexAttrib4fv),
- "glVertexAttrib4fv", },
- { (EGLFUNCTIONPOINTER)(&glVertexAttribPointer),
- "glVertexAttribPointer", },
- { (EGLFUNCTIONPOINTER)(&glViewport),
- "glViewport", },
- };
-
- unsigned int num_functions = sizeof(gl_functions) / sizeof(gl_functions[0]);
- unsigned int ii;
- for (ii = 0; ii < num_functions; ++ii) {
- if (strcmp(gl_functions[ii].name, procname) == 0) {
- return gl_functions[ii].func;
- }
- }
- return NULL;
-}
diff --git a/gpu/pgl/pgl.h b/gpu/pgl/pgl.h
index e413587..1c944f3 100644
--- a/gpu/pgl/pgl.h
+++ b/gpu/pgl/pgl.h
@@ -49,6 +49,9 @@ PGLBoolean pglMakeCurrent(PGLContext pgl_context);
// Get the calling thread's current PGL context.
PGLContext pglGetCurrentContext(void);
+// Gets the address of a function.
+void (*pglGetProcAddress(char const * procname))();
+
// Display everything that has been rendered since the last call.
PGLBoolean pglSwapBuffers(void);
diff --git a/gpu/pgl/pgl_proc_address.cc b/gpu/pgl/pgl_proc_address.cc
new file mode 100644
index 0000000..aab7b2e
--- /dev/null
+++ b/gpu/pgl/pgl_proc_address.cc
@@ -0,0 +1,315 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// This file contains the implementation of pglGetProcAddress
+
+#include <string.h>
+#include <GLES2/gl2.h>
+
+extern "C" {
+
+typedef void (*PGLFunctionPointer)(void);
+struct PGLFunctionInfo {
+ PGLFunctionPointer func;
+ char const * const name;
+};
+
+void (*pglGetProcAddress(char const * procname))() {
+ static const struct PGLFunctionInfo gl_functions[] = {
+ { (PGLFunctionPointer)(&glActiveTexture),
+ "glActiveTexture", },
+ { (PGLFunctionPointer)(&glAttachShader),
+ "glAttachShader", },
+ { (PGLFunctionPointer)(&glBindAttribLocation),
+ "glBindAttribLocation", },
+ { (PGLFunctionPointer)(&glBindBuffer),
+ "glBindBuffer", },
+ { (PGLFunctionPointer)(&glBindFramebuffer),
+ "glBindFramebuffer", },
+ { (PGLFunctionPointer)(&glBindRenderbuffer),
+ "glBindRenderbuffer", },
+ { (PGLFunctionPointer)(&glBindTexture),
+ "glBindTexture", },
+ { (PGLFunctionPointer)(&glBlendColor),
+ "glBlendColor", },
+ { (PGLFunctionPointer)(&glBlendEquation),
+ "glBlendEquation", },
+ { (PGLFunctionPointer)(&glBlendEquationSeparate),
+ "glBlendEquationSeparate", },
+ { (PGLFunctionPointer)(&glBlendFunc),
+ "glBlendFunc", },
+ { (PGLFunctionPointer)(&glBlendFuncSeparate),
+ "glBlendFuncSeparate", },
+ { (PGLFunctionPointer)(&glBufferData),
+ "glBufferData", },
+ { (PGLFunctionPointer)(&glBufferSubData),
+ "glBufferSubData", },
+ { (PGLFunctionPointer)(&glCheckFramebufferStatus),
+ "glCheckFramebufferStatus", },
+ { (PGLFunctionPointer)(&glClear),
+ "glClear", },
+ { (PGLFunctionPointer)(&glClearColor),
+ "glClearColor", },
+ { (PGLFunctionPointer)(&glClearDepthf),
+ "glClearDepthf", },
+ { (PGLFunctionPointer)(&glClearStencil),
+ "glClearStencil", },
+ { (PGLFunctionPointer)(&glColorMask),
+ "glColorMask", },
+ { (PGLFunctionPointer)(&glCompileShader),
+ "glCompileShader", },
+ { (PGLFunctionPointer)(&glCompressedTexImage2D),
+ "glCompressedTexImage2D", },
+ { (PGLFunctionPointer)(&glCompressedTexSubImage2D),
+ "glCompressedTexSubImage2D", },
+ { (PGLFunctionPointer)(&glCopyTexImage2D),
+ "glCopyTexImage2D", },
+ { (PGLFunctionPointer)(&glCopyTexSubImage2D),
+ "glCopyTexSubImage2D", },
+ { (PGLFunctionPointer)(&glCreateProgram),
+ "glCreateProgram", },
+ { (PGLFunctionPointer)(&glCreateShader),
+ "glCreateShader", },
+ { (PGLFunctionPointer)(&glCullFace),
+ "glCullFace", },
+ { (PGLFunctionPointer)(&glDeleteBuffers),
+ "glDeleteBuffers", },
+ { (PGLFunctionPointer)(&glDeleteFramebuffers),
+ "glDeleteFramebuffers", },
+ { (PGLFunctionPointer)(&glDeleteProgram),
+ "glDeleteProgram", },
+ { (PGLFunctionPointer)(&glDeleteRenderbuffers),
+ "glDeleteRenderbuffers", },
+ { (PGLFunctionPointer)(&glDeleteShader),
+ "glDeleteShader", },
+ { (PGLFunctionPointer)(&glDeleteTextures),
+ "glDeleteTextures", },
+ { (PGLFunctionPointer)(&glDepthFunc),
+ "glDepthFunc", },
+ { (PGLFunctionPointer)(&glDepthMask),
+ "glDepthMask", },
+ { (PGLFunctionPointer)(&glDepthRangef),
+ "glDepthRangef", },
+ { (PGLFunctionPointer)(&glDetachShader),
+ "glDetachShader", },
+ { (PGLFunctionPointer)(&glDisable),
+ "glDisable", },
+ { (PGLFunctionPointer)(&glDisableVertexAttribArray),
+ "glDisableVertexAttribArray", },
+ { (PGLFunctionPointer)(&glDrawArrays),
+ "glDrawArrays", },
+ { (PGLFunctionPointer)(&glDrawElements),
+ "glDrawElements", },
+ { (PGLFunctionPointer)(&glEnable),
+ "glEnable", },
+ { (PGLFunctionPointer)(&glEnableVertexAttribArray),
+ "glEnableVertexAttribArray", },
+ { (PGLFunctionPointer)(&glFinish),
+ "glFinish", },
+ { (PGLFunctionPointer)(&glFlush),
+ "glFlush", },
+ { (PGLFunctionPointer)(&glFramebufferRenderbuffer),
+ "glFramebufferRenderbuffer", },
+ { (PGLFunctionPointer)(&glFramebufferTexture2D),
+ "glFramebufferTexture2D", },
+ { (PGLFunctionPointer)(&glFrontFace),
+ "glFrontFace", },
+ { (PGLFunctionPointer)(&glGenBuffers),
+ "glGenBuffers", },
+ { (PGLFunctionPointer)(&glGenerateMipmap),
+ "glGenerateMipmap", },
+ { (PGLFunctionPointer)(&glGenFramebuffers),
+ "glGenFramebuffers", },
+ { (PGLFunctionPointer)(&glGenRenderbuffers),
+ "glGenRenderbuffers", },
+ { (PGLFunctionPointer)(&glGenTextures),
+ "glGenTextures", },
+ { (PGLFunctionPointer)(&glGetActiveAttrib),
+ "glGetActiveAttrib", },
+ { (PGLFunctionPointer)(&glGetActiveUniform),
+ "glGetActiveUniform", },
+ { (PGLFunctionPointer)(&glGetAttachedShaders),
+ "glGetAttachedShaders", },
+ { (PGLFunctionPointer)(&glGetAttribLocation),
+ "glGetAttribLocation", },
+ { (PGLFunctionPointer)(&glGetBooleanv),
+ "glGetBooleanv", },
+ { (PGLFunctionPointer)(&glGetBufferParameteriv),
+ "glGetBufferParameteriv", },
+ { (PGLFunctionPointer)(&glGetError),
+ "glGetError", },
+ { (PGLFunctionPointer)(&glGetFloatv),
+ "glGetFloatv", },
+ { (PGLFunctionPointer)(&glGetFramebufferAttachmentParameteriv),
+ "glGetFramebufferAttachmentParameteriv", },
+ { (PGLFunctionPointer)(&glGetIntegerv),
+ "glGetIntegerv", },
+ { (PGLFunctionPointer)(&glGetProgramiv),
+ "glGetProgramiv", },
+ { (PGLFunctionPointer)(&glGetProgramInfoLog),
+ "glGetProgramInfoLog", },
+ { (PGLFunctionPointer)(&glGetRenderbufferParameteriv),
+ "glGetRenderbufferParameteriv", },
+ { (PGLFunctionPointer)(&glGetShaderiv),
+ "glGetShaderiv", },
+ { (PGLFunctionPointer)(&glGetShaderInfoLog),
+ "glGetShaderInfoLog", },
+ { (PGLFunctionPointer)(&glGetShaderPrecisionFormat),
+ "glGetShaderPrecisionFormat", },
+ { (PGLFunctionPointer)(&glGetShaderSource),
+ "glGetShaderSource", },
+ { (PGLFunctionPointer)(&glGetString),
+ "glGetString", },
+ { (PGLFunctionPointer)(&glGetTexParameterfv),
+ "glGetTexParameterfv", },
+ { (PGLFunctionPointer)(&glGetTexParameteriv),
+ "glGetTexParameteriv", },
+ { (PGLFunctionPointer)(&glGetUniformfv),
+ "glGetUniformfv", },
+ { (PGLFunctionPointer)(&glGetUniformiv),
+ "glGetUniformiv", },
+ { (PGLFunctionPointer)(&glGetUniformLocation),
+ "glGetUniformLocation", },
+ { (PGLFunctionPointer)(&glGetVertexAttribfv),
+ "glGetVertexAttribfv", },
+ { (PGLFunctionPointer)(&glGetVertexAttribiv),
+ "glGetVertexAttribiv", },
+ { (PGLFunctionPointer)(&glGetVertexAttribPointerv),
+ "glGetVertexAttribPointerv", },
+ { (PGLFunctionPointer)(&glHint),
+ "glHint", },
+ { (PGLFunctionPointer)(&glIsBuffer),
+ "glIsBuffer", },
+ { (PGLFunctionPointer)(&glIsEnabled),
+ "glIsEnabled", },
+ { (PGLFunctionPointer)(&glIsFramebuffer),
+ "glIsFramebuffer", },
+ { (PGLFunctionPointer)(&glIsProgram),
+ "glIsProgram", },
+ { (PGLFunctionPointer)(&glIsRenderbuffer),
+ "glIsRenderbuffer", },
+ { (PGLFunctionPointer)(&glIsShader),
+ "glIsShader", },
+ { (PGLFunctionPointer)(&glIsTexture),
+ "glIsTexture", },
+ { (PGLFunctionPointer)(&glLineWidth),
+ "glLineWidth", },
+ { (PGLFunctionPointer)(&glLinkProgram),
+ "glLinkProgram", },
+ { (PGLFunctionPointer)(&glPixelStorei),
+ "glPixelStorei", },
+ { (PGLFunctionPointer)(&glPolygonOffset),
+ "glPolygonOffset", },
+ { (PGLFunctionPointer)(&glReadPixels),
+ "glReadPixels", },
+ { (PGLFunctionPointer)(&glReleaseShaderCompiler),
+ "glReleaseShaderCompiler", },
+ { (PGLFunctionPointer)(&glRenderbufferStorage),
+ "glRenderbufferStorage", },
+ { (PGLFunctionPointer)(&glSampleCoverage),
+ "glSampleCoverage", },
+ { (PGLFunctionPointer)(&glScissor),
+ "glScissor", },
+ { (PGLFunctionPointer)(&glShaderBinary),
+ "glShaderBinary", },
+ { (PGLFunctionPointer)(&glShaderSource),
+ "glShaderSource", },
+ { (PGLFunctionPointer)(&glStencilFunc),
+ "glStencilFunc", },
+ { (PGLFunctionPointer)(&glStencilFuncSeparate),
+ "glStencilFuncSeparate", },
+ { (PGLFunctionPointer)(&glStencilMask),
+ "glStencilMask", },
+ { (PGLFunctionPointer)(&glStencilMaskSeparate),
+ "glStencilMaskSeparate", },
+ { (PGLFunctionPointer)(&glStencilOp),
+ "glStencilOp", },
+ { (PGLFunctionPointer)(&glStencilOpSeparate),
+ "glStencilOpSeparate", },
+ { (PGLFunctionPointer)(&glTexImage2D),
+ "glTexImage2D", },
+ { (PGLFunctionPointer)(&glTexParameterf),
+ "glTexParameterf", },
+ { (PGLFunctionPointer)(&glTexParameterfv),
+ "glTexParameterfv", },
+ { (PGLFunctionPointer)(&glTexParameteri),
+ "glTexParameteri", },
+ { (PGLFunctionPointer)(&glTexParameteriv),
+ "glTexParameteriv", },
+ { (PGLFunctionPointer)(&glTexSubImage2D),
+ "glTexSubImage2D", },
+ { (PGLFunctionPointer)(&glUniform1f),
+ "glUniform1f", },
+ { (PGLFunctionPointer)(&glUniform1fv),
+ "glUniform1fv", },
+ { (PGLFunctionPointer)(&glUniform1i),
+ "glUniform1i", },
+ { (PGLFunctionPointer)(&glUniform1iv),
+ "glUniform1iv", },
+ { (PGLFunctionPointer)(&glUniform2f),
+ "glUniform2f", },
+ { (PGLFunctionPointer)(&glUniform2fv),
+ "glUniform2fv", },
+ { (PGLFunctionPointer)(&glUniform2i),
+ "glUniform2i", },
+ { (PGLFunctionPointer)(&glUniform2iv),
+ "glUniform2iv", },
+ { (PGLFunctionPointer)(&glUniform3f),
+ "glUniform3f", },
+ { (PGLFunctionPointer)(&glUniform3fv),
+ "glUniform3fv", },
+ { (PGLFunctionPointer)(&glUniform3i),
+ "glUniform3i", },
+ { (PGLFunctionPointer)(&glUniform3iv),
+ "glUniform3iv", },
+ { (PGLFunctionPointer)(&glUniform4f),
+ "glUniform4f", },
+ { (PGLFunctionPointer)(&glUniform4fv),
+ "glUniform4fv", },
+ { (PGLFunctionPointer)(&glUniform4i),
+ "glUniform4i", },
+ { (PGLFunctionPointer)(&glUniform4iv),
+ "glUniform4iv", },
+ { (PGLFunctionPointer)(&glUniformMatrix2fv),
+ "glUniformMatrix2fv", },
+ { (PGLFunctionPointer)(&glUniformMatrix3fv),
+ "glUniformMatrix3fv", },
+ { (PGLFunctionPointer)(&glUniformMatrix4fv),
+ "glUniformMatrix4fv", },
+ { (PGLFunctionPointer)(&glUseProgram),
+ "glUseProgram", },
+ { (PGLFunctionPointer)(&glValidateProgram),
+ "glValidateProgram", },
+ { (PGLFunctionPointer)(&glVertexAttrib1f),
+ "glVertexAttrib1f", },
+ { (PGLFunctionPointer)(&glVertexAttrib1fv),
+ "glVertexAttrib1fv", },
+ { (PGLFunctionPointer)(&glVertexAttrib2f),
+ "glVertexAttrib2f", },
+ { (PGLFunctionPointer)(&glVertexAttrib2fv),
+ "glVertexAttrib2fv", },
+ { (PGLFunctionPointer)(&glVertexAttrib3f),
+ "glVertexAttrib3f", },
+ { (PGLFunctionPointer)(&glVertexAttrib3fv),
+ "glVertexAttrib3fv", },
+ { (PGLFunctionPointer)(&glVertexAttrib4f),
+ "glVertexAttrib4f", },
+ { (PGLFunctionPointer)(&glVertexAttrib4fv),
+ "glVertexAttrib4fv", },
+ { (PGLFunctionPointer)(&glVertexAttribPointer),
+ "glVertexAttribPointer", },
+ { (PGLFunctionPointer)(&glViewport),
+ "glViewport", },
+ };
+
+ unsigned int num_functions = sizeof(gl_functions) / sizeof(gl_functions[0]);
+ for (unsigned int ii = 0; ii < num_functions; ++ii) {
+ if (strcmp(gl_functions[ii].name, procname) == 0) {
+ return gl_functions[ii].func;
+ }
+ }
+ return NULL;
+}
+} // extern "C"
+