Dali 3D User Interface Engine
material.h
Go to the documentation of this file.
1 #ifndef DALI_MATERIAL_H
2 #define DALI_MATERIAL_H
3 
4 /*
5  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20 
21 // EXTERNAL INCLUDES
22 #include <cstddef> // std::size_t
23 #include <string> // std::string
24 
25 // INTERNAL INCLUDES
26 #include <dali/public-api/images/image.h> // Dali::Image
27 #include <dali/public-api/object/handle.h> // Dali::Handle
28 #include <dali/devel-api/rendering/sampler.h> // Dali::Sampler
29 #include <dali/devel-api/rendering/shader.h> // Dali::Shader
30 
31 namespace Dali
32 {
33 
34 namespace Internal DALI_INTERNAL
35 {
36 class Material;
37 }
38 
43 {
44 public:
45 
51  static Material New( Shader shader );
52 
56  Material();
57 
61  ~Material();
62 
68  Material( const Material& handle );
69 
77  static Material DownCast( BaseHandle handle );
78 
84  Material& operator=( const Material& handle );
85 
91  void SetShader( Shader& shader );
92 
98  Shader GetShader() const;
99 
108  int AddTexture( Image image, const std::string& uniformName, Sampler sampler = Sampler() );
109 
115  void RemoveTexture( size_t index );
116 
123  void SetTextureImage( size_t index, Image image );
124 
131  void SetTextureSampler( size_t index, Sampler sampler );
132 
139  Sampler GetTextureSampler( size_t index ) const;
140 
147  void SetTextureUniformName( size_t index, const std::string& uniformName );
148 
155  int GetTextureIndex( const std::string& uniformName ) const;
156 
163  Image GetTexture( const std::string& uniformName ) const;
164 
171  Image GetTexture( size_t index ) const;
172 
176  std::size_t GetNumberOfTextures() const;
177 
178 public:
184  explicit DALI_INTERNAL Material( Internal::Material* pointer );
185 };
186 
187 } //namespace Dali
188 
189 
190 
191 #endif // DALI_MATERIAL_H
Dali Docs Home
Read more about Dali