Callable from C++?

Hi!

In the Panda 3D features I can read “Library callable from C++ or Python” but in the manual, I dont find how I can call it from a c++ program. :unamused:

I want to use Panda3D, but I would want to use c++ and not python. Is it possible?

Thanks :wink:

It is possible, yes.
Indeed we have to add more documentation about C++ in the manual.
Since I’m a total n00b at c++, I can’t help you.
Probably someone else here knows how to use c++.

If you’re using Visual Studio 8, you should have a look at this thread : panda3d.etc.cmu.edu/phpbb2/viewtopic.php?t=2368

BTW, this is a VS8 project that compiles the C++ pview application :
tom.rethaller.free.fr/vrac/Forums/pview.zip

@raytaller: I don’t think that’s what he meant. He wants just to create games using C++ and Panda3D, not compile the whole Panda3D engine himself.

Well, if you are able to compile the whole engine, then you certainly have enough to compile your own application against the engine. And this may be necessary anyway if your compiler version does not precisely match the compiler version we used to build Panda.

But if you don’t go the whole-engine route, all you need to do is put the Panda include dir on your include path, and the lib dir on your lib path, and #include the appropriate header files (e.g. “nodePath.h”, “loader.h”) and link with the appropriate lib files (libdtool.lib, libpanda.lib). Now the only thing you are missing is the documentation.

Fortunately, the Python-leaning documentation on this site also serves admirably well for the C++ side. You just have to know about the naming conventions (In C++, method names are generally lowercase with underscores between them, not mixed case as they are in Python; thus, it is nodePath.set_pos(), instead of nodePath.setPos()).

To get you off the ground with a graphics window, I recommend copying the pview program initially and modifying it for your needs.

There are a few other tips on this subject elsewhere on this forum. You should be able to find some good advice by searching around.

David

The project only compiles pview, not the Panda3D engine

Thanks for the replies :wink: :slight_smile:

He wants just to create games using C++ and Panda3D, not compile the whole Panda3D engine himself.

Yes, that is the idea. :wink: So, I´ll find on this forum and I´ll try put the panda files on my include path, link with the lib files… :wink: :slight_smile: I´ll take a look at pview code. :slight_smile: