#### Archived

This topic is now archived and is closed to further replies.

# 2d tile-based game under DX8: running, just want advice

## Recommended Posts

I''ve recently begun learning C++ and DX with the aim of creating 2d games. Having never worked with a previous version of DirectX, the merger between DDraw and D3D doesn''t really bother me, except that it has resulted in a lot of overly complex tutorials on creating simple 2d graphics. I have NO budget and no prior experience, so I''ve decided upon DirectX for graphics, FMOD for sound (not tried this out yet but implementation looks simple enough), Dev-C++ 4 with the mingw compiler, and scrapping ''2d-via-3d'' tutorials and just using ID3DXSprite objects. Seeing as everything I know about the ID3DXSprite interface was picked up from the MSDN library and trial-and-error (and all over the last two days), I''d like to share a few things I''ve discovered in the hope they may be useful to other beginners, and for people to correct/add to my knowledge. All sprites can be drawn using a single ID3DXSprite object: specify rectangle, scaling, rotation, texture etc. when calling Draw(). Uses less memory than separate object for each sprite? Call sprite object''s Begin() and End() methods OUTSIDE the main drawing loop - Draw() can be called any number of times between the two. Being able to call Begin() and End() once a frame is much faster than a Begin(), Draw(), End() sequence for every sprite to be plotted, and a serious advantage of plotting all sprites via a single sprite object. If drawing a background texture, or in similar suitable situations, don''t clear the backbuffer every frame. This can also be done deliberately for creation of certain effects. No noticeable speed increase on my machine, however I use a GeForce3; older hardware may benefit. Another thing I''m doing, not related directly to the sprite interface, is compiling all my bitmaps as resources in my main executable - this makes it possible to load textures without having an absolute file path, but how will it affect memory usage? Final question: d3dx8d.dll - is this or is this not a debugging version of one of the DX DLLs, and if so, how can I link with a non-debug version under Dev-C++?

##### Share on other sites
My D3DXWrapper article explains the usage of the D3DXSprite interface, D3DXSprite is only a small interface that prepares the device for rendering in 2D, the only memory hog is the textures.

quote:

Final question: d3dx8d.dll - is this or is this not a debugging version of one of the DX DLLs, and if so, how can I link with a non-debug version under Dev-C++?

Simply specify d3dx8.lib instead of d3dx8d and select the ''Release'' profile (in DevStudio) or put the flag /NDEBUG in your makefile.

The article can be found at:

Downloads, D3DXSprite tutorial, New platform game: .-= The ZeroOne Realm =-.

##### Share on other sites
hmmm. I imagine the equivalent file for mingw would be named something like libd3dx8.a ...but I already tried searching for such a file; if it exists, it wasn''t included in the package I downloaded from the Bloodshed site. no offence, but I ONLY have free compilers available to me, instructions specific to other compilers don''t help much
also I see a strange lack of d3dx8.dll anywhere on my machine; perhaps there isn''t one, I just assumed that would be the name of the equivalent non-debugging DLL.

##### Share on other sites
Anarchy,

i''ve tried to download the wrapper but the links don''t work !

##### Share on other sites
Yes you need to link to d3dx8.lib which live in $your sdk path$\lib\

Try to shearch in your workspace or makfile for the link with d3dx8d.lib and just remplace to d3dx8.lib

Why English rules?? C pas très malin tout ça!

##### Share on other sites
Hey, skweek, I would like to contact you. Do you think you could leave your e-mail address? Or if not, maybe you could ask me for one of mine that works(hehe).

• ### Forum Statistics

• Total Topics
628394
• Total Posts
2982427

• 10
• 9
• 19
• 24
• 9