diff --git a/include/osgShadow/DebugShadowMap b/include/osgShadow/DebugShadowMap index e8fa9f7fb..dbaf68d6e 100644 --- a/include/osgShadow/DebugShadowMap +++ b/include/osgShadow/DebugShadowMap @@ -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; diff --git a/include/osgShadow/ShadowMap b/include/osgShadow/ShadowMap index e23084bd8..5b809ff3e 100644 --- a/include/osgShadow/ShadowMap +++ b/include/osgShadow/ShadowMap @@ -94,6 +94,9 @@ class OSGSHADOW_EXPORT ShadowMap : public ShadowTechnique virtual void createUniforms(); virtual void createShaders(); + + // forward declare, interface and implementation provided in ShadowMap.cpp + class DrawableDrawWithDepthShadowComparisonOffCallback; osg::ref_ptr _camera; osg::ref_ptr _texgen; diff --git a/src/osgShadow/DebugShadowMap.cpp b/src/osgShadow/DebugShadowMap.cpp index 13d776964..7720a3feb 100644 --- a/src/osgShadow/DebugShadowMap.cpp +++ b/src/osgShadow/DebugShadowMap.cpp @@ -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: diff --git a/src/osgShadow/ShadowMap.cpp b/src/osgShadow/ShadowMap.cpp index 066962640..5dc9181ce 100644 --- a/src/osgShadow/ShadowMap.cpp +++ b/src/osgShadow/ShadowMap.cpp @@ -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 ShadowMap::makeDebugHUD() {