diff --git a/engine/gl/gl_vidcommon.c b/engine/gl/gl_vidcommon.c index 18ab5dd5b..c7e04f961 100644 --- a/engine/gl/gl_vidcommon.c +++ b/engine/gl/gl_vidcommon.c @@ -797,6 +797,23 @@ void GL_CheckExtensions (void *(*getglfunction) (char *name)) } //we only use vao with shaders anyway. if (!gl_config.arb_shader_objects) + { + //don't bother if we've no glsl + qglGenVertexArrays = NULL; + qglBindVertexArray = NULL; + } + else if (gl_config.glversion >= 3) + { + /*yay core!*/ + qglGenVertexArrays = (void *)getglext("glGenVertexArrays"); + qglBindVertexArray = (void *)getglext("glBindVertexArray"); + } + else if (GL_CheckExtension("GL_ARB_vertex_array_object")) + { + qglGenVertexArrays = (void *)getglext("glGenVertexArraysARB"); + qglBindVertexArray = (void *)getglext("glBindVertexArrayARB"); + } + else { qglGenVertexArrays = NULL; qglBindVertexArray = NULL; @@ -1460,9 +1477,6 @@ void GL_Init(void *(*getglfunction) (char *name)) qglPopAttrib = (void *)getglcore("glPopAttrib"); qglScissor = (void *)getglcore("glScissor"); - qglGenVertexArrays = (void *)getglext("glGenVertexArrays"); - qglBindVertexArray = (void *)getglext("glBindVertexArray"); - //does this need to be non-core as well? qglFogi = (void *)getglcore("glFogi"); qglFogf = (void *)getglcore("glFogf");