simple newbie directX questions

Started by
0 comments, last by OoMMMoO 23 years, 9 months ago
hey Im a directX newbie and have a couple of questions about it. 1. are surfaces like layers? because when programming games in dos I made different layers one was the bg layer the next was the sprite layer and then two forground layers ect.. 2. how do I make bitmaps scroll like in a sidescrolling game? k cant think of any more off the top of my head. OoMMMoO
Advertisement
1. Surfaces are linear areas of memory for image data. Yes they can be used layers layers.

2. Start reading tutorials on building a tile based graphics engine, i think you may find some on gamedev. Basically to do this, the level is made up of pieces of an image (all the same size) that are tiled up against each other. When the player moves so do the tiles, then clipping (cutting off the pieces of the tiles that don''t need to be shown) is performed and calculations are done to see if the next row or column of tiles need to be drawn.

There is also a simpler way, you can load the level onto a large surface in system memory (surfaces larger then the resolution are usually not permitted in video memory) and blt the portion of it (the size of the screen) needed to be shown. However, this method is usually much slower than using tiles.

+AA_970+

This topic is closed to new replies.

Advertisement