ComponentManager增加自动释放功能

This commit is contained in:
2025-06-15 00:49:23 +08:00
parent c1420e257d
commit cfda1fceb2
10 changed files with 70 additions and 48 deletions

View File

@@ -57,7 +57,7 @@ namespace hgl::graph
public:
virtual ~SceneNode()=default;
virtual ~SceneNode();
void Clear() override
{
@@ -106,8 +106,8 @@ namespace hgl::graph
public: //组件相关方法
bool ComponentIsEmpty ()const{return component_set.GetCount()==0;} ///<是否没有组件
virtual int GetComponentCount ()const{return component_set.GetCount();} ///<取得组件数量
bool ComponentIsEmpty ()const{return component_set.IsEmpty();} ///<是否没有组件
virtual const int64 GetComponentCount ()const{return component_set.GetCount();} ///<取得组件数量
virtual bool AttachComponent (Component *comp) ///<添加一个组件
{
if(!comp)return(false);

View File

@@ -1,8 +1,8 @@
#ifndef HGL_GRAPH_VULKAN_MATERIAL_INCLUDE
#define HGL_GRAPH_VULKAN_MATERIAL_INCLUDE
#pragma once
#include<hgl/graph/VK.h>
#include<hgl/type/Map.h>
#include<hgl/type/SortedSet.h>
#include<hgl/type/String.h>
#include<hgl/graph/VKShaderModuleMap.h>
#include<hgl/graph/mtl/ShaderBufferSource.h>
@@ -106,6 +106,5 @@ public:
MaterialInstance *CreateMI(const VILConfig *vil_cfg=nullptr);
};//class Material
using MaterialSets=SortedSet<Material *>;
using MaterialSet=SortedSet<Material *>;
VK_NAMESPACE_END
#endif//HGL_GRAPH_VULKAN_MATERIAL_INCLUDE

View File

@@ -2,7 +2,6 @@
#include<hgl/graph/VK.h>
#include<hgl/type/String.h>
#include<hgl/type/SortedSet.h>
VK_NAMESPACE_BEGIN
class VulkanPhyDevice

View File

@@ -1,9 +1,7 @@
#ifndef HGL_GRAPH_VULKAN_SHADER_MODULE_INCLUDE
#define HGL_GRAPH_VULKAN_SHADER_MODULE_INCLUDE
#pragma once
#include<hgl/graph/VK.h>
#include<hgl/graph/VKVertexInputLayout.h>
#include<hgl/type/SortedSet.h>
VK_NAMESPACE_BEGIN
@@ -46,4 +44,3 @@ public:
operator VkShaderModule ()const{return stage_create_info->module;}
};//class ShaderModule
VK_NAMESPACE_END
#endif//HGL_GRAPH_VULKAN_SHADER_MODULE_INCLUDE