Sign in to follow this  
Inuyashakagome16

Learning Direct X 10

Recommended Posts

So I've been learning Direct X 10 through [url="http://www.rastertek.com/tutindex.html"]http://www.rastertek.com/tutindex.html[/url] and the book "Beginning DirectX 10 Game Programming." So far, not too bad. I've found that the rastertek tutorials are more in depth and he's explaining a bit more and preparing before just making a normal DX project. But to my reason for making this topic, [b]when you learned DX what mistakes did you make along the way? What didn't you understand? And do you have any tips? [/b]
I'm moving along pretty well with DX, I just want to get to the point where I can set a background and putting sprites on the screen. Edited by Inuyashakagome16

Share this post


Link to post
Share on other sites
First. Why not learn DirectX 11 instead? The Rastertek tutorials exist in version 10 AND 11, and the differences in DirectX interfaces are small at the beginner level, meaning you can yous the Luna book and pretty much change all 10's for 11's. Also, you could use the Rastertek tutorials for learning the function calls, and using the book for learning the concepts. No point in using an old API.

The hardest part in the beginning for me was that it could take ages to figure out what I had done wrong sometimes, since you can't really use the VS2010 debugger and put breakpoints at places and see your variable values. Today I know about for example PIX, which comes with the DirectX SDK!

Also. In my opinion, Rastertek uses a kind of weird framework. Think things through before making your code library too great. How do you want to organise your classes? How you do it is up to you, but think it through! =) Edited by SamiHuutoniemi

Share this post


Link to post
Share on other sites
I guess I wasn't sure what to really go for like 10 VS 11. After looking it up I couldn't decide so I just started on 10. I can start 11 though :P It's just most of the time I see games that are made using like 9, but 9 is old enough as it is, so i just chose 10.

I'll admit I was wondering about that. I thought maybe VS would be able to help me but i guess not. :P

In all honestly, I'm still not sure how I should even make the framework for a large project like this so the tutorials are at least showing me one way to do it. I've taken many classes for programming it's just I've never really worked on a large project. ie. a project with more then 2 header and 3 source files.

Share this post


Link to post
Share on other sites
Yeah, I know how it is in the beginning. My tip for you is to start out small. Start your framework by creating a class, say "Window", and make sure that it can open a Windows window for you with simple calls. After that, make a class, something like "D3DEngine", and make sure it can initialize DirectX for you. Again, try to make it simple. And by that I mean that the user (maybe just you), can use these classes in simple ways. Ways that you understand if you pause for a year.

Share this post


Link to post
Share on other sites
[quote name='Inuyashakagome16' timestamp='1343470194' post='4963905']
I guess I wasn't sure what to really go for like 10 VS 11. After looking it up I couldn't decide so I just started on 10. I can start 11 though [img]http://public.gamedev.net//public/style_emoticons/default/tongue.png[/img] It's just most of the time I see games that are made using like 9, but 9 is old enough as it is, so i just chose 10.
[/quote]It's not exactly like that. DX9.0c is the highest DX version supported by WinXP, which at the moment is the most popular OS on this planet. It makes sense to learn it (if you are going to release anything today or year from today that's a must to have a WinXP compatible version, whci means either DX9 or OpenGL.
On the other hand, learning DX10 makes no sense at all, it's just an outdated version for Vista/Win7 OS. It's better to go all the way for the newest DX11.

Share this post


Link to post
Share on other sites
[quote name='Acharis' timestamp='1343481066' post='4963938']
[quote name='Inuyashakagome16' timestamp='1343470194' post='4963905']
I guess I wasn't sure what to really go for like 10 VS 11. After looking it up I couldn't decide so I just started on 10. I can start 11 though [img]http://public.gamedev.net//public/style_emoticons/default/tongue.png[/img] It's just most of the time I see games that are made using like 9, but 9 is old enough as it is, so i just chose 10.
[/quote]It's not exactly like that. DX9.0c is the highest DX version supported by WinXP, which at the moment is the most popular OS on this planet. It makes sense to learn it (if you are going to release anything today or year from today that's a must to have a WinXP compatible version, whci means either DX9 or OpenGL.
On the other hand, learning DX10 makes no sense at all, it's just an outdated version for Vista/Win7 OS. It's better to go all the way for the newest DX11.
[/quote]
So DX11 is the right way to go then. O.o
If i learn DX11, can i make the game compatible with DX9? I'm guessing you can but it's worth asking. I mean i'm sure its close enough syntax wise so i wont be super lost but.

