Ocean
GIWindowFramebuffer.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_WINDOW_BITMAP_H
9 #define META_OCEAN_RENDERING_GI_WINDOW_BITMAP_H
10 
13 
15 
16 namespace Ocean
17 {
18 
19 namespace Rendering
20 {
21 
22 namespace GlobalIllumination
23 {
24 
25 /**
26  * This class is the base class for all GlobalIllumination window framebuffers.
27  * @ingroup renderinggi
28  */
29 class OCEAN_RENDERING_GI_EXPORT GIWindowFramebuffer :
30  virtual public GIFramebuffer,
31  virtual public WindowFramebuffer
32 {
33  friend class GIEngine;
34 
35  public:
36 
37  /**
38  * Returns the platform dependent framebuffer base id or handle.
39  * @see Framebuffer::id().
40  */
41  size_t id() const override;
42 
43  /**
44  * Sets the platform dependent framebuffer base id or handle.
45  * @see Frambuffer::initializeById().
46  */
47  bool initializeById(const size_t id, const FramebufferRef& shareFramebuffer) override;
48 
49  /**
50  * Returns the global lighting mode of the entire framebuffer.
51  * @see Framebuffer::lightingMode().
52  */
53  LightingMode lightingMode() const override;
54 
55  /**
56  * Returns the shadow technique of the entire framebuffer.
57  * @see Framebuffer::shadowTechnique().
58  */
59  ShadowTechnique shadowTechnique() const override;
60 
61  /**
62  * Sets the global lighting mode of the entire framebuffer.
63  * @see Framebuffer::setLightingMode().
64  */
65  void setLightingMode(const LightingMode lightingMode) override;
66 
67  /**
68  * Sets the shadow technique of the entire framebuffer.
69  * @see Framebuffer::setShadowTechnique().
70  */
71  void setShadowTechnique(const ShadowTechnique technique) override;
72 
73  /**
74  * Renders the next frame into the framebuffer.
75  * @see Framebuffer::render().
76  */
77  void render() override;
78 
79  protected:
80 
81  /**
82  * Creates a new Global Illumination window framebuffer.
83  * @param preferredGraphicAPI Preferred graphic API to be used for this framebuffer
84  */
85  explicit GIWindowFramebuffer(const Engine::GraphicAPI preferredGraphicAPI = Engine::API_DEFAULT);
86 
87  /**
88  * Destructs a Global Illumination window framebuffer.
89  */
91 
92  /**
93  * Releases the framebuffer.
94  * @see Framebuffer::release().
95  */
96  void release() override;
97 
98  protected:
99 
100 #if defined(_WINDOWS)
101 
102  /// Handle of this window.
104 
105  /// Device context of this window.
106  HDC windowDC;
107 
108 #elif defined(__APPLE__)
109 
110  /// The view object of this window.
111  void* windowView;
112 
113 #endif
114 
115 };
116 
117 }
118 
119 }
120 
121 }
122 
123 #endif // META_OCEAN_RENDERING_GI_WINDOW_BITMAP_H
GraphicAPI
Definition of different graphic APIs.
Definition: Engine.h:57
@ API_DEFAULT
Invalid graphic api id.
Definition: Engine.h:59
ShadowTechnique
Definition of different shadow techniques.
Definition: rendering/Framebuffer.h:83
Global Illumination engine class.
Definition: GIEngine.h:32
This class implements a base for all Global Illumination framebuffers.
Definition: GIFramebuffer.h:39
This class is the base class for all GlobalIllumination window framebuffers.
Definition: GIWindowFramebuffer.h:32
GIWindowFramebuffer(const Engine::GraphicAPI preferredGraphicAPI=Engine::API_DEFAULT)
Creates a new Global Illumination window framebuffer.
size_t id() const override
Returns the platform dependent framebuffer base id or handle.
HWND windowHandle
Handle of this window.
Definition: GIWindowFramebuffer.h:103
HDC windowDC
Device context of this window.
Definition: GIWindowFramebuffer.h:106
bool initializeById(const size_t id, const FramebufferRef &shareFramebuffer) override
Sets the platform dependent framebuffer base id or handle.
void render() override
Renders the next frame into the framebuffer.
LightingMode lightingMode() const override
Returns the global lighting mode of the entire framebuffer.
~GIWindowFramebuffer() override
Destructs a Global Illumination window framebuffer.
ShadowTechnique shadowTechnique() const override
Returns the shadow technique of the entire framebuffer.
void setShadowTechnique(const ShadowTechnique technique) override
Sets the shadow technique of the entire framebuffer.
void * windowView
The view object of this window.
Definition: GIWindowFramebuffer.h:111
void release() override
Releases the framebuffer.
void setLightingMode(const LightingMode lightingMode) override
Sets the global lighting mode of the entire framebuffer.
LightingMode
Definition of different lighting modes.
Definition: PrimitiveAttribute.h:74
This class is the base class for all window framebuffers.
Definition: rendering/WindowFramebuffer.h:55
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15