views:

50

answers:

1

Hi, I have just began opengl programming in android and i am fairly new to opengl as well. I've been using nehe's opengl tutorials as well as insanitydesign's android ports. I successfully managed to create a cube with a single texture mapped to all its 6 faces. I even mapped multiple textures to different faces of the cube. But the way I did it was to create 6 faces seperately, have 6 seperate index and texture buffers and then using glBindTexture() with the selected texture for each face and then calling glDrawElements. Isn't there an efficient way around this. Should i use a cube map texture instead of a GL_TEXTURE_2D?

Any suggestions would be appreciated? Thanks

+1  A: 

A very efficient way is using a texture atlas, and adjusting texture coordinates of each cube face to match coordinates in the atlas.

Matias Valdenegro
Thanks, is it possible to create a texture atlas via code or should it be done normally in photoshop?
chaitanya