PDA

View Full Version : is it possible to use "default" values vor array?



AnniKa
01-23-2011, 06:51 AM
Hello :)
I got a simple question for my first OpenGL project,
Actually i want to create some kind of flat mesh, for a 2D game thingy, and it works fine for now.
But my question is: is it anyhow possible to send an array for the vertex cords only with X and Y coordinates?
because Z is allways the same, for each layer (so that i would just translate the worldmatrix for each layer)
For saving 1/3 of memory for the vertex data
Is this anyhow possible?

Dark Photon
01-23-2011, 05:09 PM
is it anyhow possible to send an array for the vertex cords only with X and Y coordinates? ... For saving 1/3 of memory for the vertex data.

Sure, just use "2, GL_FLOAT" when you're calling glVertexAttribPointer or glVertexPointer (depending on whether you are using generic vertex attributes or legacy vertex attributes).

AnniKa
01-25-2011, 03:49 PM
oh! cool.
so easy!
ty