int draw_tiles(GLvoid)
{
int tile;
for (int y = 0; y < MAP_SIZEY; y++)
{
for (int x = 0; x < MAP_SIZEX; x++)
{
tile = map[y][x];
glBindTexture(GL_TEXTURE_2D, texture[tile]);
glBegin(GL_QUADS);
glTexCoord2f(0.0f, 0.0f); glVertex3f(float(x), float(y), 0.0f);
glTexCoord2f(1.0f, 0.0f); glVertex3f(float(x + 1), float(y), 0.0f);
glTexCoord2f(1.0f, 1.0f); glVertex3f(float(x + 1), float(y + 1), 0.0f);
glTexCoord2f(0.0f, 1.0f); glVertex3f(float(x), float(y + 1), 0.0f);
glEnd();
}
}
return (1);
}
More Help With Tiling Please!
ok so i got tiling working thanks to your guys help !
but now how do you change the texture of the tiles
here is the Til drawing code
Thanks
Sir Darkan Fireblade
glBindTexture(GL_TEXTURE_2D, texture[tile]);
There is the answer.
You have an array of texture texture[...]
I don''t really understand what you really want to know??!?!
Troa Technologies.
(real time ray tracing shadow : DK 3d engine)
There is the answer.
You have an array of texture texture[...]
I don''t really understand what you really want to know??!?!
Troa Technologies.
(real time ray tracing shadow : DK 3d engine)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement