Jump to content
  • Advertisement

Archived

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

XELON

Can I use DirectX with C?

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

Advertisement
Yes, it is possible. I even think there is a document on it somewhere on this site. However, those who have done it and lived to tell describe it as a rather painful experience.
Besides - you don''t really need to learn much C++ in order to utilize DirectX from it. Most of the basic DirectX tutorials and examples look like some kind of C''ified C++ anyway.



AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.

Share this post


Link to post
Share on other sites
This is the place where it teaches you how to use C and DirectX to make Tetris:

http://gamedev.net/community/forums/forum.asp?forum_id=33

Share this post


Link to post
Share on other sites
You can use C with DirectX, but each time you call a directX function, you must refer to the ''vtable, something like this:
pDevice->vTable->SomeCommand(), and you can''t use D3DX, as it''s object oriented.



--------
Leave all your expectations behind, or
they''ll pull you down on your way to the top.

-Ivan

Share this post


Link to post
Share on other sites
quote:
Original post by Death Hunter
You can use C with DirectX, but each time you call a directX function, you must refer to the ''vtable, something like this:
pDevice->vTable->SomeCommand(), and you can''t use D3DX, as it''s object oriented.



--------
Leave all your expectations behind, or
they''ll pull you down on your way to the top.

-Ivan


You can use D3DX just fine in C. They''re structs and interfaces, just like D3D.

I like pie.

Share this post


Link to post
Share on other sites
quote:
Original post by Death Hunter
pDevice->vTable->SomeCommand()



More precisely:

pDevice->lpVtbl->SomeCommand(pDevice, other args... )

For more of this, take a look at the C macros in the various DX headers.

Share this post


Link to post
Share on other sites

  • 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!