port opengl2.x to opengl 3.x
Posted
by
user46759
on Game Development
See other posts from Game Development
or by user46759
Published on 2014-06-04T19:13:01Z
Indexed on
2014/06/04
21:45 UTC
Read the original article
Hit count: 239
I'm trying to port opencloth example to OpenGL 3.x. I've mostly done it to the shaders but I'm not sure of this part :
glEnableClientState(GL_VERTEX_ARRAY);
glBindBuffer(GL_ARRAY_BUFFER, vboID);
glVertexPointer(4, GL_FLOAT, 0,0);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glBindBuffer(GL_ARRAY_BUFFER, vboTexID);
glTexCoordPointer(2, GL_FLOAT,0, 0);
glEnableClientState(GL_NORMAL_ARRAY);
glBindBuffer(GL_ARRAY_BUFFER, vboNormID);
glNormalPointer(GL_FLOAT,sizeof(float)*4, 0);
maybe glEnableVertexAttriArray somewhere ?
any clue ? thanx
edit : maybe something like that ?
glEnableVertexAttribArray (2) ; // Ou glEnableVertexAttribArray (positionIndex) ;
glBindBuffer(GL_ARRAY_BUFFER, vboTexID);
glVertexAttribPointer (2, 2, GL_FLOAT, GL_FALSE, 0, 0) ;
glEnableVertexAttribArray (3) ; // Ou glEnableVertexAttribArray (positionIndex) ;
glBindBuffer(GL_ARRAY_BUFFER, vboNormID);
glVertexAttribPointer (3, 4, GL_FLOAT, GL_FALSE, sizeof (float) * 4, 0) ;
© Game Development or respective owner