this is a basic thing to do, here is the work flow
1. using 1 and 0(use more numbers if there are more textures), draw a texture tile map, 2d array
2. load texture, and bind 1 and 0 to them.
3. read the tile map array, and draw the corresponding texture to the correct dimensions and position
you just need to pay attention to the coordinates assigned to the vertices, because your array is tile[y][x], you should pay attention that the first [y] is the y axis.
I will put the source code here, since there isn't many tutorials of tiling technics have source code provided.
please note: the whd_bitmap.h (written by me, a simple library, which can do color keying) can be used and modified freely.
tile_texture.zip
1. using 1 and 0(use more numbers if there are more textures), draw a texture tile map, 2d array
2. load texture, and bind 1 and 0 to them.
3. read the tile map array, and draw the corresponding texture to the correct dimensions and position
you just need to pay attention to the coordinates assigned to the vertices, because your array is tile[y][x], you should pay attention that the first [y] is the y axis.
I will put the source code here, since there isn't many tutorials of tiling technics have source code provided.
please note: the whd_bitmap.h (written by me, a simple library, which can do color keying) can be used and modified freely.
tile_texture.zip

Leave a comment