#176202 - SchmendrickSchmuck - Sun May 08, 2011 3:50 am
Hi all,
I'm using a function to easily load a texture into memory. However, as soon as I load more than a single texture, the textures other than the first all become white when displayed.
My code regarding the textures:
Loading
Displaying:
gltextures is a int[MAX_TEXTURES], where MAX_TEXTURES is defined as 2048 in video_gl.h.
eWidth and eHeight are values calculated based on texture size, and can be assumed to be correct.
Data is also fine, as the textures are displayed correctly when loaded first.
I've compared my code to all the examples I could find, but I can't find the answer. If it's not this part of the code, perhaps it's impossible to load multiple pcx files?
Any thoughts?
Thanks
_________________
http://DSLiero.DennisvanZwieten.com - Liero for NDS!
Last edited by SchmendrickSchmuck on Wed May 11, 2011 11:39 pm; edited 2 times in total
I'm using a function to easily load a texture into memory. However, as soon as I load more than a single texture, the textures other than the first all become white when displayed.
My code regarding the textures:
Loading
Code: |
numTextures++; glGenTextures(1, &gltextures[numTextures]); glBindTexture(0, gltextures[numTextures]); glTexImage2D(0, 0, GL_RGBA, eWidth, eHeight, 0, TEXGEN_TEXCOORD, textureData); return numTextures; |
Displaying:
Code: |
glBindTexture(GL_TEXTURE_2D, gltextures[texture]); glBegin(GL_QUADS); //... etc |
gltextures is a int[MAX_TEXTURES], where MAX_TEXTURES is defined as 2048 in video_gl.h.
eWidth and eHeight are values calculated based on texture size, and can be assumed to be correct.
Data is also fine, as the textures are displayed correctly when loaded first.
I've compared my code to all the examples I could find, but I can't find the answer. If it's not this part of the code, perhaps it's impossible to load multiple pcx files?
Code: |
sImage pcx; loadPCX((u8*)tex, &pcx); image8to16trans(&pcx, transCol); // Load as texture [....] imageDestroy(&pcx); |
Any thoughts?
Thanks
_________________
http://DSLiero.DennisvanZwieten.com - Liero for NDS!
Last edited by SchmendrickSchmuck on Wed May 11, 2011 11:39 pm; edited 2 times in total