Jump to content

View more

Image of the Day

The night is still, but the invasion brings chaos. #screenshotsaturday #hanako #indiegame #gameart #ue4 #samurai https://t.co/cgILXuokoS
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Texturing

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
1 reply to this topic

#1 shalrath   Members   

128
Like
Likes
Like

Posted 13 July 2001 - 02:31 AM

Any idea''s why this code draws a series of white boxes on the screen, when other textures draw just fine...? int i, j, x, y; i = j = x = y = 0; glEnable (GL_TEXTURE_2D); top: if (j < h) { for (i = 0; i < w; i++) { //Draw tiles x += (16 * i); glBindTexture (GL_TEXTURE_2D, tile[j].texid); glBegin(GL_QUADS); glTexCoord2f (0,0); glVertex3f(x, y, 0); glTexCoord2f (1,0); glVertex3f(x + 16, y, 0); glTexCoord2f (1,1); glVertex3f(x + 16, y + 16, 0); glTexCoord2f (0,1); glVertex3f(x, y + 16, 0); glEnd(); } //i = 0; // needed? j++; y += 16; goto top; } glDisable (GL_TEXTURE_2D);

#2 Krippy2k   Members   

134
Like
Likes
Like

Posted 13 July 2001 - 05:23 AM

Well first check to make sure that those textures are actually being generated correctly. (Check the values of tex[j].texid to make sure they look like valid nonzero IDs).

Next you might want to try glFlush() after your glEnd()s. What happens is that everything is not necessarily sent to the video card when you do glEnd() and the buffer may not be getting sent until after you disable texturing again, and state changes happen immediately I believe.

Seeya
Krippy




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.