Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to use OpenGL purely with C instead of C++? I am wanting to make sure there won't be any problems with my using C and not C++. OpenGL does not depend on any C++ libraries right?

share|improve this question, Written in: C - I almost feel like saying UTSE, but that doesn't seem in the spirit of SE. – dcousens Aug 3 '11 at 7:03
@Daniel It might be in the spirit of SE when the downvote button says "This question does not show any research effort" on the alt-text. – doppelgreener Aug 3 '11 at 11:28
The research effort was spent looking at C++ tutorials and seeing none for C. – Storm Kiernan Aug 3 '11 at 15:10
possible duplicate of Do I need to learn C++ to use Open GL? – user744 Aug 4 '11 at 8:11
up vote 11 down vote accepted

Yes, in fact OpenGL is a C library. You can perfectly use it with C.

share|improve this answer
Note that the normative standard documents do not use the syntax of the C headers/bindings in the text, and explicitly says that implementations are free to use any kind of naming convention. OpenGL import libraries are probably in C due to historical reasons and due to that C is the language that FFI or interop functionality tends to consume. Technically, a vendor could deploy an OpenGL library in any language, but by convention the OS/vendor interface is the common C one. – Lars Viklund Aug 3 '11 at 19:24

OpenGL can be used in C. Some libraries can't, though. For example if you want to use GLM you will have to use C++ instead of C.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.