Jump to content
  • Advertisement
Sign in to follow this  
Dawoodoz

DirectX without compiler dependent linking

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

Is it possible to use DirectX from C without any linking of static libraries so that the user can easily re-compile generated code from a single source file with any C compiler?

Share this post


Link to post
Share on other sites
Advertisement

Its possible to load the D3D dll dynamically, however, I don't not know why you specified C, the DX api is C++ based afaik, so I don't know how much you would be able to use with C

Share this post


Link to post
Share on other sites

Its possible to load the D3D dll dynamically, however, I don't not know why you specified C, the DX api is C++ based afaik, so I don't know how much you would be able to use with C

 

I use C as a compiler back end. Anything high level with object unwinding would not be compatible with the garbage collection and calling convention in my own language.

Share this post


Link to post
Share on other sites

Is it possible to use DirectX from C without any linking of static libraries so that the user can easily re-compile generated code from a single source file with any C compiler?

Yes. Assuming Direct3D, just load Direct3DCreate with LoadLibrary + GetProcAddress and away you go. This is what SDL 2 does

Share this post


Link to post
Share on other sites

Its possible to load the D3D dll dynamically, however, I don't not know why you specified C, the DX api is C++ based afaik, so I don't know how much you would be able to use with C

Direct3D is a COM-based API. COM interfaces can be used from both C and C++. The D3D headers provide macros that make using them in C somewhat more convenient than they would be otherwise.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!