1 #ifndef DALI_GRAPHICS_FRAMEBUFFER_CREATE_INFO_H
2 #define DALI_GRAPHICS_FRAMEBUFFER_CREATE_INFO_H
5 * Copyright (c) 2021 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.
25 #include "graphics-framebuffer.h"
26 #include "graphics-types.h"
33 * @brief Interface class for FramebufferCreateInfo types in the graphics API.
35 struct FramebufferCreateInfo
38 * @brief Sets pointer to the extension
40 * The pointer to the extension must be set either to nullptr
41 * or to the valid structure. The structures may create
42 * a chain. The last structure in a chain must point at
45 * @param[in] value pointer to the valid extension structure
46 * @return reference to this structure
48 auto& SetNextExtension(ExtensionCreateInfo* value)
50 nextExtension = value;
55 * @brief Adds color attachments to the framebuffer
57 * The color attachments are provided as a list. The number
58 * of color attachments depends on the driver capability. It may be
59 * a single attachment allowed for old hardware and multiple attachments
60 * for the modern one (MRT).
62 * @param[in] value List of attachment descriptors
63 * @return reference to this structure
65 auto& SetColorAttachments(std::vector<ColorAttachment> value)
67 colorAttachments = value;
72 * @brief Adds depth/stencil attachment to the framebuffer
74 * The depth/stencil attachment may be supported only by certain (modern)
75 * hardware. The hardware capabilities should be checked before using
76 * the depth/stencil attachment.
78 * @param[in] value Depth/stencil attachment descriptor
79 * @return reference to this structure
81 auto& SetDepthStencilAttachment(DepthStencilAttachment value)
83 depthStencilAttachment = value;
88 * @brief Sets size of framebuffer
90 * @param[in] value size of framebuffer
91 * @return reference to this structure
93 auto& SetSize(Extent2D value)
100 * @brief Sets allocation callbacks which will be used when object is created
103 * @param[in] value Valid reference to AllocationCallbacksStructure
104 * @return reference to this structure
106 auto& SetAllocationCallbacks(const AllocationCallbacks& value)
108 allocationCallbacks = &value;
112 GraphicsStructureType type{GraphicsStructureType::FRAMEBUFFER_CREATE_INFO_STRUCT};
113 ExtensionCreateInfo* nextExtension{nullptr};
114 std::vector<ColorAttachment> colorAttachments{};
115 DepthStencilAttachment depthStencilAttachment{};
118 const AllocationCallbacks* allocationCallbacks{nullptr};
121 } // namespace Graphics
124 #endif // DALI_GRAPHICS_FRAMEBUFFER_CREATE_INFO_H