1 #ifndef DALI_TOOLKIT_INTERNAL_CONTROL_RENDERERS_H
2 #define DALI_TOOLKIT_INTERNAL_CONTROL_RENDERERS_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.
20 #include <dali-toolkit/internal/graphics/builtin-shader-extern-gen.h>
21 #include <dali/dali.h>
29 #define BASIC_VERTEX_SOURCE SHADER_CONTROL_RENDERERS_VERT
30 #define BASIC_FRAGMENT_SOURCE SHADER_CONTROL_RENDERERS_FRAG
33 * Helper method for rendering an image with custom shader.
34 * @param[in] vertextSrc The custom vertex shader.
35 * @param[in] fragmentSrc The custom fragment shader.
36 * @return A newly created renderer.
38 Dali::Renderer CreateRenderer(std::string_view vertexSrc, std::string_view fragmentSrc);
41 * Helper method for rendering an image with custom shader.
42 * @param[in] vertextSrc The custom vertex shader.
43 * @param[in] fragmentSrc The custom fragment shader.
44 * @param[in] gridSize The number of grid sub-divisions required.
45 * @return A newly created renderer.
47 Dali::Renderer CreateRenderer(std::string_view vertexSrc, std::string_view fragmentSrc, Dali::Shader::Hint::Value hints, Dali::Uint16Pair gridSize);
50 * Helper method for setting the first texture passed to a renderer.
51 * @param[in] renderer The renderer using the texture.
52 * @param[in] texture The texture to set.
54 void SetRendererTexture(Dali::Renderer renderer, Dali::Texture texture);
57 * Helper method for setting the first texture passed to a renderer.
58 * @param[in] renderer The renderer using the texture.
59 * @param[in] framebuffer A frame buffer color texture attached.
61 void SetRendererTexture(Dali::Renderer renderer, Dali::FrameBuffer frameBuffer);
63 } // namespace Internal
64 } // namespace Toolkit
67 #endif // DALI_TOOLKIT_INTERNAL_CONTROL_RENDERERS_H