1 /*
2 * Copyright (c) 2024 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16 #ifndef SCENE_SRC_RENDER_CONFIGURATION_H
17 #define SCENE_SRC_RENDER_CONFIGURATION_H
18
19 #include <scene/ext/ecs_lazy_property.h>
20 #include <scene/ext/intf_create_entity.h>
21 #include <scene/ext/intf_internal_scene.h>
22 #include <scene/ext/scene_property.h>
23 #include <scene/interface/intf_render_configuration.h>
24
25 #include <meta/ext/implementation_macros.h>
26 #include <meta/ext/object.h>
27 #include <meta/interface/intf_named.h>
28
SCENE_BEGIN_NAMESPACE()29 SCENE_BEGIN_NAMESPACE()
30
31 class RenderConfiguration : public META_NS::IntroduceInterfaces<EcsLazyProperty, IRenderConfiguration, ICreateEntity> {
32 META_OBJECT(RenderConfiguration, ClassId::RenderConfiguration, IntroduceInterfaces)
33 public:
34 META_BEGIN_STATIC_DATA()
35 SCENE_STATIC_DYNINIT_PROPERTY_DATA(
36 IRenderConfiguration, IEnvironment::Ptr, Environment, "RenderConfigurationComponent.environment")
37 SCENE_STATIC_PROPERTY_DATA(IRenderConfiguration, BASE_NS::string, RenderNodeGraphUri,
38 "RenderConfigurationComponent.customRenderNodeGraphFile")
39 SCENE_STATIC_PROPERTY_DATA(IRenderConfiguration, BASE_NS::string, PostRenderNodeGraphUri,
40 "RenderConfigurationComponent.customPostSceneRenderNodeGraphFile")
41 META_END_STATIC_DATA()
42
43 META_IMPLEMENT_PROPERTY(IEnvironment::Ptr, Environment)
44 META_IMPLEMENT_PROPERTY(BASE_NS::string, RenderNodeGraphUri)
45 META_IMPLEMENT_PROPERTY(BASE_NS::string, PostRenderNodeGraphUri)
46
47 bool InitDynamicProperty(const META_NS::IProperty::Ptr& p, BASE_NS::string_view path) override;
48 CORE_NS::Entity CreateEntity(const IInternalScene::Ptr& scene) override;
49 };
50 SCENE_END_NAMESPACE()
51
52 #endif