PDA

View Full Version : How to specify the size of an object [VBO] [Rendering]



garrygl
03-20-2014, 02:58 PM
I have recently made the switch from OGL 1 to 3/4 rendering and have successfully created a VBO object complete with GLSL shaders but I have encountered a problem.

I am drawing 2 Quads with glDrawArrays but OpenGL does not know where the vertices for the first quads ends meaning my problem is: GL treats the 2 Quads as just one objects and draws lines inbetween them - so my question is How can I tell opengl where each quad ends so it can draw them correctly.

Thanks,
GarryGL

Dark Photon
03-21-2014, 04:39 AM
When rendering with GL_QUADS, each group of 4 verts defines a single quad (the end of each quad is implicit), and the count argument to glDrawArrays specifies the number of vertices.

You may need to post a little code to illustrate your problem.