23
\$\begingroup\$

Do I need to learn C++ to use Open GL?

\$\endgroup\$

3 Answers 3

31
\$\begingroup\$

Not at all! Due to its simple C API, OpenGL has bindings available for Java, Python, Ruby, and just about any other language you can think of!

\$\endgroup\$
0
7
\$\begingroup\$

OpenGL is a C API. There are bindings for other languages but samples in books and tutorials tend to be written in C.

Because of this knowing C can help. You definitely don't have to learn C++ to use OpenGL though.

\$\endgroup\$
1
\$\begingroup\$

Not necessarily. In fact, OpenGL is native C. There is JOGL, which is a Java wrapper.
OpenGL ES, which is for the iPhone. I believe this is in Obj-C as well as C/C++. [Not sure, think so]
I think things like PyGame end up as OpenGL in the end, and they're done in Python.

But for raw OpenGL for the PC, the only choices I know of are C, C++, or Java.

\$\endgroup\$
5
  • 3
    \$\begingroup\$ Obj-C is a strict superset of plain C. The OpenGL ES API is a pure C API, so the Obj- part of it is irrelevant. \$\endgroup\$
    – greyfade
    Jul 29, 2010 at 15:50
  • \$\begingroup\$ Apologies for that. I took them to be different languages. \$\endgroup\$ Jul 29, 2010 at 19:17
  • 1
    \$\begingroup\$ Pygame by default does not end up as OpenGL in the end; SDL's default rendering model is CPU-side framebuffers. You can use Pygame with OpenGL, but none of the core Pygame documentation covers how to do it. \$\endgroup\$
    – user744
    Oct 14, 2010 at 10:39
  • 1
    \$\begingroup\$ Pyglet however is a Python library that has much of the functionality of Pygame but which does actually use OpenGL for rendering. \$\endgroup\$
    – Kylotan
    Oct 14, 2010 at 15:57
  • 1
    \$\begingroup\$ OpenGL-ES is not only for iPhone.. \$\endgroup\$ Jan 6, 2012 at 1:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .