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/geometry/geometry.h> // Dali::Geometry
26 #include <dali/public-api/object/handle.h> // Dali::Handle
27 #include <dali/public-api/object/property-index-ranges.h> // DEFAULT_DERIVED_HANDLE_PROPERTY_START_INDEX
28 #include <dali/public-api/shader-effects/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 "depth-index", 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 Sets the material to be used by this renderer
108 * @param[in] material The material to be used by this renderer
110 void SetMaterial( Material& material );
113 * @brief Set the depth index of this renderer
115 * Renderer with higher depth indices are rendered in front of other renderers with smaller values
117 * @param[in] depthIndex The depth index of this renderer
119 void SetDepthIndex( int depthIndex );
121 //@todo No interface to remove geometry / material? I guess you have to throw away
122 // this renderer if you don't want it to work any more...
125 * @brief Get the depth index of this renderer
127 * @sa SetDepthIndex()
128 * @return the depth index
130 int GetCurrentDepthIndex();
134 * @brief The constructor
136 * @param [in] pointer A pointer to a newly allocated Renderer
138 explicit DALI_INTERNAL Renderer( Internal::Renderer* pointer );
143 #endif // DALI_RENDERER_H