Sorry to bug you again here, but everyone I showed the code said it is correct and I am out of friends now to ask more :D.
I draw my vertices as triangle strip and I generate 2 Triangles to draw a quad (sprite).
The Output of OpenGL is okay and as expected as long as I a use filled Polygons. But when I switch to Wireframe, they draw only as a diagonal line. There is not quad visible in Wireframe mode.
Hence this image: http://img717.imageshack.us/img717/3863/samplea.png
Yes. You’re assuming that the hardware actually renders quads. It doesn’t; it renders triangles. It simply takes a quad and breaks it down into two triangles.
So when you tell it to render a quad in wireframe mode, it will break them down into triangles and render them in wireframe mode.
Sorry Alfonse, but thats not true (the first sentence) :). No offense.
I assume the Harware renders 2 Polygons. GL_QUAD in 3.2 is deprecated, so I do not use it. I render with GL_TRIANGLE_STRIP as shown in my code.
Originally I wanted to generate a 2D Map over my screen, but then I noticed those 2 Lines going away from my triangles. There should be 4 “Quads”, but there are only 2. When I say Quad, I mean whats displayed, not what the hardware uses for rendering.
But my vertice generation looks okay according to the redbook:
I think you need to set glVertexAttribPointer’s stride parameter if you are interleaving the data.
EDIT:
Also if you are using GL3 you could use geometry shaders or instancing to reduce the amount of vertex data to send to the GPU and move some of the CPU computations to the GPU.
I have reworked this code partially. I did not use interleaving correctly. My data was VVVVCCCCTTTT but it should be VCTVCTVCT.
So this is now what I have: http://pastebin.com/0VFfy40W
But not it is displaying nothing :P.
edit:
Found the error, the stride was not correct. Now it displays corect.