Dali 3D User Interface Engine
renderer.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17 
18 // CLASS HEADER
19 #include <dali/devel-api/rendering/renderer.h> // Dali::Renderer
20 
21 // INTERNAL INCLUDES
22 #include <dali/internal/event/rendering/renderer-impl.h> // Dali::Internal::Renderer
23 
24 namespace Dali
25 {
26 
27 Renderer Renderer::New( Geometry& geometry, Material& material )
28 {
30  renderer->SetGeometry( GetImplementation(geometry) );
31  renderer->SetMaterial( GetImplementation(material) );
32  return Renderer( renderer.Get() );
33 }
34 
36 {
37 }
38 
40 {
41 }
42 
43 Renderer::Renderer( const Renderer& handle )
44 : Handle( handle )
45 {
46 }
47 
49 {
50  return Renderer( dynamic_cast<Dali::Internal::Renderer*>(handle.GetObjectPtr()));
51 }
52 
54 {
55  BaseHandle::operator=( handle );
56  return *this;
57 }
58 
60 {
61  DALI_ASSERT_ALWAYS( geometry && "Geometry handle not initialized" );
62  GetImplementation(*this).SetGeometry( GetImplementation(geometry) );
63 }
64 
66 {
67  Internal::Geometry* geometryPtr( GetImplementation(*this).GetGeometry() );
68  return Dali::Geometry( geometryPtr );
69 }
70 
72 {
73  DALI_ASSERT_ALWAYS( material && "Material handle not initialized" );
74  GetImplementation(*this).SetMaterial( GetImplementation(material) );
75 }
76 
78 {
79  Internal::Material* materialPtr( GetImplementation(*this).GetMaterial() );
80  return Dali::Material( materialPtr );
81 }
82 
84  BlendingFactor::Type destFactorRgba )
85 {
86  GetImplementation(*this).SetBlendFunc( srcFactorRgba, destFactorRgba );
87 }
88 
90  BlendingFactor::Type destFactorRgb,
91  BlendingFactor::Type srcFactorAlpha,
92  BlendingFactor::Type destFactorAlpha )
93 {
94  GetImplementation(*this).SetBlendFunc( srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha );
95 }
96 
98  BlendingFactor::Type& destFactorRgb,
99  BlendingFactor::Type& srcFactorAlpha,
100  BlendingFactor::Type& destFactorAlpha ) const
101 {
102  GetImplementation(*this).GetBlendFunc( srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha );
103 }
104 
106 {
107  GetImplementation(*this).SetBlendEquation( equationRgba );
108 }
109 
111  BlendingEquation::Type equationAlpha )
112 {
113  GetImplementation(*this).SetBlendEquation( equationRgb, equationAlpha );
114 }
115 
117  BlendingEquation::Type& equationAlpha ) const
118 {
119  GetImplementation(*this).GetBlendEquation( equationRgb, equationAlpha );
120 }
121 
123 : Handle( pointer )
124 {
125 }
126 
127 } //namespace Dali
Dali Docs Home
Read more about Dali