vba textures?

Started by
4 comments, last by V-man 15 years, 8 months ago
I am reading up vba and I was wondering how do you add textures to each quad?
Advertisement
Do you mean VBO? (Vertex Buffer Objects)
I looked up vbo's but I cant seem to find any examples where they use textures with the quads. So if I want to use texture will I have to use immediate mode?
I think your question is how to draw a polygon with texture, but other than in immediate mode. If so, please look for Vertex Array (VA) and VBO.

You can store st (uv) texture coordinates into a VBO or Vertex Array (VA) along with other vertex information, such as position, colour, normals, etc. But, actual texels are still in OpenGL texture object.
But I am confused on how to use a vertex array or vbo with textures.

So would I just call glbindtexture before I call something like glDrawArrays(GL_TRIANGLES, 0, VertexCount);?
Quote:Original post by Shadowwoelf
But I am confused on how to use a vertex array or vbo with textures.

So would I just call glbindtexture before I call something like glDrawArrays(GL_TRIANGLES, 0, VertexCount);?


In order to bind a texture, you call glBindTexture. I think that's obvious and also there are plenty of examples on the net.
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);

This topic is closed to new replies.

Advertisement