1 #ifndef DALI_RENDERER_H
2 #define DALI_RENDERER_H
5 * Copyright (c) 2015 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 <string> // std::string
25 #include <dali/public-api/object/handle.h> // Dali::Handle
26 #include <dali/public-api/object/property-index-ranges.h> // DEFAULT_DERIVED_HANDLE_PROPERTY_START_INDEX
27 #include <dali/devel-api/rendering/geometry.h> // Dali::Geometry
28 #include <dali/devel-api/rendering/material.h> // Dali::Material
33 namespace Internal DALI_INTERNAL
39 * @brief Renderer is a handle to an object that can be used to provide an image to a material.
41 class DALI_IMPORT_API Renderer : public Handle
46 * @brief An enumeration of properties belonging to the Renderer class.
52 DEPTH_INDEX = DEFAULT_OBJECT_PROPERTY_START_INDEX, ///< name "depthIndex", type INTEGER
57 * @brief Creates a new Renderer object
59 * @param[in] geometry Geometry to be used by this renderer
60 * @param[in] material Material to be used by this renderer
62 static Renderer New( Geometry& geometry, Material& material );
65 * @brief Default constructor, creates an empty handle
75 * @brief Copy constructor, creates a new handle to the same object
77 * @param[in] handle Handle to an object
79 Renderer( const Renderer& handle );
82 * @brief Downcast to a renderer handle.
84 * If not a renderer the returned renderer handle is left uninitialized.
85 * @param[in] handle to an object
86 * @return renderer handle or an uninitialized handle
88 static Renderer DownCast( BaseHandle handle );
91 * @brief Assignment operator, changes this handle to point at the same object
93 * @param[in] handle Handle to an object
94 * @return Reference to the assigned object
96 Renderer& operator=( const Renderer& handle );
99 * @brief Sets the geometry to be used by this renderer
101 * @param[in] geometry The geometry to be used by this renderer
103 void SetGeometry( Geometry& geometry );
106 * @brief Gets the geometry used by this renderer
108 * @return The geometry used by the renderer
110 Geometry GetGeometry() const;
113 * @brief Sets the material to be used by this renderer
115 * @param[in] material The material to be used by this renderer
117 void SetMaterial( Material& material );
120 * @brief Gets the material used by this renderer
122 * @return The material used by the renderer
124 Material GetMaterial() const;
127 * @brief Set the depth index of this renderer
129 * Renderer with higher depth indices are rendered in front of other renderers with smaller values
131 * @param[in] depthIndex The depth index of this renderer
133 void SetDepthIndex( int depthIndex );
135 //@todo No interface to remove geometry / material? I guess you have to throw away
136 // this renderer if you don't want it to work any more...
139 * @brief Get the depth index of this renderer
141 * @sa SetDepthIndex()
142 * @return the depth index
148 * @brief The constructor
150 * @param [in] pointer A pointer to a newly allocated Renderer
152 explicit DALI_INTERNAL Renderer( Internal::Renderer* pointer );
157 #endif // DALI_RENDERER_H