As I said some weeks ago, I want to write some notes about porting an
application from OpenSG 1.8 to OpenSG 2.0.
First of all, the porting I have done is related to some Win32 applications,
so I am not aware of linux issues...
Also, I compiled OSG2 with OSGCOMPAT_ENABLE flag enabled (there are some
benefits that help the transition, such ad osg namespace mapped to OSG, Ptr
and RefPtr mapped to RecPtr).
These are the changes I had to make:
- remove all beginEditCP/endEditCP/CPEdit calls, they are now automatically
handled
- Ptrs and RefPtrs are now renamed to RecPtrs, use them from now on
- Geometry properties are changed: they are now something like
GeoUInt8PropertyRefPtr for the type, GeoUInt32PropertyRefPtr for lengths and
indices, GeoPnt3fPropertyRefPtr for positions, GeoVec3fPropertyRefPtr for
colors and normals, and so on
- multi-indexed geometry indices are now handled differently: you must use
geo->setIndex(someIndices, Geometry::ColorsIndex),
geo->setIndex(someOtherIndices, Geometry::TexCoordsIndex) and so on
- BoundingVolume does not exists anymore: use BoxVolume instead
- TextureChunk does not exists anymore: use TextureObjChunk and
TextureEnvChunk instead
- SHLChunk does not exists anymore: use SimpleSHLChunk instead
- CubeTextureChunk does not exists anymore: use CubeTextureObjChunk instead
- ImageBackground does not exists anymore: use TextureBackground instead
- TextTXFFace and TextPixmapFace are now RecPtrs and not simple C++
pointers, you don't need to addRef and subRef them anymore
- Thread and Barrier are now RecPtrs and not simple C++ pointers
- GraphOp child classes and GraphOpSeq are now RecPtrs and not simple C++
pointers
- Thread::getCurrentChangeList()->clearAll() does not exist anymore: use
Thread::getCurrentChangeList()->clear() or
Thread::getCurrentChangeList()->commitChangesAndClear()
- material->isMultiPass() does not exist anymore: try a dcast instead
- traverse method is changed, the new syntax is something like
traverse(node, boost::bind(&YourNamespace::YourClass,YourMethod, this, _1));
YourMethod parameter is now a Node * and not a NodePtr
- use OSG::commitChanges() when you want to apply che changelist to the
aspects (eg. to update the BoxVolumes)
- you need to substitute makeSphere() with makeLatLongSphere() to preserve
texture coordinates
- I had to change the preprocessor defines of my applications and add to
them
"OSG_DEBUG;OSG_DEBUGRT;OSG_BUILD_ACTIVE;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;_SECURE_SCL=0;_SCL_SECURE_NO_WARNINGS;_SCL_SECURE_NO_DEPRECATE"
to make the release version work
- a lot of class->getSomething() methods do not exist anymore, use the
class->editSomething() call instead
- point-to-vector and vector-to-point conversions are more restrictive, use
point.subZero() and vector.addToZero() calls
- ShadowViewport does not exists anymore, you need to manage shadow
rendering using stages (see the tutorials)
- under Windows if you want to read and write images or 3D models you need
to call OSG::preloadSharedObject("OSGFileIO") and
OSG::preloadSharedObject("OSGImageFileIO") before calling osgInit()
- OpenSG 2.0 is split in several dlls, remember to link them all
Hope that helps!
Christian Bar
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
Opensg-users mailing list
Opensg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensg-users