Added forward declaration of callbacks to headers to avoid scoping issues of classes with same names.

This commit is contained in:
Robert Osfield 2009-01-23 15:50:05 +00:00
parent 7b598c5701
commit e0c279bf3d
4 changed files with 10 additions and 3 deletions

View File

@ -75,6 +75,9 @@ class OSGSHADOW_EXPORT DebugShadowMap : public ViewDependentShadowTechnique
/** Classic protected OSG destructor */
virtual ~DebugShadowMap();
// forward declare, interface and implementation provided in DebugShadowMap.cpp
class DrawableDrawWithDepthShadowComparisonOffCallback;
osg::Vec2s _hudSize;
osg::Vec2s _hudOrigin;
osg::Vec2s _viewportSize;

View File

@ -95,6 +95,9 @@ class OSGSHADOW_EXPORT ShadowMap : public ShadowTechnique
virtual void createShaders();
// forward declare, interface and implementation provided in ShadowMap.cpp
class DrawableDrawWithDepthShadowComparisonOffCallback;
osg::ref_ptr<osg::Camera> _camera;
osg::ref_ptr<osg::TexGen> _texgen;
osg::ref_ptr<osg::Texture2D> _texture;

View File

@ -405,13 +405,13 @@ void DebugShadowMap::ViewData::init( ThisClass *st, osgUtil::CullVisitor *cv )
_cameraDebugHUD = NULL;//Force debug HUD rebuild ( if needed )
}
// Callback used by debugging hud to display Shadow Map to color buffer
// Had to do it this way because OSG does not allow to use
// the same GL Texture Id with different glTexParams.
// Callback simply turns compare mode off via GL while rendering hud and
// restores it before rendering the scene with shadows.
class DrawableDrawWithDepthShadowComparisonOffCallback:
class DebugShadowMap::DrawableDrawWithDepthShadowComparisonOffCallback:
public osg::Drawable::DrawCallback
{
public:

View File

@ -514,7 +514,7 @@ void ShadowMap::cleanSceneGraph()
// Callback simply turns shadow compare mode off via GL while rendering hud and
// restores it afterwards.
////////////////////////////////////////////////////////////////////////////////
class DrawableDrawWithDepthShadowComparisonOffCallback:
class ShadowMap::DrawableDrawWithDepthShadowComparisonOffCallback:
public osg::Drawable::DrawCallback
{
public:
@ -549,6 +549,7 @@ public:
osg::ref_ptr< osg::Texture2D > _texture;
unsigned _stage;
};
////////////////////////////////////////////////////////////////////////////////
osg::ref_ptr<osg::Camera> ShadowMap::makeDebugHUD()
{