Skip to main content
gamedev.net
🔒 Locked

texture problem

Started by cody Nov 14, 2001 at 1:55 PM 2 replies 200+ views
Original Post
cody
cody
what is needed to draw a textured rectangle on the screen in 2d-mode? im doing the following: -i have loaded a texture, i assume this works -glEnable(GL_TEXTURE_2D); -glColor(1,1,1); -glBindTexture(GL_TEXTURE_2D, id); -rendering: glBegin(GL_QUADS); or glBegin(GL_TRIANGLES); glTexCoord2f(u,v); glVertex2f(x,y); ... glEnd(); i have read the red book and this should be ok i think... but i just get a white rectangle on the screen, no texture at all! it looks as if i didnt bind the texture! i took the texture-loading code from a sample and it works. are there any commands missing? thanks for any help cody
cody
cody
oh you are right, gluBuildMipmaps returns "out of memory".
i didnt check this because it wasnt my code.

so i cant load a 128x128 texture on my geforce3 with 64mb, nice!

this texture file works with the sample... what the hell?!
cody
cody
oh im so silly, i put the loading code in my init function before opengl is initialized... uuuuuhhhh

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.