ADD A LIBRARY TO PANDA3D

Bit confused about Panda3d. I know it’s base is C++ and what I want to do is add a C++ library that I wrote, to give some hardware interface access to the game progammer. For all of you Panda guru’s, what is the best method for achieving this.

There is the python thing…but I am not a fan of going through layers and layers to add features. Surely other’s have done this.

Best advise is very welcome. 8)

I think the best way is to make sure panda3d compiles with your C++ lib and then post patch or zip here.

To write your lib you can see how the skel directory does it.

What kind of library are you writing?

Library that can contol a digital IO hardware for external physical buttons. I will check out what you suggest and get back to you.

You’ll need to be prepared to dig in the C++ code of panda. Here’s someone who went through this too and this post might be useful to you:
discourse.panda3d.org/viewtopic.php?t=5243

Interesting. Is there any other way one could suggest?
The point is : from the game to allow the programmer to call, through python or other method, a function to turn a light on or off and to detect if someone has depressed a physical button. Very simple in the C++ world and have even coded an xtra for Director to do the same.

Looking for the simplest way, without necessarily recompiling the entire engine…
-Thanks.

You don’t necessarily have to integrate it in the Panda codebase, you can just also call your library independently from Panda (I don’t know the details in your case, but e.g. add a polling function to your library that checks if the button is pressed, and call that from your Panda app.)
If you’re using Python, you will then need to write Python bindings for your library (or use SWIG or Interrogate)

humm. Ok, not sure that is going to be the best solution. This needs to be very “real-time” and dynamic. Delays will not fly…which is typical when running multiple threads for a single app. I am not totally sure what format the game programmer is actually using…as I have not developed in Panda myself, having chosen to write my own engines over the years. Seems like integrating may be the best solution. Do you know what compiler is frequently used. I own Visual C ++ 6.0 and 2007. They are the environments I prefer. Digging into code has never been a big problem for me.

Thanks for all your help and guiding me into the right direction.

On windows, MSVC2005 is usually used (for now, there are plans to migrate to MSVC2008. I never heard of 2007).
On unix, any recent version of g++ would work, I guess.

2007/2008. I had the beta version, bad habit. Do not use Linex, so it is good to know that 2005 would work. I can round up a copy somewhere…

I will let you know. 8)