Support multiple window rendering
[platform/core/uifw/dali-core.git] / dali / internal / render / renderers / render-frame-buffer.h
1 #ifndef DALI_INTERNAL_RENDER_FRAME_BUFFER_H
2 #define DALI_INTERNAL_RENDER_FRAME_BUFFER_H
3
4 /*
5  * Copyright (c) 2019 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19
20 // INTERNAL INCLUDES
21 #include <dali/public-api/rendering/frame-buffer.h>
22 #include <dali/internal/render/gl-resources/context.h>
23 #include <dali/internal/render/renderers/render-sampler.h>
24 #include <dali/integration-api/gl-defines.h>
25
26 namespace Dali
27 {
28 namespace Internal
29 {
30 namespace Render
31 {
32
33 class FrameBuffer
34 {
35 public:
36
37   /**
38    * Constructor
39    */
40   FrameBuffer() {};
41
42   /**
43    * Destructor
44    */
45   virtual ~FrameBuffer() {};
46
47   /**
48    * Creates a FrameBuffer object in the GPU.
49    * @param[in] context The GL context
50    */
51   virtual void Initialize( Context& context ) = 0;
52
53   /**
54    * Deletes the framebuffer object from the GPU
55    * @param[in] context The GL context
56    */
57   virtual void Destroy( Context& context ) = 0;
58
59   /**
60    * Called by RenderManager to inform the framebuffer that the context has been destroyed
61    */
62   virtual void GlContextDestroyed() = 0;
63
64   /**
65    * @brief Bind the framebuffer
66    * @param[in] context The GL context
67    */
68   virtual void Bind( Context& context ) = 0;
69
70   /**
71    * @brief Get the width of the FrameBuffer
72    * @return The width of the framebuffer
73    */
74   virtual uint32_t GetWidth() const = 0;
75
76   /**
77    * @brief Get the height of the FrameBuffer
78    * @return The height of the framebuffer
79    */
80   virtual uint32_t GetHeight() const = 0;
81
82   /**
83    * @brief Check whether the FrameBuffer is backed by a render surface
84    * @return True if the FrameBuffer is backed by a render surface
85    */
86   virtual bool IsSurfaceBacked() = 0;
87
88 private:
89
90   /**
91    * @brief Undefined copy constructor. FrameBuffer cannot be copied
92    */
93   FrameBuffer( const FrameBuffer& rhs ) = delete;
94
95   /**
96    * @brief Undefined assignment operator. FrameBuffer cannot be copied
97    */
98   FrameBuffer& operator=( const FrameBuffer& rhs ) = delete;
99
100 };
101
102 } // namespace Render
103
104 } // namespace Internal
105
106 } // namespace Dali
107
108
109 #endif // DALI_INTERNAL_RENDER_FRAME_BUFFER_H