Hello,
I'm currently using some of the demo code to load a texture, i was
just wondering how you alter it (the loader) to load another texture and
bind different textures to different objects? Do you use some kind of
stack?
Thanks again,
Mark.
At the moment the texture loader method looks like:
public void LoadGLTextures() {
PngTextureLoader texLoader = new PngTextureLoader(gl,glu);
texLoader.readTexture(getCodeBase(), "pic/crate.png");//Load in
tex, check name & path..
if(texLoader.isOk()) {//Mip map texture
//Create nearest filtered texture
gl.glGenTextures(1, texture);
gl.glBindTexture(GL_TEXTURE_2D, texture[0]);
gl.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER,
GL_LINEAR);
gl.glTexParameteri(GL_TEXTURE_2D,
GL_TEXTURE_MIN_FILTER,
GL_LINEAR_MIPMAP_NEAREST);
glu.gluBuild2DMipmaps(GL_TEXTURE_2D,
3,
texLoader.getImageWidth(),
texLoader.getImageHeight(),
GL_RGB,
GL_UNSIGNED_BYTE,
texLoader.getTexture());
}
|