VBO Textured Quad

Started by CodeBunny, April 10, 2011, 15:50:36

Previous topic - Next topic

CodeBunny

What is the code to define and then draw a textured quad via a VBO? I'm having trouble with this one.

w00tguy123

see this thread:

http://lwjgl.org/forum/index.php/topic,3314.0.html

You can copy and paste the code and get a colored triangle to show up. You'll need to add another vert and index for the quad, change the rendering type to QUADS, add vertex data for texture coordinates and also change the elementSize value. In the rendering part, you'll need to enable the client state for texture coords and make sure to draw 4 verts and not 3 when calling glDrawElements.

CodeBunny