summaryrefslogtreecommitdiff
path: root/src/renderergl2/tr_extensions.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/renderergl2/tr_extensions.c')
-rw-r--r--src/renderergl2/tr_extensions.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/renderergl2/tr_extensions.c b/src/renderergl2/tr_extensions.c
index e0f972a9..31c48a12 100644
--- a/src/renderergl2/tr_extensions.c
+++ b/src/renderergl2/tr_extensions.c
@@ -178,6 +178,12 @@ void (APIENTRY * qglRenderbufferStorageMultisampleEXT)(GLenum target, GLsizei sa
// GL_ARB_draw_buffers
void (APIENTRY * qglDrawBuffersARB)(GLsizei n, const GLenum *bufs);
+// GL_ARB_vertex_array_object
+void (APIENTRY * qglBindVertexArrayARB)(GLuint array);
+void (APIENTRY * qglDeleteVertexArraysARB)(GLsizei n, const GLuint *arrays);
+void (APIENTRY * qglGenVertexArraysARB)(GLsizei n, GLuint *arrays);
+GLboolean (APIENTRY * qglIsVertexArrayARB)(GLuint array);
+
static qboolean GLimp_HaveExtension(const char *ext)
{
const char *ptr = Q_stristr( glConfig.extensions_string, ext );
@@ -682,4 +688,25 @@ void GLimp_InitExtraExtensions()
// use float lightmaps?
glRefConfig.floatLightmap = (glRefConfig.textureFloat && glRefConfig.halfFloatPixel && r_floatLightmap->integer && r_hdr->integer);
+
+ // GL_ARB_vertex_array_object
+ extension = "GL_ARB_vertex_array_object";
+ glRefConfig.vertexArrayObject = qfalse;
+ if( GLimp_HaveExtension( extension ) )
+ {
+ qglBindVertexArrayARB = (void *) SDL_GL_GetProcAddress("glBindVertexArray");
+ qglDeleteVertexArraysARB = (void *) SDL_GL_GetProcAddress("glDeleteVertexArrays");
+ qglGenVertexArraysARB = (void *) SDL_GL_GetProcAddress("glGenVertexArrays");
+ qglIsVertexArrayARB = (void *) SDL_GL_GetProcAddress("glIsVertexArray");
+
+ if (r_arb_vertex_array_object->integer)
+ glRefConfig.vertexArrayObject = qtrue;
+
+ ri.Printf(PRINT_ALL, result[glRefConfig.vertexArrayObject ? 1 : 0], extension);
+ }
+ else
+ {
+ ri.Printf(PRINT_ALL, result[2], extension);
+ }
+
}