1 #ifndef DALI_INTERNAL_RENDER_FRAME_BUFFER_H
2 #define DALI_INTERNAL_RENDER_FRAME_BUFFER_H
5 * Copyright (c) 2017 Samsung Electronics Co., Ltd.
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
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>
40 * @param[in] width The width of the FrameBuffer
41 * @param[in] height The height of the FrameBuffer
42 * @param[in] attachments The attachments comprising the format of the FrameBuffer (bit-mask)
44 FrameBuffer( unsigned int width, unsigned int height, unsigned int attachments );
52 * Creates a FrameBuffer object in the GPU.
53 * @param[in] context The GL context
55 void Initialize(Context& context);
58 * Deletes the framebuffer object from the GPU
59 * @param[in] context The GL context
61 void Destroy( Context& context );
64 * Called by RenderManager to inform the framebuffer that the context has been destroyed
66 void GlContextDestroyed();
69 * @brief Attach a texture for color rendering. Valid only for Framebuffers with COLOR attachments.
70 * param[in] context The GL context
71 * @param[in] texture The texture that will be used as output when rendering
72 * @param[in] mipmapLevel The mipmap of the texture to be attached
73 * @param[in] layer Indicates which layer of a cube map or array texture to attach. Unused for 2D textures
75 void AttachColorTexture( Context& context, Render::Texture* texture, unsigned int mipmapLevel, unsigned int layer );
78 * @brief Bind the framebuffer
79 * @param[in] context The GL context
81 void Bind( Context& context );
84 * @brief Get the width of the FrameBuffer
85 * @return The width of the framebuffer
87 unsigned int GetWidth() const;
90 * @brief Get the height of the FrameBuffer
91 * @return The height of the framebuffer
93 unsigned int GetHeight() const;
99 GLuint mStencilBuffer;
101 unsigned int mHeight;
105 } // namespace Render
107 } // namespace Internal
112 #endif // DALI_INTERNAL_RENDER_FRAME_BUFFER_H