   texture mapping changes size of quad
  Hey what is going on here?  Say I have this code:void FPSDemo::drawSpace(){  glMatrixMode(GL_PROJECTION);  glLoadIdentity();  glOrtho(0.0f, 1024, 768, 0.0f, -1.0f, 1.0f);  //glEnable(GL_TEXTURE_2D);  glBindTexture(GL_TEXTURE_2D, mStarsTexture);  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);  glColor3f(0.0f,1.0f,0.0f);  glBegin(GL_QUADS);    glTexCoord2f(1.0f, 0.0f);    glVertex3f(mWidth,0.0f,0.0f);    glTexCoord2f(0.0f, 0.0f);    glVertex3f(0.0f,0.0f,0.0f);    glTexCoord2f(0.0f, 1.0f);    glVertex3f(0.0f,mHeight,0.0f);    glTexCoord2f(1.0f, 1.0f);    glVertex3f(mWidth,mHeight,0.0f);  glEnd();  //glDisable(GL_TEXTURE_2D);  //glMatrixMode(GL_MODELVIEW);}mWidth and mHeight are 1024x768.  glEnable(GL_TEXTURE_2D); is commented out above.  It just draws a green rectangle the exact size of the screen.  I even changed mWidth to mWidth-10 in both glVertex3f's and it made a 10 pixel wide black bar on the right side.  So that proves it.Now when I uncomment glEnable(GL_TEXTURE_2D); the quad no longer covers the whole screen.  The image is a 640x480 image (that's never mattered before) It starts at the top left corner and covers about 3/4 of the screen left to right and about 9/10 of the screen top to bottom.What is going on?  Why would texture mapping change the size of the quad?  And I know the size of the quad has changed because the screen is black where the image is not present, unlike green before I was texture mapping.   
Quote:Original post by icecubeflowerIt just draws a green rectangle the exact size of the screen.  I even changed mWidth to mWidth-10 in both glVertex3f's and it made a 10 pixel wide black bar on the right side.  So that proves it.....And I know the size of the quad has changed because the screen is black where the image is not present, unlike green before I was texture mapping.Wait, before you were texture mapping, non-drawn areas were black - you used that as proof earlier ;)   ;  No man.  I mean, yeah, that's true.  But it's like this:The green rectangle before texture mapping covers the WHOLE screen.  No black area.  I subtracted 10 from the width just to make sure that the end of my quad was really at the end of the screen.  It was.  I ended up with a small black strip, only 10 pixels wide at the right edge of the screen.When I texture map the black part is massive.  Way more than 10 pixels.  And I wasn't subtracting 10 then, anyway.  It should have covered the whole screen with the image.  Instead the quad shrunk for some reason I don't understand at all.   ;  AUGH!!@#$@  It was that god damn power of 2 thing.  I knew that.  I saw dimensions of image were 640x480 and those are screen coordinates so I absentmindedly assumed they were powers of 2.  Duh.  I scaled the image to 512x512 and now everything is fine.Well I tried to delete this post to not waste anyone's time but it won't let me.[Edited by - icecubeflower on June 17, 2009 3:30:19 AM]