RigsofRods
Soft-body Physics Simulation
SurveyMapTextureCreator.h
Go to the documentation of this file.
1 /*
2  This source file is part of Rigs of Rods
3  Copyright 2005-2012 Pierre-Michel Ricordel
4  Copyright 2007-2012 Thomas Fischer
5 
6  For more information, see http://www.rigsofrods.org/
7 
8  Rigs of Rods is free software: you can redistribute it and/or modify
9  it under the terms of the GNU General Public License version 3, as
10  published by the Free Software Foundation.
11 
12  Rigs of Rods is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with Rigs of Rods. If not, see <http://www.gnu.org/licenses/>.
19 */
20 
21 #pragma once
22 
23 #include "Application.h"
24 #include <OgreRenderTargetListener.h>
25 
26 namespace RoR {
27 
28 class SurveyMapTextureCreator : public Ogre::RenderTargetListener
29 {
30 public:
31 
32  SurveyMapTextureCreator(Ogre::Real terrain_height);
34 
35  bool init(int res, int fsaa);
36  void update(Ogre::Vector2 center, Ogre::Vector2 size);
37  Ogre::TexturePtr convertTextureToStatic(const std::string& texName, const std::string& rgName);
38 
39 protected:
40 
41  void preRenderTargetUpdate(const Ogre::RenderTargetEvent &evt);
42  void postRenderTargetUpdate(const Ogre::RenderTargetEvent &evt);
43 
44  Ogre::Real mTerrainHeight;
45  Ogre::String mTextureName;
46 
47  Ogre::Camera* mCamera;
48  Ogre::TexturePtr mTexture;
49  Ogre::RenderTarget* mRttTex;
50 };
51 
52 } // namespace RoR
RoR::SurveyMapTextureCreator::init
bool init(int res, int fsaa)
Definition: SurveyMapTextureCreator.cpp:54
RoR::SurveyMapTextureCreator::mCamera
Ogre::Camera * mCamera
Definition: SurveyMapTextureCreator.h:47
RoR::SurveyMapTextureCreator::preRenderTargetUpdate
void preRenderTargetUpdate(const Ogre::RenderTargetEvent &evt)
Definition: SurveyMapTextureCreator.cpp:98
RoR::SurveyMapTextureCreator::SurveyMapTextureCreator
SurveyMapTextureCreator(Ogre::Real terrain_height)
Definition: SurveyMapTextureCreator.cpp:35
RoR::SurveyMapTextureCreator::mTextureName
Ogre::String mTextureName
Definition: SurveyMapTextureCreator.h:45
RoR::SurveyMapTextureCreator::update
void update(Ogre::Vector2 center, Ogre::Vector2 size)
Definition: SurveyMapTextureCreator.cpp:87
RoR::SurveyMapTextureCreator::mTexture
Ogre::TexturePtr mTexture
Definition: SurveyMapTextureCreator.h:48
Application.h
Central state/object manager and communications hub.
RoR::SurveyMapTextureCreator::mRttTex
Ogre::RenderTarget * mRttTex
Definition: SurveyMapTextureCreator.h:49
RoR::SurveyMapTextureCreator::postRenderTargetUpdate
void postRenderTargetUpdate(const Ogre::RenderTargetEvent &evt)
Definition: SurveyMapTextureCreator.cpp:111
RoR::SurveyMapTextureCreator
Definition: SurveyMapTextureCreator.h:28
RoR::SurveyMapTextureCreator::convertTextureToStatic
Ogre::TexturePtr convertTextureToStatic(const std::string &texName, const std::string &rgName)
Definition: SurveyMapTextureCreator.cpp:120
RoR::SurveyMapTextureCreator::mTerrainHeight
Ogre::Real mTerrainHeight
Definition: SurveyMapTextureCreator.h:44
RoR
Definition: AppContext.h:36
RoR::SurveyMapTextureCreator::~SurveyMapTextureCreator
~SurveyMapTextureCreator()
Definition: SurveyMapTextureCreator.cpp:44