Log in or register to post comments

Multiple Textures

August 30, 2011 - 8:11pm #1

Can I load multiple textures in qualcomm? If it can done, how to do that?

More detail:
I have 1 obj file and 3 texture files.
In obj file, this file has 5 objects.
An object 1 load texture A
An object 2 load texture B
Object 3, 4 and 5 load texture C

p.s. Sorry for my bad English :p and thanks :)

Re: Multiple Textures

August 31, 2011 - 10:37am #2

Sure, start by looking at the sample apps. Place your texture files in the assets folder. Open the main java activity (e.g. ImageTargets.java) and find the loadTextures method. Load your textures here.

Then, open the main native file (e.g. ImageTargets.cpp). In the renderFrame method you can bind a particular texture using this code:

glBindTexture(GL_TEXTURE_2D, textures[textureIndex]->mTextureID);

Where textureIndex is determined by the order you added your textures in Java (0, 1, 2 ...)

- Kim

Log in or register to post comments