Jump to content
  • Advertisement
Sign in to follow this  
SonicD007

Rendering tiles?

This topic is 4235 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm using C++ Directx version 9 I think it is and I want to know if Directx has functions to render tiles or do you have to make it yourself. Still new to Directx and new to tile maps, but I'm going to try and make a small map of tiles as a project to learn Directx a bit better and get a steppingstone to making a small game eventually. I know theres a DrawBitmap function thats already provided in Directx. Would I make my own function called DrawTiles and have it call DrawBitmap for every single tile that has to be drawn? This doesn't sound like it would work very well if at all. Well lemme stop talking so I can start listening to you guys.

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Would I make my own function called DrawTiles and have it call DrawBitmap for every single tile that has to be drawn?


You basicly would do that. Or at least, you cóuld do that. Check these steps:

- load a complete tileset
- create an array. Each entry on the array refers to a grid-node on the map. And
the number of the entry says which tile to use
- loop through all entries of the array. Each time you decide which part of the
tileset to grab and draw

Off course this is a just a very basic way to do it, and I'm sure there are other, but at least it's a start eh!

-Stenny

Share this post


Link to post
Share on other sites
Hey I saw your post about golden sun stenny lol

How would I draw the tiles though? DrawBitmap is the way to go? (seems a bit messy)

Share this post


Link to post
Share on other sites
Whaha, lol. I get it now, Dino's quite good with tiles. Anyway,

I have never seen a DrawBitmap function. What I do, is just use Textures. You can easily use the IDirect3DTexture9::Draw function, because it has an argument with which you can specify exactly which area of a texture you want to be drawn. A specific rectangle. In this case a tile.
This is probably not the best and fastest way to do it, but hey, I'm learning too. Maybe DrawBitmap is better. You should see if it can draw only portions.

-Stenny

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!