Jump to content

View more

Image of the Day

The night is still, but the invasion brings chaos. #screenshotsaturday #hanako #indiegame #gameart #ue4 #samurai https://t.co/cgILXuokoS
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

DirectX without compiler dependent linking

4: Adsense

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   

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


"App". is an acronym and must always be followed by a dot.

https://en.oxforddictionaries.com/punctuation/punctuation-in-abbreviations


#2 cgrant   Members   

1789
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   

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


"App". is an acronym and must always be followed by a dot.

https://en.oxforddictionaries.com/punctuation/punctuation-in-abbreviations


#4 Aldacron   GDNet+   

4489
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   GDNet+   

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