Ignition Rendering

API Reference

0.1.0
OgreRenderEngine.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 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_OGRE_OGRERENDERENGINE_HH_
18 #define IGNITION_RENDERING_OGRE_OGRERENDERENGINE_HH_
19 
20 #include <memory>
21 #include <string>
22 #include <vector>
23 
24 #include <ignition/common/SingletonT.hh>
25 
30 #include "ignition/rendering/ogre/Export.hh"
31 
32 namespace Ogre
33 {
34  class LogManager;
35  class Root;
36 }
37 
38 namespace ignition
39 {
40  namespace rendering
41  {
42  // forward declaration
43  class OgreRenderEnginePrivate;
44 
46  class IGNITION_RENDERING_OGRE_VISIBLE OgreRenderEnginePlugin :
47  public RenderEnginePlugin
48  {
50  public: OgreRenderEnginePlugin();
51 
53  public: ~OgreRenderEnginePlugin() = default;
54 
57  public: std::string Name() const;
58 
61  public: RenderEngine *Engine() const;
62  };
63 
64  class IGNITION_RENDERING_OGRE_VISIBLE OgreRenderEngine :
65  public virtual BaseRenderEngine,
66  public common::SingletonT<OgreRenderEngine>
67  {
70  public: enum OgreRenderPathType
71  {
73  NONE = 0,
75  VERTEX = 1,
77  FORWARD = 2,
79  DEFERRED = 3,
81  RENDER_PATH_COUNT
82  };
83 
85  private: OgreRenderEngine();
86 
87  public: virtual ~OgreRenderEngine();
88 
89  public: virtual bool Fini();
90 
91  public: virtual bool IsEnabled() const;
92 
93  public: virtual std::string Name() const;
94 
95  public: OgreRenderPathType RenderPathType() const;
96 
97  public: void AddResourcePath(const std::string &_uri);
98 
99  public: virtual Ogre::Root *OgreRoot() const;
100 
101  public: std::string CreateWindow(const std::string &_handle,
102  const unsigned int _width, const unsigned int _height,
103  const double _ratio, const unsigned int antiAliasing);
104 
105  protected: virtual ScenePtr CreateSceneImpl(unsigned int _id,
106  const std::string &_name);
107 
108  protected: virtual SceneStorePtr Scenes() const;
109 
110  protected: virtual bool LoadImpl();
111 
112  protected: virtual bool InitImpl();
113 
114  private: void LoadAttempt();
115 
116  private: void CreateLogger();
117 
118  private: void CreateContext();
119 
120  private: void CreateRoot();
121 
122  private: void CreateOverlay();
123 
124  private: void LoadPlugins();
125 
126  private: void CreateRenderSystem();
127 
128  private: void CreateResources();
129 
130  private: void CreateWindow();
131 
132  private: void CheckCapabilities();
133 
134  private: void InitAttempt();
135 
136  private: bool loaded;
137 
138  private: bool initialized;
139 
140  private: OgreSceneStorePtr scenes;
141 
142  private: OgreRenderPathType renderPathType;
143 
144  private: Ogre::Root *ogreRoot;
145 
146  private: Ogre::LogManager *ogreLogManager;
147 
149  private: std::vector<std::string> ogrePaths;
150 
151 #if not (__APPLE__ || _WIN32)
152  private: void *dummyDisplay;
153 
154  private: void *dummyContext;
155 #endif
156 
157  private: uint64_t dummyWindowId;
158 
160 #ifdef OGRE_OVERLAY_NEEDED
161  private: Ogre::OverlaySystem *ogreOverlaySystem;
162 #endif
163 
164  private: friend class SingletonT<OgreRenderEngine>;
165  };
166  }
167 }
168 #endif
OgreRenderPathType
Definition: OgreRenderEngine.hh:70
Plugin for loading ogre render engine.
Definition: OgreRenderEngine.hh:46
STL class.
Definition: BaseRenderEngine.hh:29
Definition: OgreRenderEngine.hh:64
Base plugin class for render engines.
Definition: RenderEnginePlugin.hh:36
STL class.
An abstract interface to a concrete render-engine. A RenderEngine is responsible for initializing a r...
Definition: RenderEngine.hh:32
Definition: ArrowVisual.hh:22