glTexImage2D subtlety?
This worked on Jaguar:
Now, under Panther, it doesn't.
More specifically, glTexImage2D() just produces an opaque white texture, while gluBuild2DMipmaps() still works as expected.
Am I ignoring some subtle requirement somewhere? The textures are all Po2 square...
Code:
glGenTextures(1, &GLid);
glBindTexture(GL_TEXTURE_2D, GLid);
if (mipmap)
gluBuild2DMipmaps(GL_TEXTURE_2D,
GL_RGBA,
width,
height,
GL_BGRA,
GL_UNSIGNED_INT_8_8_8_8_REV,
buf);
else
glTexImage2D(GL_TEXTURE_2D,
0,
GL_RGBA,
width,
height,
0,
GL_BGRA,
GL_UNSIGNED_INT_8_8_8_8_REV,
buf);Now, under Panther, it doesn't.
More specifically, glTexImage2D() just produces an opaque white texture, while gluBuild2DMipmaps() still works as expected.
Am I ignoring some subtle requirement somewhere? The textures are all Po2 square...
I think I've seen this problem being addressed in a previous thread, just a few weeks ago. There was a work-around on that thread... if I only could find it.
If I recall it correctly, it has something to do with the OpenGL defaults for the functions, which didn't work right on versions of OS X previous to Panther.
The fix is to set up the correct parameter to override the default setting for that function.
If I recall it correctly, it has something to do with the OpenGL defaults for the functions, which didn't work right on versions of OS X previous to Panther.
The fix is to set up the correct parameter to override the default setting for that function.
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
(texture min filter defaults to NEAREST_MIPMAP_LINEAR or something equally absurd. Under previous versions of the Mac OS, it was treated as LINEAR if there were no mipmaps. On Panther, it's (correctly) treated as invalid.)
(texture min filter defaults to NEAREST_MIPMAP_LINEAR or something equally absurd. Under previous versions of the Mac OS, it was treated as LINEAR if there were no mipmaps. On Panther, it's (correctly) treated as invalid.)
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| how to use Glubuild2DMipmaps, GlTexImage2D and glTexParameter | 007gamer | 1 | 3,837 |
Jan 31, 2007 04:36 AM Last Post: OneSadCookie |
|
| glTexImage2D bug? | Skorche | 1 | 2,681 |
Apr 12, 2005 01:28 AM Last Post: OneSadCookie |
|
| glTexImage2D formats clarification | WhatMeWorry | 1 | 3,675 |
Nov 17, 2004 01:31 AM Last Post: arekkusu |
|
| Issue with glTexImage2D? | Mars_999 | 5 | 4,034 |
Oct 21, 2004 05:06 PM Last Post: Mars_999 |
|
| glTexImage2D() and single colour component textures | sealfin | 3 | 3,945 |
Aug 10, 2004 04:45 AM Last Post: arekkusu |
|

