ULRE/inc/hgl/graph/RenderFramework.h

122 lines
3.0 KiB
C
Raw Normal View History

2024-10-19 13:08:05 +08:00
#pragma once
#include<hgl/graph/BlendMode.h>
2024-10-19 13:08:05 +08:00
#include<hgl/type/List.h>
#include<hgl/graph/ViewportInfo.h>
VK_NAMESPACE_BEGIN
class GraphModule;
2024-11-05 00:04:36 +08:00
class TileData;
class TileFont;
class FontSource;
//
///**
// * 渲染模块工作配置
// */
//class GraphModuleWorkConfig
//{
// /**
// * 渲染模块名称
// * 在render_module为nullptr时用于创建或加载RenderModule。
// * 它和RenderModule返回的名称有可能一样但也有可能不一样。
// */
// AnsiString render_module_name;
// GraphModule *render_module=nullptr;
//
// BlendMode blend_mode;
// RenderOrder render_order;
//
//public:
//
// const AnsiString &GetModuleName()const{return render_module_name;} ///<取得渲染模块名称
//
// GraphModule *GetModule(){return render_module;} ///<取得渲染模块
//
//public:
//
// GraphModuleWorkConfig();
// virtual ~GraphModuleWorkConfig()=default;
//};//class GraphModuleWorkConfig
2024-10-19 13:08:05 +08:00
2024-10-29 00:50:15 +08:00
class Window;
2024-11-05 00:04:36 +08:00
class VulkanInstance;
class TextureManager;
2024-10-29 00:50:15 +08:00
class SwapchainModule;
2024-10-29 02:25:45 +08:00
struct RenderFrameworkInitConfig
{
};//struct RenderFrameworkInitConfig
2024-10-19 13:08:05 +08:00
/**
*
*/
class RenderFramework
{
protected:
2024-10-29 00:50:15 +08:00
Window * win =nullptr;
VulkanInstance * inst =nullptr;
2024-10-19 13:08:05 +08:00
2024-10-29 00:50:15 +08:00
GPUDevice * device =nullptr;
2024-10-19 13:08:05 +08:00
protected:
GraphModuleManager *graph_module_manager=nullptr;
ObjectList<GraphModule> module_list;
TextureManager * texture_manager =nullptr;
2024-10-29 00:50:15 +08:00
SwapchainModule * swapchain_module =nullptr;
2024-10-19 13:08:05 +08:00
2024-10-29 00:50:15 +08:00
protected:
2024-10-19 13:08:05 +08:00
2024-10-29 00:50:15 +08:00
ViewportInfo viewport_info;
2024-10-19 13:08:05 +08:00
private:
double last_time =0;
double cur_time =0;
2024-10-19 13:08:05 +08:00
uint64 frame_count =0;
public:
const uint64 GetFrameCount ()const noexcept{return frame_count;} ///<取得当前帧数
void RestartFrameCount ()noexcept{frame_count=0;} ///<重新开始统计帧数
public:
NO_COPY_NO_MOVE(RenderFramework)
2024-10-29 02:25:45 +08:00
RenderFramework();
virtual ~RenderFramework();
virtual bool Init();
2024-10-19 13:08:05 +08:00
virtual void StartTime();
2024-10-19 13:08:05 +08:00
/**
* @pragma delta_time
*/
virtual void Update(const double delta_time){}
virtual void BeginFrame(){}; ///<开始当前帧
virtual void EndFrame(){}; ///<当前帧结束
virtual void MainLoop(); ///<主循环
2024-11-05 00:04:36 +08:00
public: //TileData
TileData *CreateTileData(const VkFormat video_format,const uint width,const uint height,const uint count); ///<创建一个Tile数据集
TileFont *CreateTileFont(FontSource *fs,int limit_count=-1); ///<创建一个Tile字体
2024-10-19 13:08:05 +08:00
};//class RenderFramework
VK_NAMESPACE_END