Hello, I was visiting some sites to find an answer for my question and it was impossible.
I hope you can help me because I'm stucked.
I want to draw several tiles that after will be used as a 3D terrain.. how can I do it? this is my actual code and I don't know how to implement the DrawBitmap function :
I started with the following code:
/*--------------------------------------------*/
/* Drawing the tiles with DirectX */
/*----------------------------------------------------------------------------------*/
/* Creating the grid */
/*----------------------------------------------------------------------------------*/
int x,y;
// Display from top to bottom
for(y = 0; y < 10; y++) {
// Display from left to right
for(x = 0; x < 10; x++) {
// Your display function here
DisplayTile(x, y); //Maybe it could work if I code right the DrawBitmap function
}
}
Here goes the DisplayTile function:
/* Displaying the Tiles */
/*------------------------------*/
// Global tile map array
int g_iTileMap[100]; // 10*10 = 100 spots needed
// Prototype tile display function
void vDisplayTile(int x, int y);
void vDisplayTile(int x, int y)
{
int iTile;
int tileWidth = 64;
int tileHeight = 64;
int mapWidth = 10;
//
// Calculate the value of the tile
// at the givenx&y coordinate.
//
iTile = g_iTileMap[(x + (y * mapWidth))];
// Display the bitmap on-screen
DrawBitmap(iTile, (x * tileWidth), (y * tileHeight)); //stucked here}
As you can see I only need to know how to code the DrawBitmap function using DirectX. It has to be in 3D and thinking that after I have to add some camera rotation to use it as a terrain.. Can anybody help me on it please? I really would appreciate.
I forgot to tell what am I using to develope it.. It's with Dev-C++ with Directx SDK.
Thanks in advance.