2 * Copyright (c) 2016 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include <dali/devel-api/rendering/texture-set.h> // Dali::TextureSet
22 #include <dali/internal/event/rendering/texture-set-impl.h> // Dali::Internal::TextureSet
23 #include <dali/internal/event/rendering/sampler-impl.h> // Dali::Internal::Sampler
24 #include <dali/internal/event/rendering/shader-impl.h> // Dali::Internal::Shader
29 TextureSet TextureSet::New()
31 Internal::TextureSetPtr textureSet = Internal::TextureSet::New();
32 return TextureSet( textureSet.Get() );
35 TextureSet::TextureSet()
39 TextureSet::~TextureSet()
43 TextureSet::TextureSet( const TextureSet& handle )
44 : BaseHandle( handle )
48 TextureSet TextureSet::DownCast( BaseHandle handle )
50 return TextureSet( dynamic_cast<Dali::Internal::TextureSet*>(handle.GetObjectPtr()));
53 TextureSet& TextureSet::operator=( const TextureSet& handle )
55 BaseHandle::operator=( handle );
59 void TextureSet::SetImage( size_t index, Image image )
63 Internal::ImagePtr imagePtr( &GetImplementation( image ) );
64 GetImplementation(*this).SetImage( index, imagePtr );
68 GetImplementation(*this).SetImage( index, NULL );
72 Image TextureSet::GetImage( size_t index ) const
74 Internal::Image* imagePtr = GetImplementation(*this).GetImage( index );
75 return Dali::Image( imagePtr );
78 void TextureSet::SetSampler( size_t index, Sampler sampler )
82 Internal::SamplerPtr samplerPtr( &GetImplementation( sampler ) );
83 GetImplementation(*this).SetSampler( index, samplerPtr );
87 GetImplementation(*this).SetSampler( index, NULL );
91 Sampler TextureSet::GetSampler( size_t index ) const
93 Internal::Sampler* samplerPtr = GetImplementation(*this).GetSampler( index );
94 return Dali::Sampler( samplerPtr );
97 size_t TextureSet::GetTextureCount() const
99 return GetImplementation(*this).GetTextureCount();
102 TextureSet::TextureSet( Internal::TextureSet* pointer )
103 : BaseHandle( pointer )