Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Texturing


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   -  Reputation: 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);

Sponsor:

#2 Krippy2k   Members   -  Reputation: 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.



PARTNERS