RenderFramework/WorkObject增加CreateVDM函数
This commit is contained in:
@@ -78,6 +78,12 @@ namespace hgl
|
||||
|
||||
public:
|
||||
|
||||
template<typename ...ARGS>
|
||||
graph::VertexDataManager *CreateVDM(ARGS...args)
|
||||
{
|
||||
return render_framework?render_framework->CreateVDM(args...):nullptr;
|
||||
}
|
||||
|
||||
graph::Material *CreateMaterial(const AnsiString &mi_name,const graph::mtl::MaterialCreateInfo *mci)
|
||||
{
|
||||
return render_framework?render_framework->CreateMaterial(mi_name,mci):nullptr;
|
||||
|
@@ -223,6 +223,9 @@ public:
|
||||
return(new graph::PrimitiveCreater(GetDevice(),mi->GetVIL()));
|
||||
}
|
||||
|
||||
graph::VertexDataManager *CreateVDM(const graph::VIL *vil,const VkDeviceSize vertices_number,VkDeviceSize indices_number,const IndexType type=IndexType::U16);
|
||||
graph::VertexDataManager *CreateVDM(const graph::VIL *vil,const VkDeviceSize number,const IndexType type=IndexType::U16){return CreateVDM(vil,number,number,type);}
|
||||
|
||||
public: // Primitive, Mesh
|
||||
|
||||
graph::Primitive *CreatePrimitive(const AnsiString &name,
|
||||
|
@@ -14,6 +14,7 @@
|
||||
#include<hgl/graph/FirstPersonCameraControl.h>
|
||||
#include<hgl/graph/Renderer.h>
|
||||
#include<hgl/graph/mtl/UBOCommon.h>
|
||||
#include<hgl/graph/VertexDataManager.h>
|
||||
#include<hgl/log/Logger.h>
|
||||
#include<hgl/Time.h>
|
||||
|
||||
@@ -196,10 +197,29 @@ void RenderFramework::Tick()
|
||||
}
|
||||
}
|
||||
|
||||
graph::VertexDataManager *RenderFramework::CreateVDM(const graph::VIL *vil,const VkDeviceSize vertices_number,VkDeviceSize indices_number,const IndexType type)
|
||||
{
|
||||
if(!vil||vertices_number<=0||indices_number<=0||!device->IsSupport(type))
|
||||
return(nullptr);
|
||||
|
||||
auto *vdm=new VertexDataManager(device,vil);
|
||||
|
||||
if(!vdm)
|
||||
return(nullptr);
|
||||
|
||||
if(!vdm->Init(vertices_number,indices_number,type))
|
||||
{
|
||||
delete vdm;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return vdm;
|
||||
}
|
||||
|
||||
graph::Primitive *RenderFramework::CreatePrimitive( const AnsiString &name,
|
||||
const uint32_t vertices_count,
|
||||
const graph::VIL *vil,
|
||||
const std::initializer_list<graph::VertexAttribDataPtr> &vad_list)
|
||||
const uint32_t vertices_count,
|
||||
const graph::VIL *vil,
|
||||
const std::initializer_list<graph::VertexAttribDataPtr> &vad_list)
|
||||
{
|
||||
auto *pc=new graph::PrimitiveCreater(GetDevice(),vil);
|
||||
|
||||
|
Reference in New Issue
Block a user