Hi, I’ve just been trying to use the GL_APPLE_vertex_array_range extension but i’m not sure if it is having any effect. If I use this extension i’m not gaining any added performance. Now from what I understand, there should be a noticiable increase in performance (at least a few frames per second).
First, I allocate a block of memory that will be used to store my vertex arrays (and normals…). I then call glVertexArrayRangeAPPLE to specifiy that the memory i just allocated is to be server side memory (AGP or onboard graphics card). Next i enable the client state: GL_VERTEX_ARRAY_RANGE_APPLE.
Is this correct? or am i missing something. I cant seem to find any examples using this extension( there are some using GL_VERTEX_ARRAY_RANGE_NV) but it doesn’t operate exactly the same and there are not examples in the extension specification.
Here is the code where i allocate my vertex array, I think it’s wrong or missing something (i’m also using APPLE_vertex_array_object and GL_APPLE_element_array, but they shouldn’t make a difference) Also, should i be placing the indicies list in this buffer as well? Thanks for any help.
glGenVertexArraysAPPLE(1, &handle);
glBindVertexArrayAPPLE(handle);
buffer = alloc(sizeof(GLdouble)*BUF_SIZE);
glVertexArrayRangeAPPLE(BUF_SIZE, buffer);
glEnableClientState(GL_VERTEX_ARRAY_RANGE_APPLE);
//define vertex array
glVertexArrayParameteriAPPLE(GL_VERTEX_ARRAY_STORAGE_HINT_APPLE, GL_STORAGE_CACHED_APPLE);
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_NORMAL_ARRAY);
glEnableClientState(GL_ELEMENT_ARRAY_APPLE);
glVertexPointer(3, GL_DOUBLE, 0, (GLdouble*)buffer);
int offset = numberOfVerticies3;
glNormalPointer( GL_DOUBLE, 0, (GLdouble)buffer+offset);
//using GL_APPLE_element_array
glElementPointerAPPLE(GL_UNSIGNED_INT, (GLuint*)indicies);
//draw
glDrawElementArrayAPPLE(…);