Sign in to follow this  
GamDev

DirectX game engine

Recommended Posts

Hi, this seems to be a nice place, it is also recommended in a lot of places around the internet, so I thought I come here for some help.

I know C++ console and win32 programming, as well as winapi, however I want to step up to game programming and DirectX, as well as start a project that I could show to people around the internet. I already have an idea for it, by the way - in short and without giving any spoilers, it is a 2D side-scroller.

I have been looking around and found tutorials only for old versions of DirectX, so I would like to ask if there are any actually useful tutorials I could use with the current version (June, 2010) of DirectX. It would be better for me if it would be a full game engine tutorial, I don't want to learn part-by-part, as this is a very slow process for me.
I have found many SDL/Allegro/other libraries tutorials, but I don't want these, instead I want to write a DirectX mini-library by myself.

Thanks for reading. :)

Share this post


Link to post
Share on other sites
That is a pretty big topic... I think there are a few tutorials floating around, but none that cover an entire rendering engine. Your best bet would be to pick up a book on the topic - the Mike McShaffrey book or some of the Dave Eberly books would be good choices to get started. Also, if you are looking only for information on D3D, you will need to choose a version (9,10, or 11) and then start reading up on how the API itself works.

Share this post


Link to post
Share on other sites
Well, I decided to go part-by-part framework way after all. I have a framework, although I am having some trouble with it... I will create some new threads and hopefully get help and be able to write a fully working engine to start creating the project.

Thanks for the books, I will also look into them after my birthday next month, when I will get some money.

Share this post


Link to post
Share on other sites
[quote name='GamDev' timestamp='1317653051' post='4868566']
Well, I decided to go part-by-part framework way after all. I have a framework, although I am having some trouble with it... I will create some new threads and hopefully get help and be able to write a fully working engine to start creating the project.

Thanks for the books, I will also look into them after my birthday next month, when I will get some money.
[/quote]
I wouldn't even bother with the DX9 or 10 runtimes just go with the DX 11 one and use the feature levels to support all lower levels this will allow you to write a render engine that is using a single API but can target multiple level of devices. This is far easier than learning DX9 and then switching to DX10/11 the API between these two changed quite dramatically.

Share this post


Link to post
Share on other sites
If you're considering a D3D11 book, consider Jason Z's own, which can be found in his sig. Also, look at the sample browser that came with the DX SDK. To be brutally honest, being able to follow the sample code and documentation is a pretty good measure of your readiness to begin DirectX programming.

And it's a mistake to dismiss libraries such as SDL and Allegro. Writing an engine is sexy, but until you have a few games under your belt, you lack the knowledge of what the engine should be and do, and the experience to code it effectively. Such game libraries are designed to get you up and running fairly quickly, and their usage provides valuable experience rather than a crutch.

ApochPiQ has posted this advice a number of times: just start hacking at code and make some damn games. Take note of the code you don't like, the trouble spots, the bits where you think there must be a better way; but don't get hung up on them. So long as it works, move on and finish your game. Then go back and analyze those bits you took note of, before. Use what you just learned on your next game. Each game's code will become less bad than the last, and after a few games you'll start developing a common codebase which can form the basis of the engine you want to build.

Share this post


Link to post
Share on other sites
NightCreature, I don't have a Dx11 compatible video card, so this isn't possible for me. Thanks for the advice though.

yckx, in fact I have created a few games using these libraries, and that is why I dismissed them: they had numerous bugs and "go-arounds". I was constantly seeking help in their forums, using the search function and then re-writing a big part of my code because I had to use a go-around. That is why I want to learn DirectX and C++ and create my own engine, so I wouldn't need to use these go-arounds.
If you are interested, these games were tic-tac-toe, tetris clone, space shooter, pong and arkanoid clones. I didn't finish Arkanoid though, the go-arounds pissed me off so hard at that point, that I deleted the library and started learning winapi, now going to the world of DirectX.

Share this post


Link to post
Share on other sites
In that case, I would recommend that you take a look at our book on D3D11 (as yckx mentioned, there is a link in my signature). You can still use D3D11 as long as you are running Vista or Win7 - using the feature levels options you can degrade down to your current hardware level, but still use the D3D11 API. I would recommend that you take a look at the table of contents on Amazon to see if the book is what you are looking for - but if you want to know all about how the API works inside and out, it is the book you want.

You can also take a look at the rendering framework that was used for the samples in the book, [url="http://hieroglyph3.codeplex.com"]Hieroglyph 3[/url], which will give you at least some insight into the rendering side of an engine. It isn't production code, but it should give you a good idea about how my engine works. There are quite a few samples to check out too, and the code is freely available under the MIT license.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this