Share this post


Link to post
Share on other sites
[quote name='Inuyashakagome16' timestamp='1343488668' post='4963983']If i learn DX11, can i make the game compatible with DX9? I'm guessing you can but it's worth asking. I mean i'm sure its close enough syntax wise so i wont be super lost but.[/quote]Nope, you would need to make two separate versions.
Personally, assuming you plan to release the game in a few next years, I would ditch DX11 and go for DX9. DX9 is good enough and all games are written for this version anyway (sometimes with optional DX11, enchanted, version), so your games won't look inferior.

Share this post


Link to post
Share on other sites
[quote name='Acharis' timestamp='1343496567' post='4964026']
[quote name='Inuyashakagome16' timestamp='1343488668' post='4963983']If i learn DX11, can i make the game compatible with DX9? I'm guessing you can but it's worth asking. I mean i'm sure its close enough syntax wise so i wont be super lost but.[/quote]Nope, you would need to make two separate versions.
Personally, assuming you plan to release the game in a few next years, I would ditch DX11 and go for DX9. DX9 is good enough and all games are written for this version anyway (sometimes with optional DX11, enchanted, version), so your games won't look inferior.
[/quote]

That is plain wrong. DX11 has feature sets that let you target DX9, DX10, DX10.1 or DX11 hardware. So yes, you can use DX11 to target DX9 class hardware... of course that still won't work on WinXP.

It makes no sense to use DX9 anymore, DX11 is a far superior and more elegant API. Many new games coming out these months are already DX11 only, I'll be surprised to see a DX9 game coming out in 4-6 months.

XP is not relevant anymore (just have a look at the steam hardware survey) and if the trend is confirmed it is going to disappear in few months.. unless you are producing budged games for very old hardware, but in that case, there are much better options than using a native DX9 engine. Edited by kunos

Share this post


Link to post
Share on other sites
All these are valid points in some way but it all depends how YOU want to approach it, and here is what I think:

If you actually planning on making a game I say use DX11 which is the latest of course, a lot recent games are using it so it would make sense, and it like kunos said it targets dx9,10 hardware as well

If you really want to understand dx in depth then start from dx9, this way you can understand the CHANGES/DIFFERENCE as dx went from 9 to 10 and then to 11. It's all up to you though

Share this post


Link to post
Share on other sites
[quote name='mohq07' timestamp='1343531895' post='4964189']
All these are valid points in some way but it all depends how YOU want to approach it, and here is what I think:

If you actually planning on making a game I say use DX11 which is the latest of course, a lot recent games are using it so it would make sense, and it like kunos said it targets dx9,10 hardware as well

If you really want to understand dx in depth then start from dx9, this way you can understand the CHANGES/DIFFERENCE as dx went from 9 to 10 and then to 11. It's all up to you though
[/quote]

why not start from DirectX 1.0 then? [img]http://public.gamedev.net//public/style_emoticons/default/rolleyes.gif[/img]

Share this post


Link to post
Share on other sites
[quote name='Acharis' timestamp='1343481066' post='4963938']
It's not exactly like that. DX9.0c is the highest DX version supported by WinXP, which at the moment is the most popular OS on this planet.
[/quote]

That's not actually true any more. People had a hard time transitioning to Vista, and rightly so, but today there are significantly more people on Windows 7 than on XP.

[quote name='Acharis' timestamp='1343496567' post='4964026']
Inuyashakagome16, on 28 July 2012 - 11:17 AM, said:
If i learn DX11, can i make the game compatible with DX9? I'm guessing you can but it's worth asking. I mean i'm sure its close enough syntax wise so i wont be super lost but.
Nope, you would need to make two separate versions.
[/quote]

As Kunos pointed out, it depends on what you mean by compatible. Direct3D [url="http://msdn.microsoft.com/en-us/library/windows/desktop/ff476876(v=vs.85).aspx"]Feature Levels[/url] introduced in DX11 allows you to write D3D code written with the DX11 API that behaves like DX9 and it will be compatible with any DX9 hardware. To add to his points, when writing Windows 8 Apps, D3D9 is not supported. You can continue to use it for desktop applications, but if you plan to make games for Win8 Metro, ARM Surface devices, or Windows Phone 8, you're going to need to use D3D11. DirectX 9 is dead.

[quote name='mohq07' timestamp='1343531895' post='4964189']
If you really want to understand dx in depth then start from dx9, this way you can understand the CHANGES/DIFFERENCE as dx went from 9 to 10 and then to 11. It's all up to you though
[/quote]

This is undesirable. Understanding the changes between DirectX 9, 10, 10.1, 11, and 11.1 is only useful if you'll be migrating applications from a previous version of DirectX to a newer version. This is because the primary difference between these versions was A). removing the fixed-function pipeline in favor of a pure shader-driven API. B) exposing more stages in the graphics pipeline for use by developers, and C) implementing better scalability through multi-threading and parallelism. In the case of A, we don't want people using the fixed-function pipeline. In the case of B, you can just use the basic vertex and fragment shaders used by DX9, without having to actually use DX9. In the case of C, the benefits are largely transparent to users. Now, I'm not saying there weren't other specific feature updates between version, but from version to version Microsoft mostly added without taking away. So it's entirely possible to start learning a subset of DX 11 functionality without having to regress to DX 9.

Share this post


Link to post
Share on other sites
All of the posts. o.o After reading through all of this, I've decided to start over (kinda of?) with DX11. I'm still using the same site at least for now till I'm more settled. I'm looking for better books for after I understand the basics at the moment. So if anyone can think of one, let me know. :)

Share this post


Link to post
Share on other sites
[quote name='Inuyashakagome16' timestamp='1343657064' post='4964492']
All of the posts. o.o After reading through all of this, I've decided to start over (kinda of?) with DX11. I'm still using the same site at least for now till I'm more settled. I'm looking for better books for after I understand the basics at the moment. So if anyone can think of one, let me know. [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]
[/quote]

I havent checked that site but that "Beginning DX10" book imo is not that great and does not deserve even being called beginner. The books I used for DX10 to understand the pipeline and structure were:


Ultimate programming with DX10 - a fairly decent beginner book, explains really nicely but isnt 'ultimate' at all, missing out stream out which is somewhat odd.
Introduction to DX10 - practically a rewrite from the DX9 version, it is a decent book but some things just arent explained at all and you have to work out yourself why it was used.

As for rendering and making things pretty

Real-time rendering - This book has A LOT of theory and deals heavily with rendering, I havent read the whole book but from what I read I loved it, word of advice, dont bother reading this until you are comfortable with the pipeline stages as this doesnt explain anything about directx
GPU Gems 1 -> 3 - Same applies above, full of useful theory and examples, a very nice collection of free books to work with
DX SDK Examples - The DX examples are useful too and gives some theory / examples, it also explains DXUT I guess in a bit more detail which other books lack in

That may seem a lot but to be honest when you get really into graphics programming you will fly through those books

Other books to have a look at.

Physics = Real time collision detection
Sound = FMOD alone should cover all your sound needs imo

I know I have quoted DX10 books but honestly migrating from DX10 to DX11 is simple, the only thing that I truly had to change was my 'Font' classes which DX11 doesnt have, but then thats really where Direct2d / DirectWrite come into play which are thoroughly covered in the DX SDK

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