Archived

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

XELON

Can I use DirectX with C?

Recommended Posts

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