ordered module_list in RenderFramework
This commit is contained in:
@@ -38,6 +38,9 @@ protected:
|
||||
|
||||
ObjectList<GraphModule> module_list;
|
||||
|
||||
List<GraphModule *> per_frame_module_list;
|
||||
List<RenderModule *> render_module_list;
|
||||
|
||||
protected:
|
||||
|
||||
SwapchainModule * swapchain_module =nullptr;
|
||||
@@ -73,6 +76,12 @@ public: //module
|
||||
|
||||
module_list.Add(tm);
|
||||
|
||||
if(tm->IsPerFrame())
|
||||
per_frame_module_list.Add(tm);
|
||||
|
||||
if(tm->IsRender())
|
||||
render_module_list.Add(tm);
|
||||
|
||||
return tm;
|
||||
}
|
||||
|
||||
|
11
inc/hgl/graph/manager/MaterialManager.h
Normal file
11
inc/hgl/graph/manager/MaterialManager.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include<hgl/graph/module/GraphModule.h>
|
||||
|
||||
VK_NAMESPACE_BEGIN
|
||||
|
||||
class MaterialManager:public GraphModule
|
||||
{
|
||||
};//
|
||||
|
||||
VK_NAMESPACE_END
|
@@ -22,10 +22,10 @@ public:
|
||||
GraphModuleManager(GPUDevice *dev){device=dev;}
|
||||
~GraphModuleManager();
|
||||
|
||||
GPUDevice * GetDevice ()noexcept{return device;} ///<取得GPU设备
|
||||
VkDevice GetVkDevice ()const{return device->GetDevice();}
|
||||
const GPUPhysicalDevice * GetPhysicalDevice ()const{return device->GetPhysicalDevice();} ///<取得物理设备
|
||||
GPUDeviceAttribute *GetDeviceAttribute (){return device->GetDeviceAttribute();} ///<取得设备属性
|
||||
GPUDevice * GetDevice ()noexcept {return device;} ///<取得GPU设备
|
||||
VkDevice GetVkDevice ()const {return device->GetDevice();}
|
||||
const GPUPhysicalDevice * GetPhysicalDevice ()const {return device->GetPhysicalDevice();} ///<取得物理设备
|
||||
GPUDeviceAttribute *GetDeviceAttribute () {return device->GetDeviceAttribute();} ///<取得设备属性
|
||||
|
||||
/**
|
||||
* 获取指定名称的模块
|
||||
@@ -70,6 +70,7 @@ protected:
|
||||
|
||||
public:
|
||||
|
||||
virtual const bool IsPerFrame () {return false;} ///<是否每帧运行
|
||||
virtual const bool IsRender () {return false;} ///<是否为渲染模块
|
||||
|
||||
GraphModuleManager *GetManager () {return module_manager;} ///<取得模块管理器
|
||||
@@ -106,7 +107,6 @@ public: //回调事件
|
||||
virtual void OnResize(const VkExtent2D &){} ///<窗口大小改变
|
||||
|
||||
virtual void OnPreFrame(){} ///<帧绘制前回调
|
||||
virtual void OnExecute(const double,RenderCmdBuffer *){}
|
||||
virtual void OnPostFrame(){} ///<帧绘制后回调
|
||||
};//class GraphModule
|
||||
|
||||
|
@@ -14,7 +14,8 @@ class RenderModule:public GraphModule
|
||||
|
||||
public:
|
||||
|
||||
const bool IsRender()const noexcept{return true;}
|
||||
const bool IsPerFrame ()const noexcept{return true;} ///<每帧运行
|
||||
const bool IsRender ()const noexcept{return true;} ///<渲染模块
|
||||
|
||||
public:
|
||||
|
||||
@@ -25,7 +26,7 @@ public:
|
||||
|
||||
virtual void OnResize(const VkExtent2D &ext)override{current_extent=ext;}
|
||||
|
||||
virtual void OnExecute(const double,RenderCmdBuffer *){}
|
||||
virtual void OnFrameRender(const double,RenderCmdBuffer *)=0; ///<帧绘制回调
|
||||
};//class RenderModule
|
||||
|
||||
VK_NAMESPACE_END
|
||||
|
@@ -26,8 +26,6 @@ protected:
|
||||
public:
|
||||
|
||||
virtual void OnResize(const VkExtent2D &)override; ///<窗口大小改变
|
||||
|
||||
//virtual void OnExecute(const double,RenderCmdBuffer *);
|
||||
|
||||
public:
|
||||
|
||||
|
Reference in New Issue
Block a user