Issue with glTexImage2D?

Mars_999
Unregistered
 
Post: #1
I am not sure why but when I use glTexImage2D I get white textures when I use gluBuild2DMipmaps everything is fine?

Code:
glTexImage2D(GL_TEXTURE_2D, 0, imageType,  imageWidth, imageHeight, 0, imageType,  GL_UNSIGNED_BYTE, imageData);

Also my glTexSubImage doesn't work either so I am under the assumption that it only works with glTexSubImage2D and not gluBuild2DMipmaps?

thanks
Quote this message in a reply
Moderator
Posts: 3,579
Joined: 2003.06
Post: #2
Yeah Apple corrected it so that it's *proper* now. You need to specify glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ) or whatever filtering you want to avoid the white textures.
Quote this message in a reply
Mars_999
Unregistered
 
Post: #3
Ugh I forgot I had GL_LINEAR_MIPMAP_LINEAR in as a parameter....
been awhile since I have looked at my texture loading code....

thanks
Quote this message in a reply
Mars_999
Unregistered
 
Post: #4
Now with the images loading correctly I have a new problem with glTexImage2D that I dont' have with gluBuild2DMipmaps. If I use gluBuild2DMipmaps all my textures load correctly and all are shown, I am using multitexturing and have 7 texture units at once. When I use glTexImage2D only the 4th texture unit shows up and the first 3 are not shown? I am using a fragment program and not sure what would be causing this? Thanks
Quote this message in a reply
Sage
Posts: 1,232
Joined: 2002.10
Post: #5
Do your textures have power-of-two dimensions? gluBuild2DMipmaps will always rescale your texture data to POT sizes, so it works with all texture targets. With glTexImage you are free to specify any size, which may or may not work depending which target you are using.
Quote this message in a reply
Mars_999
Unregistered
 
Post: #6
arekkusu Wrote:Do your textures have power-of-two dimensions? gluBuild2DMipmaps will always rescale your texture data to POT sizes, so it works with all texture targets. With glTexImage you are free to specify any size, which may or may not work depending which target you are using.

Yes they are POW RGBA textures...
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  how to use Glubuild2DMipmaps, GlTexImage2D and glTexParameter 007gamer 1 4,536 Jan 31, 2007 04:36 AM
Last Post: OneSadCookie
  glTexImage2D bug? Skorche 1 3,008 Apr 12, 2005 01:28 AM
Last Post: OneSadCookie
  glTexImage2D formats clarification WhatMeWorry 1 4,714 Nov 17, 2004 01:31 AM
Last Post: arekkusu
  glTexImage2D() and single colour component textures sealfin 3 4,710 Aug 10, 2004 04:45 AM
Last Post: arekkusu
  glTexImage2D() & memory understanding... sealfin 4 3,603 Aug 7, 2004 03:15 PM
Last Post: OneSadCookie