Is C sufficient for Opengl and Directx?

Started by
3 comments, last by White Crow 20 years, 8 months ago
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
~~~~~~I'll make you an offer you can't refuse...
Advertisement
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
"I am a donut! Ask not how many tris/batch, but rather how many batches/frame!" -- Matthias Wloka & Richard Huddy, (GDC, DirectX 9 Performance)

http://www.silvermace.com/ -- My personal website
quote:Original post by White Crow
I just want to know if a good knowledge of C is enough for either Directx or Opengl?


Absolutley! and dont let anyone tell you otherwise.


An ASCII tetris clone... | AsciiRis
An ASCII tetris clone... | AsciiRis
Thanks for the quick replies!
~~~~~~I'll make you an offer you can't refuse...
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.

This topic is closed to new replies.

Advertisement