Project

General

Profile

SO3Engine
SO3Compositor.h
Go to the documentation of this file.
1/*
2-----------------------------------------------------------------------------
3This source file is part of OpenSpace3D
4For the latest info, see http://www.openspace3d.com
5
6Copyright (c) 2012 I-maginer
7
8This program is free software; you can redistribute it and/or modify it under
9the terms of the GNU Lesser General Public License as published by the Free Software
10Foundation; either version 2 of the License, or (at your option) any later
11version.
12
13This program is distributed in the hope that it will be useful, but WITHOUT
14ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
16
17You should have received a copy of the GNU Lesser General Public License along with
18this program; if not, write to the Free Software Foundation, Inc., 59 Temple
19Place - Suite 330, Boston, MA 02111-1307, USA, or go to
20http://www.gnu.org/copyleft/lesser.txt
21
22-----------------------------------------------------------------------------
23*/
24
32#ifndef __SO3_COMPOSITOR_H__
33#define __SO3_COMPOSITOR_H__
34
37
38namespace SO3
39{
40
41class _SO3_Export SCompositor : public SData,
42 public Ogre::MaterialManager::Listener
43{
44public:
45protected:
46private:
47 bool isEnable;
48 bool isInternal;
49 SViewPort* parent;
50 Ogre::Viewport* mViewport;
51 Ogre::MaterialPtr mBlackMat;
52 Ogre::MaterialPtr mBlackMatTrans;
53 Ogre::String scheme;
54 Ogre::CompositorPtr ogreCompositor;
55 typedef std::vector<SCompositorTechnique*> CompositorTechniquesByIndex;
56 CompositorTechniquesByIndex compositorTechniquesByIndex;
57 typedef std::map<std::string, unsigned int> CompositorTechniquesIndexByName;
58 CompositorTechniquesIndexByName compositorTechniquesIndexByName;
59
60public:
63 SCompositor(SViewPort* scolViewPort, const std::string& compositorName, const std::string& schemeName = "");
64
68 SCompositor(SViewPort* scolViewPort, const std::string& compositorName, const bool& isActivated);
69
73 SCompositor(const std::string& compositorName, const std::string& schemeName = "");
74
78
81 bool GetEnable();
82
85 void SetEnable(const bool& enable);
86
89 SViewPort* GetParentViewPort();
90
93 int GetNumCompositorTechniques();
94
97 SCompositorTechnique* GetCompositorTechnique(const unsigned int& technique);
98
101 int GetCompositorTechniqueIndexByName(const std::string& techname);
102
105 void SetViewport(Ogre::Viewport* vp);
106
109 virtual Ogre::Technique* handleSchemeNotFound(unsigned short schemeIndex, const Ogre::String& schemeName, Ogre::Material* originalMaterial, unsigned short lodIndex, const Ogre::Renderable* rend);
110protected:
111private:
115 SCompositor();
116
120 void CommonConstructor(SViewPort* scolViewPort, const std::string& schemeName, bool internalCompo, bool activateCompo);
121
125 void _AttachToParent();
126
130 void _DetachFromParent();
131};
132
133}
134
135#endif
librairies include