Jump to content
  • Advertisement
Sign in to follow this  
Sc4Freak

Where to start?

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

Hi, I've been wanting to get into game programming and programming for DirectX specifically. But, I don't know where to start. I'm looking to read some books on the topic of DirectX (not just Direct3D or a specific part, I'm looking for all of DirectX), but I don't really know of any that suit me. I'm proficient in C and I know the basics of Win32 programming, meaning I can get a simple window up, and I can make a simple game like Pong using windows' built in graphics engine. However, I don't know any C++... and there lies the problem. I guess what I'm looking for is a good, simple to understand book on DirectX for beginners, but based mostly on C. And please don't say "just learn C++", it isn't an option for me right now. Does such a text or resource exist, or am I just screwed?

Share this post


Link to post
Share on other sites
Advertisement
Uhm, i'm not 100% sure, but... Isn't DirectX a set of virtual classes (interfaces) which are not supported in C?
Unless ofcourse, you want to mess with the v-tables on your own. In this case, you should first learn COM in C (i don't know any books on the subject, but you could google for them).

Share this post


Link to post
Share on other sites
Quote:
Original post by Sc4Freak
Hi, I've been wanting to get into game programming and programming for DirectX specifically. But, I don't know where to start. I'm looking to read some books on the topic of DirectX (not just Direct3D or a specific part, I'm looking for all of DirectX), but I don't really know of any that suit me. I'm proficient in C and I know the basics of Win32 programming, meaning I can get a simple window up, and I can make a simple game like Pong using windows' built in graphics engine. However, I don't know any C++... and there lies the problem.

I guess what I'm looking for is a good, simple to understand book on DirectX for beginners, but based mostly on C. And please don't say "just learn C++", it isn't an option for me right now. Does such a text or resource exist, or am I just screwed?


Unfortunately, most DirectX books are C++ based (mostly because of the OO nature of DirectX which is better expressed using C++ than using C (although C is possible)). The good news is that the C syntax for DX calls are rather similar to the C++ syntax. Instead of using device3d->SomeFunction(other_params) you will have to use Direct3DDevice9_SomeFunction(device3d, other_params). It is less clean than the C++ syntax but it is still very readable. If you are a good enough C programmer, this won't really be a problem for you.

Since the C++ syntax can easily be understood by a C programmer (to some extent), any decent DirectX book might give you enough information to be able to begin DX programming in C.

And if you wan't to learn C++, the C++ Workshop is here for you. Ok, I stop [smile]

HTH,

Share this post


Link to post
Share on other sites
Quote:
Original post by Paulius Maruska
Uhm, i'm not 100% sure, but... Isn't DirectX a set of virtual classes (interfaces) which are not supported in C?
Unless ofcourse, you want to mess with the v-tables on your own. In this case, you should first learn COM in C (i don't know any books on the subject, but you could google for them).


In fact, when you define a COM interface you also define a set of C macros that will take care of the underlying v-table. As a conclusion, it is perfectly possible to use DX in a C program.

Regards,

Share this post


Link to post
Share on other sites
Thanks for your help! That really answers some questions.

I've found a book, called "Tricks of the Windows Game Programming Gurus" by Andre LaMothe. I had a look inside, it seems to cover quite a bit on using DirectDraw7 and using 2D graphics. It looks pretty good, but I've had others tell me that Andre LaMothe isn't a very good author, and to avoid his books altogether.

What are your thoughts?

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!