1 #ifndef DALI_RENDERER_DEVEL_H
2 #define DALI_RENDERER_DEVEL_H
5 * Copyright (c) 2020 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.
22 #include <dali/public-api/rendering/renderer.h>
26 namespace DevelRenderer
29 * The index of render queue used by the DrawCommand
31 using RenderQueueIndex = uint32_t;
33 constexpr RenderQueueIndex RENDER_QUEUE_OPAQUE = 0; ///< Queue for opaque elements
34 constexpr RenderQueueIndex RENDER_QUEUE_TRANSPARENT = 1; ///<Queue for transparent elements
35 constexpr RenderQueueIndex RENDER_QUEUE_MAX = 2;
38 * Enum describing way of rendering the primitives (indexed draw, array draw)
47 * Draw command can be attached to the Dali::Renderer and override the default
48 * rendering functionality. Renderer may have several DrawCommands attached to it
49 * and the will be executed sequentially in the order of the 'queue' index.
53 DrawType drawType; ///< Type of drawing (indexed, array)
54 uint32_t firstIndex; ///< First index into the geometry array
55 uint32_t elementCount; ///< Number of elements to draw
56 RenderQueueIndex queue; ///< Queue index
60 * @brief Adds a draw command to the renderer
61 * Once the draw command is added, the default Renderer's behaviour is overriden.
62 * @param[in] renderer a valid Renderer object
63 * @param[in] drawCommand Valid DrawCommand to add to the Renderer
65 DALI_CORE_API void AddDrawCommand(Dali::Renderer renderer, const DrawCommand& drawCommand);
71 DEPTH_INDEX = Dali::Renderer::Property::DEPTH_INDEX,
72 FACE_CULLING_MODE = Dali::Renderer::Property::FACE_CULLING_MODE,
73 BLEND_MODE = Dali::Renderer::Property::BLEND_MODE,
74 BLEND_EQUATION_RGB = Dali::Renderer::Property::BLEND_EQUATION_RGB,
75 BLEND_EQUATION_ALPHA = Dali::Renderer::Property::BLEND_EQUATION_ALPHA,
76 BLEND_FACTOR_SRC_RGB = Dali::Renderer::Property::BLEND_FACTOR_SRC_RGB,
77 BLEND_FACTOR_DEST_RGB = Dali::Renderer::Property::BLEND_FACTOR_DEST_RGB,
78 BLEND_FACTOR_SRC_ALPHA = Dali::Renderer::Property::BLEND_FACTOR_SRC_ALPHA,
79 BLEND_FACTOR_DEST_ALPHA = Dali::Renderer::Property::BLEND_FACTOR_DEST_ALPHA,
80 BLEND_COLOR = Dali::Renderer::Property::BLEND_COLOR,
81 BLEND_PRE_MULTIPLIED_ALPHA = Dali::Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA,
82 INDEX_RANGE_FIRST = Dali::Renderer::Property::INDEX_RANGE_FIRST,
83 INDEX_RANGE_COUNT = Dali::Renderer::Property::INDEX_RANGE_COUNT,
84 DEPTH_WRITE_MODE = Dali::Renderer::Property::DEPTH_WRITE_MODE,
85 DEPTH_FUNCTION = Dali::Renderer::Property::DEPTH_FUNCTION,
86 DEPTH_TEST_MODE = Dali::Renderer::Property::DEPTH_TEST_MODE,
87 RENDER_MODE = Dali::Renderer::Property::RENDER_MODE,
88 STENCIL_FUNCTION = Dali::Renderer::Property::STENCIL_FUNCTION,
89 STENCIL_FUNCTION_MASK = Dali::Renderer::Property::STENCIL_FUNCTION_MASK,
90 STENCIL_FUNCTION_REFERENCE = Dali::Renderer::Property::STENCIL_FUNCTION_REFERENCE,
91 STENCIL_MASK = Dali::Renderer::Property::STENCIL_MASK,
92 STENCIL_OPERATION_ON_FAIL = Dali::Renderer::Property::STENCIL_OPERATION_ON_FAIL,
93 STENCIL_OPERATION_ON_Z_FAIL = Dali::Renderer::Property::STENCIL_OPERATION_ON_Z_FAIL,
94 STENCIL_OPERATION_ON_Z_PASS = Dali::Renderer::Property::STENCIL_OPERATION_ON_Z_PASS,
97 * @brief The opacity of the renderer.
98 * @details Name "opacity", type Property::FLOAT.
100 OPACITY = STENCIL_OPERATION_ON_Z_PASS + 1,
103 * @brief The rendering behavior of the renderer.
104 * @details Name "renderingBehavior", type Property::INTEGER.
106 RENDERING_BEHAVIOR = STENCIL_OPERATION_ON_Z_PASS + 2,
108 } // namespace Property
113 * @brief Enumeration for the rendering behavior
117 IF_REQUIRED, ///< Default. Will only render if required to do so.
118 CONTINUOUSLY ///< Will render continuously.
121 } // namespace Rendering
123 } // namespace DevelRenderer
127 #endif // DALI_RENDERER_DEVEL_H