• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 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 #if !defined(API_3D_ECS_COMPONENTS_GRAPHICS_STATE_COMPONENT_H) || defined(IMPLEMENT_MANAGER)
17 #define API_3D_ECS_COMPONENTS_GRAPHICS_STATE_COMPONENT_H
18 
19 #if !defined(IMPLEMENT_MANAGER)
20 #include <3d/namespace.h>
21 #include <base/containers/string.h>
22 #include <core/ecs/component_struct_macros.h>
23 #include <core/ecs/intf_component_manager.h>
24 #include <core/property/scoped_handle.h>
25 #include <render/device/pipeline_state_desc.h>
26 
27 CORE3D_BEGIN_NAMESPACE()
28 #endif
29 /**
30  * Graphics state component simplifies changes to the graphics states. Entity owning the component can be assigned as a
31  * MaterialComponent's graphics state.
32  */
33 BEGIN_COMPONENT(IGraphicsStateComponentManager, GraphicsStateComponent)
34 
35     /** Graphics state.
36      */
37     DEFINE_PROPERTY(RENDER_NS::GraphicsState, graphicsState, "Graphics State", 0, VALUE())
38 
39     /** Render slot in which the state will be used. If empty default material render slot will be used.
40      */
41     DEFINE_PROPERTY(BASE_NS::string, renderSlot, "Render Slot", 0, VALUE())
42 
43 END_COMPONENT(IGraphicsStateComponentManager, GraphicsStateComponent, "6c1c672f-162b-4ae1-95d5-2be474ef835c")
44 #if !defined(IMPLEMENT_MANAGER)
45 CORE3D_END_NAMESPACE()
46 #endif
47 #endif // API_3D_ECS_COMPONENTS_GRAPHICS_STATE_COMPONENT_H
48