3 * @brief A wrapper around the Vertex Buffer extension to OpenGL 1.1.
5 * Copyright 2008 Stephen M. Webb <stephen.webb@bregmasoft.ca>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of Version 2 of the GNU General Public License as
9 * published by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 void initGlVboExtension(void)
29 #ifndef HAVE_GL_VERTEX_BUFFERS
31 char* extensions
= glGetString(GL_EXTENSIONS
);
32 char* terminator
= NULL
;
35 char* where
= (char*)strstr(extensions
, "GL_ARB_vertex_buffer_object");
37 terminator
= where
+ strlen("GL_ARB_vertex_buffer_object");
38 if (where
== extensions
|| *(where
- 1) == ' ')
40 if (*terminator
== ' ' || *terminator
== '\0')
46 extensions
= terminator
;
51 fprintf(stderr
, "OpenGL vertex buffer extension is not supported.\n");
56 glGenBuffers
= (PFNGLGENBUFFERSPROC
)wglGetProcAddress("glGenBuffersARB");
57 glDeleteBuffers
= (PFNGLDELETEBUFFERSPROC
)wglGetProcAddress("glDeleteBuffersARB");
58 glBindBuffer
= (PFNGLBINDBUFFERPROC
)wglGetProcAddress("glBindBufferARB");
59 glBufferData
= (PFNGLBUFFERDATAPROC
)wglGetProcAddress("glBufferDataARB");
60 /* glBufferSubData = (PFNGLBUFFERSUBDATAPROC)wglGetProcAddress("glBufferSubDataARB"); */