Ignition Rendering

API Reference

5.0.0
Ogre2RenderTargetMaterial.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 #ifndef IGNITION_RENDERING_OGRE2_OGRE2RENDERTARGETMATERIAL_HH_
18 #define IGNITION_RENDERING_OGRE2_OGRE2RENDERTARGETMATERIAL_HH_
19 
20 #include <vector>
21 
22 #include "ignition/rendering/config.hh"
23 #include "ignition/rendering/ogre2/Export.hh"
24 
25 #ifdef _MSC_VER
26  #pragma warning(push, 0)
27 #endif
28 #include <OgreRenderTargetListener.h>
29 #include <OgreMaterialManager.h>
30 #ifdef _MSC_VER
31  #pragma warning(pop)
32 #endif
33 
34 #ifdef _MSC_VER
35  #pragma warning(push)
36  // Silence deriving from Ogre::RenderTargetListener dll-linkage warnings
37  #pragma warning(disable:4275)
38 #endif
39 
40 namespace ignition
41 {
42  namespace rendering
43  {
44  inline namespace IGNITION_RENDERING_VERSION_NAMESPACE {
45  //
58  class IGNITION_RENDERING_OGRE2_VISIBLE Ogre2RenderTargetMaterial :
59  public Ogre::RenderTargetListener,
60  public Ogre::MaterialManager::Listener
61  {
66  public: Ogre2RenderTargetMaterial(Ogre::SceneManager *_scene,
67  Ogre::RenderTarget *_renderTarget, Ogre::Material *_material);
68 
70  public: ~Ogre2RenderTargetMaterial();
71 
75  private: virtual void preRenderTargetUpdate(
76  const Ogre::RenderTargetEvent &_evt) override;
77 
81  private: virtual void postRenderTargetUpdate(
82  const Ogre::RenderTargetEvent &_evt) override;
83 
94  public: virtual Ogre::Technique *handleSchemeNotFound(
95  uint16_t _schemeIndex, const Ogre::String &_schemeName,
96  Ogre::Material *_originalMaterial, uint16_t _lodIndex,
97  const Ogre::Renderable *_rend) override;
98 
100  public: bool IsSameRenderTarget(Ogre::RenderTarget *_renderTarget);
101 
103  private: Ogre::SceneManager *scene = nullptr;
104 
106  private: Ogre::RenderTarget *renderTarget = nullptr;
107 
109  private: Ogre::Material *material = nullptr;
110 
112  private: Ogre::String schemeName;
113  };
114  }
115  }
116 }
117 
118 #ifdef _MSC_VER
119  #pragma warning(pop)
120 #endif
121 
122 #endif
Causes all objects in a scene to be rendered with the same material when rendered by a given RenderTa...
Definition: Ogre2RenderTargetMaterial.hh:58