Advertisement

glGenTextures is pissing me off

Started by October 04, 2001 06:10 PM
1 comment, last by Narkster 23 years, 4 months ago
Let me start off by posting some code.
    
GLuint textures[5][3];
........
glGenTextures(3, &textures[0][0]);

glBindTexture(GL_TEXTURE_2D, texture[0][0]);
//Insert nearest texture filter parameters

........
glBindTexture(GL_TEXTURE_2D, texture[0][1]);
//Insert linear texture filter parameters

........
glBindTexture(GL_TEXTURE_2D, texture[0][2]);
//Insert mipMapped texture filter parameters

........
int DrawGLScene(GLvoid)
{
     ........
     glBindTexture(GL_TEXTURE_2D, texture[0][0]);
     //Insert quads

     ........
}
    
Ok, mabey you have figured out my problem before I get to ask my question, but the weirdest thing happens when I use this code. The texture that glBindTexture is using shows up white, also white when I change it to texture[0][1], but when I change it to texture[0][2] it works just fine but of course it's mipmapped. Why can I not show the other filtered textures? Thanks, Nark Edited by - Narkster on October 4, 2001 7:13:00 PM
--------------------------Budha walks up to a hotdog vender and says:"Make me one with everything."L8R
Are you using textures with dimensions that are power of two? If not this is the problem. You have to scale your texture so it''s dimensions are power of two. gluBuid2DMipmaps() does the scaling so the third texture in your example works. To scale your images call gluScaleImage2D() or rescale them in some paint program. Hope it helps.

Advertisement
ROFLOL,

I was for SURE that I checked everything, in others words you were correct QWERTY! I''ll give you $50 for the other side of your brain, becuase mine seems to be missing right now....

THANKS!!!
-Nark
--------------------------Budha walks up to a hotdog vender and says:"Make me one with everything."L8R

This topic is closed to new replies.

Advertisement