Coding Panda in C++

Hi All,

I do not know Python… but am a very proficient C++ coder (been coding in C++ for a living for ten years :slight_smile: )

Is there any starting resource / sample code for developing Panda3D apps in C++???

regards
mohaps

Take a look at the 3D model viewer, pview. That’s written entirely in C++, it could be used as the foundation for something more complex.

panda\src\testbed\pview.cxx

is this the one you are refering to???

I’m pretty sure you can find it in the Panda3d source:

panda3d.org/download.php

sorry,

i found the code in testbed… in source archive…

I was looking under the samples source at first

that’s the one.

Hi,
found panda3d here: happypenguin.org/ It sounds pretty good, so I wanna make some test with it, but I don’t get pview compiled with codeblocks (gnu gcc compiler - win32). A little help would be very nice :slight_smile:


Compiling: ..\..\..\source\pview.cxx
In file included from ../panda_inc/cmath.h:61,
                 from ../panda_inc/stl_compares.h:23,
                 from ../panda_inc/pset.h:24,
                 from ../panda_inc/weakReferenceList.h:23,
                 from ../panda_inc/referenceCount.h:23,
                 from ../panda_inc/cycleData.h:24,
                 from ../panda_inc/pandaNode.h:24,
                 from ../panda_inc/nodePath.h:24,
                 from ../panda_inc/windowFramework.h:23,
                 from ../panda_inc/pandaFramework.h:24,
                 from ..\..\..\source\pview.cxx:18:
../panda_inc/cmath.I: In function `void csincos(float, float*, float*)':
../panda_inc/cmath.I:54: error: expected `(' before '{' token
../panda_inc/cmath.I:54: error: expected asm body before '{' token
../panda_inc/cmath.I:55: error: `mov' undeclared (first use this function)
../panda_inc/cmath.I:55: error: (Each undeclared identifier is reported only once for each function it appears in.)
../panda_inc/cmath.I:55: error: expected `;' before "eax"
../panda_inc/cmath.I: In function `void csincos(double, double*, double*)':
../panda_inc/cmath.I:153: error: expected `(' before '{' token
../panda_inc/cmath.I:153: error: expected asm body before '{' token
../panda_inc/cmath.I:154: error: `mov' undeclared (first use this function)
../panda_inc/cmath.I:154: error: expected `;' before "eax"
In file included from ../panda_inc/typedef.h:22,
                 from ../panda_inc/trueClock.h:23,
                 from ../panda_inc/clockObject.h:24,
                 from ../panda_inc/config_express.h:24,
                 from ../panda_inc/typeHandle.h:26,
                 from ../panda_inc/typedObject.h:24,
                 from ../panda_inc/referenceCount.h:24,
                 from ../panda_inc/cycleData.h:24,
                 from ../panda_inc/pandaNode.h:24,
                 from ../panda_inc/nodePath.h:24,
                 from ../panda_inc/windowFramework.h:23,
                 from ../panda_inc/pandaFramework.h:24,
                 from ..\..\..\source\pview.cxx:18:
../panda_inc/numeric_types.h:33:21: prtypes.h: No such file or directory
In file included from ../panda_inc/typedef.h:22,
                 from ../panda_inc/trueClock.h:23,
                 from ../panda_inc/clockObject.h:24,
                 from ../panda_inc/config_express.h:24,
                 from ../panda_inc/typeHandle.h:26,
                 from ../panda_inc/typedObject.h:24,
                 from ../panda_inc/referenceCount.h:24,
                 from ../panda_inc/cycleData.h:24,
                 from ../panda_inc/pandaNode.h:24,
                 from ../panda_inc/nodePath.h:24,
                 from ../panda_inc/windowFramework.h:23,
                 from ../panda_inc/pandaFramework.h:24,
                 from ..\..\..\source\pview.cxx:18:
../panda_inc/numeric_types.h: At global scope:
Process terminated with status 1 (0 minutes, 14 seconds)
10 errors, 0 warnings

Pview is compiled as part of the normal process of compiling panda. Just compile panda, and you’ve compiled pview. See “doc/INSTALL-MK”

As for using gcc under windows, that’s not going to work. You can use gcc under linux, or visual studio under windows. It’s also possible to use the free visual toolkit under windows.

Well this is a problem (for me).

hehe, it is not free - its only gratis.

I hope there will be a gcc-port for windows someday…

If you object to using non-Free software, why not install and run Linux instead of Windows?

David

hehe, of course i have installed linux.
Here are the reasons for m$:

  • For my work i need it, so i can’t erase it.
  • The mmorg i am working on is a multiplatform one.
    So i need a working linux AND a working win version.

For now, the Windows build of Panda requires the non-Free (but gratis) Microsoft compiler.

We tried to use gcc several years ago, but found that its support for Windows DLL’s was not strong enough for Panda’s needs. This may have changed by now, and if you are willing to do the work of porting the build system to gcc on Windows–which would entail learning all about the current build system and about the DLL requrements–then we will be happy to incorporate that work into the Panda source tree.

Until then, though, it doesn’t really seem that unprincipled to use a non-Free compiler to build an executable for a non-Free operating system.

David

Agrees with David.

Btw, Polyveg, I was thinking: why dont you figure out a way to use gcc on Linux as a cross-compiler to msvc? I mean, obviously this is not trivial, but it could be incredibly useful.

Hugh

Its not a question of willing, more a question of knowledge. thats why i asked someone else :wink:

my Teamleader says the same… strange world :wink:

because i have only spare time for one project - and now its time to level up my cpp skill.

meanwhile i have downloaded the gratis ms compiler…
but if panda3d and /me are compatible (= i am able to get my stuff done in panda3d) - we will talk again :slight_smile:

btw, just realized that i never said what exactly i wanna do with panda.
i am working here: web2.168180.vserver.de/
and have done some (or huge - just a point of view :slight_smile: ) parts of client2d, now i am working on the client3d: people.freenet.de/client3d/

I started a codeblocks-project with the non-free compler. It’s not that easy to code in cpp with the python manual - but as an os coder I am pain-proofed :laughing:

The manual says in section network:

ok, I like to use it…
It would nice to get an overview of the network capabilities.

To compile panda3d without warning under VC6 and VC7 we
needed to tweak panda3d in this way:

/*

  • Important:
  • In the File panda_inc/bitMask.h replace the following line:
  • EXPORT_TEMPLATE_CLASS(EXPCL_PANDA, EXPTP_PANDA, BITMASK32_DEF);
  • with this one:
  • template __declspec(dllexport) BITMASK32_DEF;
    */

#include “bitMask.h”
#include “pandaNode.h”
#include “collisionNode.h”

#ifdef WIN32_VC // disable dll interface warning
#pragma warning (disable : 4273)
#endif

CollideMask PandaNode::get_legal_collide_mask() const
{
return CollideMask::all_off();
}

CollideMask CollisionNode::get_legal_collide_mask() const
{
return CollideMask::all_on();
}

gratis(Spanish) = free(English) :wink:

The English word “free” has multiple meanings. One meaning of “free” is the same as that of the Spanish (or Latin) word “gratis”–it means you don’t have to pay for it. Another, completely different, meaning of “free” is the same as the Spanish (or Latin) word “libre”–it means the thing is unencumbered by restrictions.

So when someone says about a product that “it is not free, it is only gratis” he is emphasizing that only the first definition of free applies; while you don’t have to pay for it, it is still encumbered by restrictions on its use.

David