Jump to content
  • Advertisement
Sign in to follow this  
ISDCaptain01

OpenGL Starting out in directx

This topic is 2222 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

So after grinding away at c++ for nearly 7 months i decided to take a look at some basic directx and im blown away lol. Its pretty confusing, i get the theory but I cant easily read the code like in normal console applications. So far Ive done basic windows programming and getting a bunch of rectangles on the screen. Is it normal to be confused? or should i be "getting it" right away? Also share some of your experiances learning directx or any other game related API (OpenGL, SDL, etc)

Share this post


Link to post
Share on other sites
Advertisement
The DirectX libraries are rather big. It's not uncommon to feel overwhelmed when trying to take them in at first pass, because you're not really...supposed to take it all in at once. You'll get more practice with it as you go, but the key to using 3rd-party libraries is being able to look through the documentation to understand which parts you need to perform the tasks you want the program to do. Sometimes I do it with Intellisense code-completion (i.e. using Visual Studio, I hit the . modifier after an object and then just browse through the interface methods available to get a rough sense of its capabilities), more often it's with associated .chm files and the msdn.

With DirectX I'd really recommend getting a good book on the topic (Frank Luna's series of D3D books is often suggested 'round here), or the rastertek tutorials are another handy example of how someone might use the library.

It would also help to get a good handle on the concept of the DirectX rendering pipeline, as a lot of what the code does for you will make more sense when you understand the stages of the pipeline and their respective functions.

Share this post


Link to post
Share on other sites
Now that I am more proficient with C++, I find the API to be really simple to use. Sure it has a lot of options and features, but the way the API is used is very consistent all around. I remember being in the same position as you: the theory of the pipeline made sense, but the code itself was really hard. A lot of functions, for example, take in some definition structure and outputs the resource out which you would pass as a pointer to a pointer. This pointer to a pointer would really mess with my head back then. Back then, I found OpenGL to be a bit easier for some reason.

Anyways, when going through the tutorials in the SDK, how the code works should make sense to you. You should know why and what you are passing as parameters. You should also be used to working with memory (pointers, references, etc...), as everything created by DirectX is just a resource in memory. As you applications become larger, structuring code becomes harder as well. You should get familiar developing larger applications.

When going through DirectX code, I always have the SDK documentation opened. I think this is mandatory. Every time you get to a Dx function which you don't fully understand, search for it in the documentation and really understand why and how it is used. Also, make sure you read the intro chapters about the pipeline. You must fully understand the overall pipeline (at a high level) before even attempting to understand code.

Unfortunately, I doubt you'll ease into it after only 7 months of C++ experience. It is not impossible, but it took me much longer than that. Just out of curiosity, what was the most challenging application you've developed @ a software engineering level?

In the end, I have noticed that as my C++ skills improved, and as I got more familiar with software architecture, the easier it was to understand DirectX and all other APIs I have been using. Once coding becomes 2nd nature, you're really only learning how an API works... The code itself just makes sense. But don't despair. I think you should still keep working hard on making graphical applications. In my case, graphical applications is the sole reason for my programming improvement. It is what motivated me to become better at what I do. Seeing yourself grow as a programmer will make you strive even more to further your knowledge and really master the API you are using.

This all probably sounded like a lot of rambling. English is my 2nd language.... but,
Good luck in your journey friend.


PS: As BCullis mentioned, Frank Luna's book has helped me tremendously to further my understandings of the API. He doesn't get into really advanced topics but by the end of the book, you should have a very solid renderer. Edited by french_hustler

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!