I'm not sure which way is the best way to do this for my purposes.
My purposes being having a textured (with an image) cube.
Also, I've been following a blend of tutorials, so I'm not sure which way is the most right and what I'm doing wrong (currently I haven't had the texture fit right).
Do I use glDrawArrays or glDrawElements?
For pointers, do I say
gl.glVertexPointer(3, GL.GL_FLOAT, 0, vertices);
andgl.glTexCoordPointer(2, GL.GL_FLOAT, 0, textureData);
or
gl.glVertexPointer(3, GL.GL_FLOAT, 0, 0);
andgl.glTexCoordPointer(2, GL.GL_FLOAT, 0, 0);
When do I bind/unbind the buffers? (
gl.glBindBuffer(GL.GL_ARRAY_BUFFER, VBOVertices); gl.glBindBuffer(GL.GL_ARRAY_BUFFER, vboTextureCoordHandle);
) Before I establish the pointers or not in my drawing method at all?Do I need to specify the UV coordinates/Texture Coordinates in the shader? If I'm getting a weirdly stretched texture, does that mean my fragment shader and setting the uniforms is working correctly?
Thank you!
I can supply more code, but I think I just need more information on the basics.