LWJGL Forum

Programming => OpenGL => Topic started by: CodeBunny on April 10, 2011, 15:50:36

Title: VBO Textured Quad
Post by: CodeBunny on April 10, 2011, 15:50:36
What is the code to define and then draw a textured quad via a VBO? I'm having trouble with this one.
Title: Re: VBO Textured Quad
Post by: w00tguy123 on April 13, 2011, 04:35:36
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.
Title: Re: VBO Textured Quad
Post by: CodeBunny on April 14, 2011, 16:59:04
Thankee. :D