Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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
    
en.wikipedia.org/wiki/OpenGL, Written in: C - I almost feel like saying UTSE, but that doesn't seem in the spirit of SE. –  Daniel Aug 3 '11 at 7:03
2  
@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

2 Answers 2

up vote 10 down vote accepted

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

share|improve this answer
3  
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

 
discard

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.