Porting Panda3d

I think Panda3D design is very good but working with Python limits the scope of our games a little in terms of speed. I don’t want to turn this thread into a Python debate but if someone wanted to make a Java or C# port for example what would be the classes to start looking into?

panda is not written in python. it’s only using python to controll the engine. the engine itself is c++ (afaik). if you are that speed concerned you can still code in c++ but the documentation on it is pretty bad since panda is supposed to be used with python.
panda combines the speed of c++ with the easy to use python to controll it.
lots of engine’s are doing the same. quake, unreal, crappy 3dgs,… most of them have a simple scriptlanguage to controll the engine itself.

well for your question… i guess you should start with the classes you intend to use later :wink:

How is an instance of GameEngine created, i mean what are the initial steps in terms of method calls to get a window shown for a specific GraphicsPipe (opengl or dx8) where we can draw things? Knowing this would help determine what happens first when panda starts.

hm. isn’t this explained in the manual? “panda rendering process”?

Not what i’m asking. In Python we just do:

import direct.directbase.DirectStart

And everything gets created like magic.


The section “Panda Rendering Process” of the manual just assumes that these objects already exist. It doesn’t explain how to create these objects ourselves, without using DirectStart, if i’m reading it well.

well since panda is open source you could look into the source and see what direct start is calling

That would be an idea. In the meantime i noticed some possible mistakes in the “The_Graphics_Engine” chapter of the manual.


Theres no method makeGsg in graphicsEngine.

“myWindow=base.graphicsEngine.makeWindow(myGsg, “Hello World”, 0)”

Theres no method makeWindow in graphicsEngine.

“myParasite=base.graphicsEngine.makeBuffer(myBuffer,“Im a leech”, 0, 800, 600)”

This seams to be a typo. It should be makeParasite instead.

When i find more stuff i will tell you.

A simple c++ app that may help ypu get bootstraped is pview in the panda tree. It open a window(s), support gl or dx, loads models / animations. respondes to key/mouse input and moves the camera based on them…

Cheers… Roger

The pview app is definitely a good place to start, as is digging into the DirectStart module and seeing the code that is executed within.

One thing to be aware of: There are quite a few constructs in Panda3d (most of DirectGUI, the messenger, and FSM, for example) that are in fact implemented in Python. If you wish to use the Panda engine without Python, you will need to either build these or come up with alternatives. Fortunately, FSMs and the messenger are not particularly complicated; systems like DirectGUI may take a bit more work.

Best of luck!

I think i understand how it works now. Theres a method that does everything now:

graphics_output = makeOutput(pipe, name, sort, fb_prop, win_prop, flags, gsg, host_output)

We just have to setup flags and pass a null gsg and host_output and the method will create the GSG together with the window or buffer.