summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-06-04 17:08:36 +0300
committerAndrei Karas <akaras@inbox.ru>2014-06-04 17:08:36 +0300
commit141849d0370607b17103c2dbbb1973a14b8b7554 (patch)
tree5d310e0a9ad04b3ec2716b3dde5657e9b2bd6748
parent96882a621d5a3720325d51fac87675f13043b4d9 (diff)
downloadplus-141849d0370607b17103c2dbbb1973a14b8b7554.tar.gz
plus-141849d0370607b17103c2dbbb1973a14b8b7554.tar.bz2
plus-141849d0370607b17103c2dbbb1973a14b8b7554.tar.xz
plus-141849d0370607b17103c2dbbb1973a14b8b7554.zip
Add VAO OpenGL functions.
for now unused.
-rw-r--r--src/graphicsmanager.cpp11
-rw-r--r--src/render/mgl.cpp6
-rw-r--r--src/render/mgl.h13
3 files changed, 30 insertions, 0 deletions
diff --git a/src/graphicsmanager.cpp b/src/graphicsmanager.cpp
index 66e352c2b..324337871 100644
--- a/src/graphicsmanager.cpp
+++ b/src/graphicsmanager.cpp
@@ -885,6 +885,17 @@ void GraphicsManager::initOpenGLFunctions()
assignFunction(glPopGroupMarker, "glPopGroupMarker");
}
+ if (checkGLVersion(3, 0) || supportExtension("GL_ARB_vertex_array_object"))
+ {
+ assignFunction(glGenVertexArrays, "glGenVertexArrays");
+ assignFunction(glBindVertexArray, "glBindVertexArray");
+ assignFunction(glDeleteVertexArrays, "glDeleteVertexArrays");
+ assignFunction(glVertexAttribPointer, "glVertexAttribPointer");
+ assignFunction(glEnableVertexAttribArray, "glEnableVertexAttribArray");
+ assignFunction(glDisableVertexAttribArray,
+ "glDisableVertexAttribArray");
+ }
+
#ifdef WIN32
assignFunction(wglGetExtensionsString, "wglGetExtensionsStringARB");
#endif
diff --git a/src/render/mgl.cpp b/src/render/mgl.cpp
index 429afe9eb..efa2f736a 100644
--- a/src/render/mgl.cpp
+++ b/src/render/mgl.cpp
@@ -48,6 +48,12 @@ defName(glGetObjectLabel);
defName(glInsertEventMarker);
defName(glPushGroupMarker);
defName(glPopGroupMarker);
+defName(glGenVertexArrays);
+defName(glBindVertexArray);
+defName(glDeleteVertexArrays);
+defName(glVertexAttribPointer);
+defName(glEnableVertexAttribArray);
+defName(glDisableVertexAttribArray);
#ifdef WIN32
defName(wglGetExtensionsString);
diff --git a/src/render/mgl.h b/src/render/mgl.h
index b612c5e03..b762eed94 100644
--- a/src/render/mgl.h
+++ b/src/render/mgl.h
@@ -118,6 +118,13 @@ typedef void (APIENTRY *glInsertEventMarker_t)
typedef void (APIENTRY *glPushGroupMarker_t)
(GLsizei length, const char *marker);
typedef void (APIENTRY *glPopGroupMarker_t) (void);
+typedef void (APIENTRY *glGenVertexArrays_t) (GLsizei n, GLuint *arrays);
+typedef void (APIENTRY *glBindVertexArray_t) (GLuint array);
+typedef void (APIENTRY *glDeleteVertexArrays_t) (GLsizei n, GLuint *arrays);
+typedef void (APIENTRY *glVertexAttribPointer_t) (GLuint index, GLint size,
+ GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRY *glEnableVertexAttribArray_t) (GLuint index);
+typedef void (APIENTRY *glDisableVertexAttribArray_t) (GLuint index);
// callback
typedef void (APIENTRY *GLDEBUGPROC_t) (GLenum source, GLenum type, GLuint id,
@@ -148,6 +155,12 @@ defNameE(glGetObjectLabel);
defNameE(glInsertEventMarker);
defNameE(glPushGroupMarker);
defNameE(glPopGroupMarker);
+defNameE(glGenVertexArrays);
+defNameE(glBindVertexArray);
+defNameE(glDeleteVertexArrays);
+defNameE(glVertexAttribPointer);
+defNameE(glEnableVertexAttribArray);
+defNameE(glDisableVertexAttribArray);
#ifdef WIN32
typedef const char* (APIENTRY * wglGetExtensionsString_t) (HDC hdc);