PNG Files only Loading Some of The Time
I'm trying to use textures in my "game." I'm using PNG files for the images. Some of the textures are working. Others are not. Is there a reason why some might be working? Perhaps how I saved them in Photoshop? I'm really confused and been at it for hours. Any help is appreciated.
Define "working". Now define "not working". Now add error checking in your code so you can see when "not working" happens. Then report back.
Working - OpenGL uses my loaded PNG file and applies it as a texture
Not Working - OpenGL does not use my loaded PNG file as a texture
I added error checking code and got nothing. No errors loading the PNG files nor setting them as textures. I think is has to do with how I'm saving them in Photoshop. I got two PNG files that worked at 3 that did not. I'm not sure what (if anything) I did differently.
Not Working - OpenGL does not use my loaded PNG file as a texture
I added error checking code and got nothing. No errors loading the PNG files nor setting them as textures. I think is has to do with how I'm saving them in Photoshop. I got two PNG files that worked at 3 that did not. I'm not sure what (if anything) I did differently.
Don't worry. I managed to figure it out.
SimReality/Nick Wrote:Don't worry. I managed to figure it out.Feel free to enlighten those of who may be desirous of loading PNGs as textures at some point in the future...
Measure twice, cut once, curse three or four times.
I feel kind of dumb for not finding it sooner, but the code I was given did not allow for non power of 2 textures. I wasn't told this before downloading it and so it was obviously a mystery to me. So, if loading textures doesn't work and doesn't produce errors, try a power of 2 dimensions (2,4,8,16,32,64,etc).
glGetError() after glTexImage would catch this. So would inspecting your texture data with glGetTexImage.
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| OpenAL - Ogg files vs Caf files | Fred9000 | 8 | 11,767 |
Aug 23, 2011 08:01 PM Last Post: ipeku |
|
| loading tiff files | MACnus | 7 | 4,472 |
Feb 4, 2005 08:14 PM Last Post: FCCovett |
|
| error when loading too many bmp files | petr6534 | 1 | 2,619 |
Oct 20, 2004 05:08 PM Last Post: OneSadCookie |
|
| Loading TGA files to openGL Textures | Joseph Duchesne | 23 | 11,157 |
Aug 25, 2004 01:20 AM Last Post: NCarter |
|
| Loading Files in SDL | Nick | 2 | 3,359 |
Aug 13, 2004 01:01 PM Last Post: Nick |
|

