2 * Copyright (c) 2015 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/renderer.h> // Dali::Renderer
22 #include <dali/internal/event/rendering/renderer-impl.h> // Dali::Internal::Renderer
27 Renderer Renderer::New( Geometry& geometry, Material& material )
29 Internal::RendererPtr renderer = Internal::Renderer::New( );
30 renderer->SetGeometry( GetImplementation(geometry) );
31 renderer->SetMaterial( GetImplementation(material) );
32 return Renderer( renderer.Get() );
43 Renderer::Renderer( const Renderer& handle )
48 Renderer Renderer::DownCast( BaseHandle handle )
50 return Renderer( dynamic_cast<Dali::Internal::Renderer*>(handle.GetObjectPtr()));
53 Renderer& Renderer::operator=( const Renderer& handle )
55 BaseHandle::operator=( handle );
59 void Renderer::SetGeometry( Geometry& geometry )
61 DALI_ASSERT_ALWAYS( geometry && "Geometry handle not initialized" );
62 GetImplementation(*this).SetGeometry( GetImplementation(geometry) );
65 Geometry Renderer::GetGeometry() const
67 Internal::Geometry* geometryPtr( GetImplementation(*this).GetGeometry() );
68 return Dali::Geometry( geometryPtr );
71 void Renderer::SetMaterial( Material& material )
73 DALI_ASSERT_ALWAYS( material && "Material handle not initialized" );
74 GetImplementation(*this).SetMaterial( GetImplementation(material) );
77 Material Renderer::GetMaterial() const
79 Internal::Material* materialPtr( GetImplementation(*this).GetMaterial() );
80 return Dali::Material( materialPtr );
83 void Renderer::SetDepthIndex( int depthIndex )
85 GetImplementation(*this).SetDepthIndex( depthIndex );
88 int Renderer::GetDepthIndex()
90 return GetImplementation(*this).GetDepthIndex();
93 Renderer::Renderer( Internal::Renderer* pointer )