Archived

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

White Crow

Is C sufficient for Opengl and Directx?

Recommended Posts

Hi First I want to point out that this is not a Opengl v.s Directx or like post. I just want to know if a good knowledge of C is enough for either Directx or Opengl? Don''t reply with something like: Forget C, C++ is much better etc. Don''t compare two things, just answer the question . Whitecrow

Share this post


Link to post
Share on other sites
yes, but it will become hard to write large programs in C (well it is for me) without lots of orginization and planning.

DirectX becomes a bit messier in C because it is COM, but it is very possible to safely use it in C.

OpenGL is designed for use in C (because of its Unix/IrixGL origins)

-- danushka | IRIX



A GOOD friend will come bail you out of jail...
but, a TRUE friend will be sitting next to you saying, "Damn, we fucked up."
Ingite 3D Game Engine Home -- Just click it

Share this post


Link to post
Share on other sites
C is the language the OpenGL is written to primarily ... so the answer here is a resounding yes

DirectX on the other hand uses COM, which is wrapped around features built into C++ (vtables primarily), and although it is completely usable in C, with no loss of ability or control, it is much harder to read, and therefore maintain, UNTIL you get used to ignoring all of the trivial things, while simultaneously noticing the significant things ... C works for DirectX/COM, C++ works better.

In fact, the ideal way for a C programmer to use DirectX, would probably be to use C++ as a Super C language, not necessarily using every feature under the sun ... just using simple classes and inheiritance is enough to make it worth using ... and you can still use the C io system if you want ... and everything else.

Share this post


Link to post
Share on other sites