1 #ifndef DALI_TOOLKIT_PARTICLE_SYSTEM_PARTICLE_RENDERER_H
2 #define DALI_TOOLKIT_PARTICLE_SYSTEM_PARTICLE_RENDERER_H
4 * Copyright (c) 2023 Samsung Electronics Co., Ltd.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
21 #include <dali-toolkit/public-api/particle-system/particle-types.h>
24 #include <dali/public-api/object/base-handle.h>
25 #include <dali/public-api/signals/callback.h>
32 namespace Dali::Toolkit::ParticleSystem::Internal
34 class ParticleRenderer;
37 namespace Dali::Toolkit::ParticleSystem
40 * @brief Blending modes for particle renderer
42 enum class DALI_TOOLKIT_API BlendingMode
44 ADDITIVE, ///< Additive blending mode (default)
46 SCREEN ///< SCREEN mode, Advanced blending support required
49 class DALI_TOOLKIT_API ParticleRenderer : public Dali::BaseHandle
52 ParticleRenderer() = default;
55 * @brief Creates new instance of basic 2D renderer
57 * @return Valid instance of renderer
59 static ParticleRenderer New();
62 * @brief Sets blending mode for the renderer
64 * @param[in] blendingMode Valid particle blending mode to be used
66 void SetBlendingMode(BlendingMode blendingMode);
69 * @brief Sets renderable as a 2D texture (sprites)
71 * @param[in] texture Valid texture
73 void SetTexture(const Dali::Texture& texture);
76 * @brief Downcasts a handle to ParticleRenderer handle.
78 * If handle points to an ParticleRenderer object, the downcast produces valid handle.
79 * If not, the returned handle is left uninitialized.
81 * @param[in] handle to An object
82 * @return handle to a ParticleRenderer object or an uninitialized handle
84 static ParticleRenderer DownCast(BaseHandle handle);
89 * @brief This constructor is used by ParticleRenderer::New() methods.
91 * @param [in] impl A pointer to a newly allocated implementation
93 ParticleRenderer(Internal::ParticleRenderer* impl);
96 } // namespace Dali::Toolkit::ParticleSystem
98 #endif // DALI_TOOLKIT_PARTICLE_SYSTEM_PARTICLE_RENDERER_H