1 #ifndef DALI_TEXTURE_SET_H
2 #define DALI_TEXTURE_SET_H
5 * Copyright (c) 2016 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 <cstddef> // std::size_t
25 #include <dali/public-api/object/handle.h> // Dali::Handle
26 #include <dali/public-api/rendering/sampler.h> // Dali::Sampler
27 #include <dali/public-api/rendering/shader.h> // Dali::Shader
28 #include <dali/public-api/rendering/texture.h> // Dali::Texture
33 namespace Internal DALI_INTERNAL
39 * @brief TextureSet is a handle to an object that specifies the set of images used as textures by a renderer.
40 * The images have to be ordered in the same order they are declared in the shader.
43 class DALI_IMPORT_API TextureSet : public BaseHandle
48 * @brief Creates a new TextureSet object.
51 * @return A handle to a newly allocated TextureSet
53 static TextureSet New();
56 * @brief Default constructor, creates an empty handle.
70 * @brief Copy constructor, creates a new handle to the same object.
73 * @param[in] handle Handle to an object
75 TextureSet( const TextureSet& handle );
78 * @brief Downcasts to a TextureSet handle.
79 * If handle is not a TextureSet, the returned handle is left uninitialized.
81 * @param[in] handle Handle to an object
82 * @return TextureSet handle or an uninitialized handle
84 static TextureSet DownCast( BaseHandle handle );
87 * @brief Assignment operator, changes this handle to point at the same object.
90 * @param[in] handle Handle to an object
91 * @return A reference to this
93 TextureSet& operator=( const TextureSet& handle );
96 * @brief Sets the texture at position "index".
99 * @param[in] index The position in the texture set of the texture
100 * @param[in] texture The texture
102 void SetTexture( size_t index, Texture texture );
105 * @brief Gets the image at position "index".
108 * @param[in] index The position in the texture set of the image
109 * @return A handle to the image at the the specified position
111 Texture GetTexture( size_t index ) const;
114 * @brief Sets the sampler to be used by the image at position "index".
117 * @param[in] index The position in the texture set of the sampler
118 * @param[in] sampler The sampler to use
120 void SetSampler( size_t index, Sampler sampler );
123 * @brief Sets the sampler to be used by the image at position "index".
126 * @param[in] index The position in the texture set of the image
127 * @return A handle to the sampler at the specified position
129 Sampler GetSampler( size_t index ) const;
132 * @brief Gets the number of textures present in the TextureSet.
135 * @return The number of textures in the TextureSet
137 size_t GetTextureCount() const;
142 * @brief The constructor.
143 * @note Not intended for application developers.
145 * @param[in] pointer A pointer to a newly allocated TextureSet
147 explicit DALI_INTERNAL TextureSet( Internal::TextureSet* pointer );
153 #endif // DALI_TEXTURE_SET_H