Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is PyOpenGL as fast as OpenGL?

Tags:

c++

python

opengl

I am trying to build a general-purpose game engine in Python and PyOpenGL, but I don't know if it is worth even attempting, because I am not sure Python is up to the job...

As far as I am aware PyOpenGL is just a wrapper for OpenGL. Yet, I still see people that say things such as 'OpenGL is better', and 'Python is too slow'.

Take a look at, for example, this question. Most of the answers are biased towards C++.

If they both use the same technology, then why would one be better than the other? To me, it seems as if the language doesn't really matter, because most of the work is done by OpenGl/hardware. What am I missing?

like image 299
Konrad Avatar asked Jan 09 '23 15:01

Konrad


1 Answers

First difference: OpenGL is a specification, not a library. So comparing PyOpenGL with OpenGL it like comparing a blue-print with a house.

Answering your question: Python is an interpreted language, like Java. Game engines require very intensive computation, not only for graphics, but also for physics, AI, animations, loading 3D files, etc. PyOpenGL is probably enough for good graphics, but Python is not enough for all the CPU-side code.

Of course, that also depend of the "level" of your game engine: for simple/academic games, Python may work perfectly, but do not expect a Cryengine with it.

like image 200
Adrian Maire Avatar answered Jan 18 '23 22:01

Adrian Maire