From 2bcad53bbb137f6543dd1c1f32b13f7ac71cd2e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20H=C3=B6glund?= Date: Wed, 13 Mar 2013 17:01:14 +0100 Subject: [PATCH] kwin: Resolve functions for GL_ARB_vertex_array_object --- libkwineffects/kwinglutils_funcs.cpp | 19 +++++++++++++++++++ libkwineffects/kwinglutils_funcs.h | 11 +++++++++++ 2 files changed, 30 insertions(+) diff --git a/libkwineffects/kwinglutils_funcs.cpp b/libkwineffects/kwinglutils_funcs.cpp index 81e157f55f..0f7d9bf99a 100644 --- a/libkwineffects/kwinglutils_funcs.cpp +++ b/libkwineffects/kwinglutils_funcs.cpp @@ -139,6 +139,12 @@ glDisableVertexAttribArray_func glDisableVertexAttribArray; glVertexAttribPointer_func glVertexAttribPointer; +// GL_ARB_vertex_array_object +glBindVertexArray_func glBindVertexArray; +glDeleteVertexArrays_func glDeleteVertexArrays; +glGenVertexArrays_func glGenVertexArrays; +glIsVertexArray_func glIsVertexArray; + static glXFuncPtr getProcAddress(const char* name) { glXFuncPtr ret = NULL; @@ -468,6 +474,19 @@ void glResolveFunctions(OpenGLPlatformInterface platformInterface) glBindBuffer = NULL; glBufferData = NULL; } + + if (hasGLVersion(3, 0) || hasGLExtension("GL_ARB_vertex_array_object")) { + // see http://www.opengl.org/registry/specs/ARB/vertex_array_object.txt + GL_RESOLVE(glBindVertexArray); + GL_RESOLVE(glDeleteVertexArrays); + GL_RESOLVE(glGenVertexArrays); + GL_RESOLVE(glIsVertexArray); + } else { + glBindVertexArray = NULL; + glDeleteVertexArrays = NULL; + glGenVertexArrays = NULL; + glIsVertexArray = NULL; + } #endif #ifdef KWIN_HAVE_EGL diff --git a/libkwineffects/kwinglutils_funcs.h b/libkwineffects/kwinglutils_funcs.h index 084ac96a0d..8f6ac1456d 100644 --- a/libkwineffects/kwinglutils_funcs.h +++ b/libkwineffects/kwinglutils_funcs.h @@ -349,6 +349,17 @@ extern KWIN_EXPORT glDisableVertexAttribArray_func glDisableVertexAttribArray; typedef void (*glVertexAttribPointer_func)(GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid*); extern KWIN_EXPORT glVertexAttribPointer_func glVertexAttribPointer; +// GL_ARB_vertex_array_object +typedef void (*glBindVertexArray_func)(GLuint array); +typedef void (*glDeleteVertexArrays_func)(GLsizei n, const GLuint *arrays); +typedef void (*glGenVertexArrays_func)(GLsizei n, GLuint *arrays); +typedef GLboolean (*glIsVertexArray_func)(GLuint array); + +extern KWIN_EXPORT glBindVertexArray_func glBindVertexArray; +extern KWIN_EXPORT glDeleteVertexArrays_func glDeleteVertexArrays; +extern KWIN_EXPORT glGenVertexArrays_func glGenVertexArrays; +extern KWIN_EXPORT glIsVertexArray_func glIsVertexArray; + } // namespace #endif // not KWIN_HAVE_OPENGLES