OpenGL2: Vertex array object support.
This commit is contained in:
parent
873a02bd3c
commit
84206c8598
19 changed files with 582 additions and 666 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue