| Version 1 (modified by martin, 6 years ago) |
|---|
Changes To Drawable
TracNav
- About
- Screenshots
- News
- Developer Blog
- Mailing Lists
- Forum
Documentation
- Getting Started
- Platform Specifics
- Tutorials
- Examples
- User Guides
- Programming Guides
- Reference Guides
- LatestDevelopments
- Porting
- CMake
- CDash
- CPack
- FAQ
- Tips And Tricks
- Maths
- Knowledge Base
- Trac Usage Examples
- TracGuide Documentation
- Software Patents
- Software Patents Europe
- Downloads
- Community
- Links
The following changes are essential to make to affected code, otherwise your original draw methods won't ever be called, so if you subclass from Drawable or Drawable::DrawCallback.
To enable more data about the current rendering traversal to be passed in the Drawable draw callbacks and subclasses drawImplementation method a new data strcture osg::RenderInfo has been introduced, and is now passed into the drawImplementation(..) method instead of osg::State&. RenderInfo? "has a" osg::State object so you can get this simply and use as before.
Your sublcasses from osg::Drawable will need to changed from:
class MyDrawable : public osg::Drawable
{
...
void drawImplementation(osg::State& state) const;
};
To
class MyDrawable : public osg::Drawable
{
...
void drawImplementation(osg::RenderInfo& renderInfo) const;
};
The implementation of drawImplementation can be amended a bit to get back the osg::State object if you use it.
void MyDrawable::drawImplementation(osg::RenderInfo& renderInfo) const
{
osg::State& state = *renderInfo.getState();
... // code as before, no other changes required.
}
Similar changes are required from Drawable::DrawCallback.
