Texture Loading Headaches

Moderator
Posts: 3,579
Joined: 2003.06
Post: #16
Quote:Originally posted by arekkusu
Maybe flooding Apple with bugs saying "don't break stuff, dumbasses" will fix it?
That's funny.Grin I was just thinking that if that's the case, I'm sure they'll be right on it. I hope something materializes soon cause I'm just about out of ideas on this one. Luckily I have a good workaround with gluBuild2DMipmaps for now.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #17
All that changed is that glTexImage2D is now much better able to tell whether a texture upload will actually succeed or not... but maybe they went overboard a little [Image: wink.png]

Those of you just calling glTexImage2D, are you doing a proper proxy test to check the texture will fit before you do the upload? If not, don't be surprised if glTexImage2D fails unexpectedly, though you should get a GL error.

I've just installed Panther on my G5 at work, so I'll test Weatherscape XT tomorrow -- I'm pretty sure that does the "right thing" when it comes to texture uploads.
Quote this message in a reply
Moderator
Posts: 3,579
Joined: 2003.06
Post: #18
Quote:Originally posted by OneSadCookie
Those of you just calling glTexImage2D, are you doing a proper proxy test to check the texture will fit before you do the upload? If not, don't be surprised if glTexImage2D fails unexpectedly, though you should get a GL error.
What the heck is a "proper proxy test"? I'm checking for NPT but I've never heard of a proxy test before. I'm not getting a GL error.

EDIT: Okay, I found the proxy test thing you were talking about. I'd seen it before but disregarded it. It seems a little silly for a standard 128x128 pixel bmp though.
Quote this message in a reply
Moderator
Posts: 3,579
Joined: 2003.06
Post: #19
Got it! Must specify glTexParameteri for the GL_TEXTURE_MIN_FILTER for glTexImage2D to work. I wasn't doing that in the loading routine for flexibility and forgot to do so later. I thought that it would work with default parameters. Apparently it DID, but not anymore.
Quote this message in a reply
Member
Posts: 156
Joined: 2002.11
Post: #20
"The Force with him strong is, but ready he is not." Smile

Thank you for sorting that out. I was getting concerned too.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #21
Ah, I forgot about that [Image: blush.png]

According to the GL spec, the default texture minification filter is GL_NEAREST_MIPMAP_LINEAR (go figure), and you get a white texture image if you don't have mipmaps. 8.x, 9.x, 10.0.x, 10.1.x and 10.2.x treat NEAREST_MIPMAP_LINEAR as LINEAR (I believe) if there are no mipmaps. This was wrong, and has been "fixed" for Panther.

I'm still not sure if that's a good thing or not [Image: roll_eyes.png]
Quote this message in a reply
Moderator
Posts: 3,579
Joined: 2003.06
Post: #22
Seems to me that it should be/should have been according to spec. Sucks that Apple didn't send out a technote on it though. Can we sue them for potential hair-loss?
Quote this message in a reply
soccerboyO7
Unregistered
 
Post: #23
I'm also having the same problem as the original poster. I want to load in a texture file, but I am using C++. All I need is the C++ code to load in the file. I can get it to texture with patterns that I created, but I don't know how to load in a file using C++. Any help, would be greatly appreciated.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  iPhone texture loading issue yotryu 0 3,458 Mar 11, 2009 03:40 AM
Last Post: yotryu
  Texture Mapping: Loading a texture from a .bmp file? ishrock 5 6,455 Dec 13, 2008 09:27 AM
Last Post: ThemsAllTook
  OpenGL Texture Loading & Sprites corporatenewt 2 11,116 Jan 30, 2008 12:39 PM
Last Post: ynda20
  Texture Loading in Cocoa... dave05 3 8,152 Dec 11, 2007 03:12 AM
Last Post: DoG
  Cocoa Texture Loading Code Problem Nick 1 3,105 Oct 28, 2005 11:44 PM
Last Post: OneSadCookie