Original Post
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);