Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Mesh_handle::DrawTri(){
- glBindBuffer(GL_ARRAY_BUFFER,vertexbufferid);
- glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,elementbufferid);
- int index1=glGetAttribLocation(bound_program,"inputvertex");
- int index2=glGetAttribLocation(bound_program,"inputcolor");
- int index3=glGetAttribLocation(bound_program,"inputtexcoord");
- glEnableVertexAttribArray(index1);
- glVertexAttribPointer(index1,3,GL_FLOAT,GL_FALSE,9*sizeof(float),0);
- glEnableVertexAttribArray(index2);
- glVertexAttribPointer(index2,4,GL_FLOAT,GL_FALSE,9*sizeof(float),(void*)(3*sizeof(float)));
- glEnableVertexAttribArray(index3);
- glVertexAttribPointer(index3,2,GL_FLOAT,GL_FALSE,9*sizeof(float),(void*)(7*sizeof(float)));
- glDrawArrays(GL_TRIANGLE_STRIP,0,elementcount);
- //glDrawElements(GL_TRIANGLE_STRIP,elementcount,GL_UNSIGNED_INT,0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement