Jump to content

  • Log In with Google      Sign In   
  • Create Account


DirectX without compiler dependent linking


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 Dawoodoz   Members   -  Reputation: 284

Like
0Likes
Like

Posted 31 January 2014 - 02:27 PM

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?


My open source DirectX 10/11 graphics engine. https://sites.google.com/site/dawoodoz

"My design pattern is the simplest to understand. Everyone else is just too stupid to understand it."


Sponsor:

#2 cgrant   Members   -  Reputation: 408

Like
0Likes
Like

Posted 31 January 2014 - 03:00 PM

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



#3 Dawoodoz   Members   -  Reputation: 284

Like
0Likes
Like

Posted 31 January 2014 - 03:07 PM

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.


My open source DirectX 10/11 graphics engine. https://sites.google.com/site/dawoodoz

"My design pattern is the simplest to understand. Everyone else is just too stupid to understand it."


#4 Aldacron   Crossbones+   -  Reputation: 2812

Like
2Likes
Like

Posted 01 February 2014 - 02:18 AM

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



#5 Aldacron   Crossbones+   -  Reputation: 2812

Like
1Likes
Like

Posted 01 February 2014 - 02:21 AM

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.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS