PNG Files only Loading Some of The Time

Sage
Posts: 1,066
Joined: 2004.07
Post: #1
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.
Quote this message in a reply
Sage
Posts: 1,232
Joined: 2002.10
Post: #2
Define "working". Now define "not working". Now add error checking in your code so you can see when "not working" happens. Then report back.
Quote this message in a reply
Sage
Posts: 1,066
Joined: 2004.07
Post: #3
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.
Quote this message in a reply
Sage
Posts: 1,066
Joined: 2004.07
Post: #4
Don't worry. I managed to figure it out.
Quote this message in a reply
Moderator
Posts: 434
Joined: 2002.09
Post: #5
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.
Quote this message in a reply
Sage
Posts: 1,066
Joined: 2004.07
Post: #6
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).
Quote this message in a reply
Sage
Posts: 1,232
Joined: 2002.10
Post: #7
glGetError() after glTexImage would catch this. So would inspecting your texture data with glGetTexImage.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  OpenAL - Ogg files vs Caf files Fred9000 8 13,388 Aug 23, 2011 08:01 PM
Last Post: ipeku
  loading tiff files MACnus 7 4,627 Feb 4, 2005 08:14 PM
Last Post: FCCovett
  error when loading too many bmp files petr6534 1 2,743 Oct 20, 2004 05:08 PM
Last Post: OneSadCookie
  Loading TGA files to openGL Textures Joseph Duchesne 23 12,595 Aug 25, 2004 01:20 AM
Last Post: NCarter
  Loading Files in SDL Nick 2 3,487 Aug 13, 2004 01:01 PM
Last Post: Nick