Kanma
15-11-2005 11:01:30
For your information, this is the content of the next patch I'll sent to EagleEye:
- No more warnings from SWIG for OgreBindings
I fixed all the warnings that were output'd by SWIG, It'll will now be easier to see if new modifications can cause problems at this level.
It was mainly a matter of instancing some templated base class (Ogre::Singleton and Ogre::SharedPtr). The csout typemaps are now done on the same pattern than the standard SWIG's ones, that is with the ability to throw an exception when a C++ exception occurs.
- VectorIterator and MapIterator
For the end-user it's transparent, but if you need to wrap one class like that, read the following.
I cheated on this one, because SWIG generated invalid code when wrapping, for instance, std::vector<Ogre::Bone*> (also known as Ogre::Skeleton::BoneList) and Ogre::VectorIterator<BoneList>.
The good news is that we don't need to wrap BoneList. It's a class used internally by Ogre, that the user never directly uses. But we can retrieve an iterator to the bones of a skeleton (with Skeleton::getBoneIterator() and Skeleton::getRootBoneIterator()). So I simply created my own iterator template (CustomVectorIterator), which take a standard Ogre::VectorIterator as a parameter in its constructor. This class is wrapped using the same name than the original Ogre one.
I don't know if it's clear..., but if your confused, a look at Skeleton.i will help you. Again, the user doesn't see any difference, for him OgreDotNet.BoneIterator is the same than Ogre::Skeleton::BoneIterator.
Maybe we will found other classes for which that trick will not work... we'll see!
- New project configuration
It was in a previous patch, but wasn't mentioned:
There is now a new project configuration, called 'Debug (from sources)' that allows you to build OgreDotNet from the Ogre's sources rather than from the SDK. Just define the OGRE_SRC_HOME environnement variable to your 'ogrenew' folder.
- New classes wrapped
- BoneIterator
- ChildNodeIterator
- MaterialPtr (now act like a Material)
- TexturePtr (now act like a Texture)
- PatchMeshPtr (now act like a PatchMesh)
- No more warnings from SWIG for OgreBindings
I fixed all the warnings that were output'd by SWIG, It'll will now be easier to see if new modifications can cause problems at this level.
It was mainly a matter of instancing some templated base class (Ogre::Singleton and Ogre::SharedPtr). The csout typemaps are now done on the same pattern than the standard SWIG's ones, that is with the ability to throw an exception when a C++ exception occurs.
- VectorIterator and MapIterator
For the end-user it's transparent, but if you need to wrap one class like that, read the following.
I cheated on this one, because SWIG generated invalid code when wrapping, for instance, std::vector<Ogre::Bone*> (also known as Ogre::Skeleton::BoneList) and Ogre::VectorIterator<BoneList>.
The good news is that we don't need to wrap BoneList. It's a class used internally by Ogre, that the user never directly uses. But we can retrieve an iterator to the bones of a skeleton (with Skeleton::getBoneIterator() and Skeleton::getRootBoneIterator()). So I simply created my own iterator template (CustomVectorIterator), which take a standard Ogre::VectorIterator as a parameter in its constructor. This class is wrapped using the same name than the original Ogre one.
I don't know if it's clear..., but if your confused, a look at Skeleton.i will help you. Again, the user doesn't see any difference, for him OgreDotNet.BoneIterator is the same than Ogre::Skeleton::BoneIterator.
Maybe we will found other classes for which that trick will not work... we'll see!
- New project configuration
It was in a previous patch, but wasn't mentioned:
There is now a new project configuration, called 'Debug (from sources)' that allows you to build OgreDotNet from the Ogre's sources rather than from the SDK. Just define the OGRE_SRC_HOME environnement variable to your 'ogrenew' folder.
- New classes wrapped
- BoneIterator
- ChildNodeIterator
- MaterialPtr (now act like a Material)
- TexturePtr (now act like a Texture)
- PatchMeshPtr (now act like a PatchMesh)