2 * Copyright (c) 2023 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-scene3d/public-api/model-components/material.h>
22 #include <dali/integration-api/debug.h>
23 #include <dali/public-api/rendering/sampler.h>
26 #include <dali-scene3d/internal/model-components/material-impl.h>
32 Material Material::New()
34 Internal::MaterialPtr internal = Internal::Material::New();
36 return Material(internal.Get());
43 Material::Material(const Material& mateiral) = default;
45 Material::Material(Material&& rhs) noexcept = default;
51 Material& Material::operator=(const Material& handle) = default;
53 Material& Material::operator=(Material&& rhs) noexcept = default;
55 Material Material::DownCast(BaseHandle handle)
57 return Material(dynamic_cast<Dali::Scene3D::Internal::Material*>(handle.GetObjectPtr()));
60 Material::Material(Dali::Scene3D::Internal::Material* internal)
61 : BaseHandle(internal)
67 void Material::SetProperty(Dali::Property::Index index, Dali::Property::Value propertyValue)
69 GetImplementation(*this).SetProperty(index, propertyValue);
72 Dali::Property::Value Material::GetProperty(Dali::Property::Index index) const
74 return GetImplementation(*this).GetProperty(index);
77 void Material::SetTexture(Scene3D::Material::TextureType index, Dali::Texture texture)
79 GetImplementation(*this).SetTexture(index, texture);
82 Dali::Texture Material::GetTexture(Scene3D::Material::TextureType index)
84 return GetImplementation(*this).GetTexture(index);
87 void Material::SetSampler(Scene3D::Material::TextureType index, Dali::Sampler sampler)
89 GetImplementation(*this).SetSampler(index, sampler);
92 Dali::Sampler Material::GetSampler(Scene3D::Material::TextureType index)
94 return GetImplementation(*this).GetSampler(index);
97 } // namespace Scene3D