OpenWalnut  1.4.0
WGEOffscreenFinalPass.h
00001 //---------------------------------------------------------------------------
00002 //
00003 // Project: OpenWalnut ( http://www.openwalnut.org )
00004 //
00005 // Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
00006 // For more information see http://www.openwalnut.org/copying
00007 //
00008 // This file is part of OpenWalnut.
00009 //
00010 // OpenWalnut is free software: you can redistribute it and/or modify
00011 // it under the terms of the GNU Lesser General Public License as published by
00012 // the Free Software Foundation, either version 3 of the License, or
00013 // (at your option) any later version.
00014 //
00015 // OpenWalnut is distributed in the hope that it will be useful,
00016 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018 // GNU Lesser General Public License for more details.
00019 //
00020 // You should have received a copy of the GNU Lesser General Public License
00021 // along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
00022 //
00023 //---------------------------------------------------------------------------
00024 
00025 #ifndef WGEOFFSCREENFINALPASS_H
00026 #define WGEOFFSCREENFINALPASS_H
00027 
00028 #include <string>
00029 
00030 #include <osg/Geode>
00031 #include <osg/TexMat>
00032 
00033 #include "WGEOffscreenTexturePass.h"
00034 
00035 class WGETextureHud;
00036 
00037 /**
00038  * This class is basically a WGEOffscreenTexturePass with the difference that it finally renders to the on-screen frame buffer.
00039  */
00040 class WGEOffscreenFinalPass: public WGEOffscreenTexturePass
00041 {
00042 public:
00043     /**
00044      * Convenience typedef for an osg::ref_ptr
00045      */
00046     typedef osg::ref_ptr< WGEOffscreenFinalPass > RefPtr;
00047 
00048     /**
00049      * Convenience typedef for an osg::ref_ptr; const
00050      */
00051     typedef osg::ref_ptr< const WGEOffscreenFinalPass > ConstRefPtr;
00052 
00053     /**
00054      * Creates a new rendering pass instance which actually renders on a full-screen quad.
00055      *
00056      * \param textureWidth the width of all the textures created and used by this render pass. This should be large enough for every reasonable
00057      *                     viewport size.
00058      * \param textureHeight the height of all the textures created and used by this render pass. This should be large enough for every reasonable
00059      *                     viewport size.*
00060      * \param num the order number. This camera gets rendered at the num'th place in the pre render queue of the subgraph it is attached to.
00061      */
00062     WGEOffscreenFinalPass( size_t textureWidth, size_t textureHeight, int num = 0 );
00063 
00064     /**
00065      * Creates a new rendering pass instance which actually renders on a full-screen quad.
00066      *
00067      * \param textureWidth the width of all the textures created and used by this render pass. This should be large enough for every reasonable
00068      *                     viewport size.
00069      * \param textureHeight the height of all the textures created and used by this render pass. This should be large enough for every reasonable
00070      *                     viewport size.*
00071      * \param num the order number. This camera gets rendered at the num'th place in the pre render queue of the subgraph it is attached to.
00072      * \param hud the hud that gets notified about attached and detached textures. Useful for debugging.
00073      * \param name the name of this render pass. This is a nice debugging feature in conjunction with WGETextureHud as it gets displayed there.
00074      */
00075     WGEOffscreenFinalPass( size_t textureWidth, size_t textureHeight, osg::ref_ptr< WGETextureHud > hud, std::string name, int num = 0 );
00076 
00077     /**
00078      * Destructor.
00079      */
00080     virtual ~WGEOffscreenFinalPass();
00081 
00082 protected:
00083 private:
00084 };
00085 
00086 #endif  // WGEOFFSCREENFINALPASS_H
00087