I am doing coding in ubuntu 10.10 with kronos headers but i am stuck because whenever i try to compile the code they there is an error comes :
glmapbuffer undeclared
glunmapbuffer undeclared
i have gl2.h and gl2ext.h in my header file .Can anyone tell me
If I am doing like this what else can i do :
glBindBuffer(GL_ARRAY_BUFFER, uiVBO[surfnum]);
glBufferData(GL_ARRAY_BUFFER, 9*sizeof(GLfloat)*triNum[surfnum], NULL, GL_STATIC_DRAW);
GLfloat *pData = glMapBufferOES (GL_ARRAY_BUFFER, GL_WRITE_ONLY_OES);
for(i=0; i<triNum[surfnum]; ++i,pData+=9)
{
memcpy(pData, triArray[surfnum][i].pt1, 3*sizeof(GLfloat));
memcpy(pData+3, triArray[surfnum][i].pt2, 3*sizeof(GLfloat));
memcpy(pData+6, triArray[surfnum][i].pt3, 3*sizeof(GLfloat));
}
glUnmapBufferOES (GL_ARRAY_BUFFER);//clean up behind us
The suffix
…OESindicates that those functions are not part of the core OpenGL-ES specification, but are considered optional functionality, very much like…ARBextensions mentioned in standard OpenGL specifications. Like with standard OpenGL the method to access the extension, if available, depends on the target plattform.However in your case, since you try to compile it on a standard desktop Linux I suggest the following workaround, if you insist on mapping the buffer.
Of course you could just fill a proxy array with the data, supply that to
glBufferDataand not map at all: