trouble embedding python
TheDustbustr
thedustbustr at aol.com
Sat Jun 7 18:48:28 EDT 2003
Let me explain my situation: I'm doing a 3D game with opengl. I made a simple
terrain renderer that barely made 40 fps with a 48x48 tri mesh and 3 textures
(sorted by texture, using vertex arrays) (I have a Geforce4). Similarly, I
made an exceedingly basic explosion (randomly rotating triangles with random
velocities) that got 40fps as well. This simply is not acceptable. The
problem was probably PyOpenGL, but I got sick of terrible framerates.
So, I'm writing everything in C++ and using Python for scripting and user
configuration. At this point, I dont need to embed much, I'll simply write
interface functions in Python and call those from c++.
Also, this project serves as a way for me to better learn a language besides
python: in college, I don't want to have to learn another language for a
course.
I don't understand your comment about optimizing C++. In Python, I optimized
next to nothing (except for OpenGL vertex submission), but it should be
irrelevant: I get hundreds of FPS in similar C++ apps.
Some related questions.
1. Whats the difference between PyDict_GetItemString and
PyObject_GetItemString?
2. If I want to access "scripts.classes.race.human.Human" (where scripts is a
package containing several subpackages containing subpackages containing
modules containing classes), do I have to PyObject_GetItemString each thing
seperated by periods? Is there no shortcut?
More information about the Python-list
mailing list