Ocean
GIEngine.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Meta Platforms, Inc. and affiliates.
3  *
4  * This source code is licensed under the MIT license found in the
5  * LICENSE file in the root directory of this source tree.
6  */
7 
8 #ifndef META_OCEAN_RENDERING_GI_ENGINE_H
9 #define META_OCEAN_RENDERING_GI_ENGINE_H
10 
13 
14 #include "ocean/rendering/Engine.h"
15 
16 #include <map>
17 
18 namespace Ocean
19 {
20 
21 namespace Rendering
22 {
23 
24 namespace GlobalIllumination
25 {
26 
27 /**
28  * Global Illumination engine class.
29  * @ingroup renderinggi
30  */
31 class OCEAN_RENDERING_GI_EXPORT GIEngine : public Engine
32 {
33  friend class GIFramebuffer;
34  friend class GIWindowFramebuffer;
35  friend class GIObject;
36 
37  public:
38 
39  /**
40  * Creates this engine and registeres it at the global engine manager.<br>
41  * Do not register this engine if using it as plugin, because it's done by the plugin itself.<br>
42  * However, if your not using the plugin mechanism you have to initialize this engine once at program initialization.<br>
43  * If the library is not used anymore unregister it using the unregister function.<br>
44  * Beware: This registration must not be done more than once!<br>
45  * @see Manager, unregisterEngine()
46  */
47  static void registerEngine();
48 
49  /**
50  * Unregisters this engine at the global engine manager.
51  * Do not unregister this engine if using it as plugin, because it's done by the plugin itself when the plugin is unloaded.<br>
52  * Beware: This registration must not be done more than once and must not be done without previous registration!<br>
53  * @return True, if succeeded
54  */
55  static bool unregisterEngine();
56 
57  private:
58 
59  /**
60  * Creates a new rendering engine.
61  * @param preferredGraphicAPI Preferred graphic API to use by the engine
62  */
63  GIEngine(const GraphicAPI preferredGraphicAPI);
64 
65  /**
66  * Destructs a rendering engine.
67  */
68  ~GIEngine() override;
69 
70  /**
71  * Creates a new Global Illumination rendering engine.
72  * @param graphicAPI Preferred graphic API to use by the engine
73  * @return New rendering engine
74  */
75  static Engine* createEngine(const GraphicAPI graphicAPI);
76 
77  /**
78  * Returns the factory of this rendering engine.
79  * @see Engine::factory().
80  */
81  const Factory& factory() const override;
82 
83  /**
84  * Returns the specific type of this engine.
85  * @see Engine::engineId().
86  */
87  const std::string& engineName() const override;
88 
89  /**
90  * Returns a new framebuffer of this render engine.
91  * @see Engine::internalCreateFramebuffer().
92  */
94 
95  private:
96 
97  /// Global Illumiatino object factory.
99 
100  /// Name of this engine.
101  std::string engineLocalName;
102 };
103 
104 }
105 
106 }
107 
108 }
109 
110 #endif // META_OCEAN_RENDERING_GI_ENGINE_H
This class is the base class for all rendering engines like.
Definition: Engine.h:46
GraphicAPI
Definition of different graphic APIs.
Definition: Engine.h:57
This class implements a node and object factory.
Definition: rendering/Factory.h:30
This class holds framebuffer configurations.
Definition: rendering/Framebuffer.h:94
This class is the base class for all rendering framebuffers.
Definition: rendering/Framebuffer.h:48
FramebufferType
Definition of different framebuffer types.
Definition: rendering/Framebuffer.h:55
Global Illumination engine class.
Definition: GIEngine.h:32
const std::string & engineName() const override
Returns the specific type of this engine.
static Engine * createEngine(const GraphicAPI graphicAPI)
Creates a new Global Illumination rendering engine.
const Factory & factory() const override
Returns the factory of this rendering engine.
~GIEngine() override
Destructs a rendering engine.
Framebuffer * internalCreateFramebuffer(const Framebuffer::FramebufferType type, const Framebuffer::FramebufferConfig &config) override
Returns a new framebuffer of this render engine.
GIEngine(const GraphicAPI preferredGraphicAPI)
Creates a new rendering engine.
std::string engineLocalName
Name of this engine.
Definition: GIEngine.h:101
static bool unregisterEngine()
Unregisters this engine at the global engine manager.
static void registerEngine()
Creates this engine and registeres it at the global engine manager.
GIFactory engineFactory
Global Illumiatino object factory.
Definition: GIEngine.h:98
This class implements a class factory for all Global Illumination objects.
Definition: GIFactory.h:30
This class implements a base for all Global Illumination framebuffers.
Definition: GIFramebuffer.h:39
This class is the base class for all Global Illumination objects.
Definition: GIObject.h:29
This class is the base class for all GlobalIllumination window framebuffers.
Definition: GIWindowFramebuffer.h:32
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15