renamed to AcquirePVB from CreatePVB
This commit is contained in:
parent
07a478a2ac
commit
5892b075c3
@ -38,7 +38,7 @@ namespace hgl
|
||||
|
||||
protected:
|
||||
|
||||
PrimitiveVertexBuffer *CreatePVB(const AnsiString &,const void *data); ///<创建一个顶点属性数据区
|
||||
PrimitiveVertexBuffer *AcquirePVB(const AnsiString &,const void *data); ///<请求一个顶点属性数据区
|
||||
|
||||
void ClearAllData();
|
||||
|
||||
@ -57,7 +57,7 @@ namespace hgl
|
||||
if(format!=T::GetVulkanFormat())
|
||||
return(nullptr);
|
||||
|
||||
PrimitiveVertexBuffer *pvb=this->CreatePVB(name,nullptr);
|
||||
PrimitiveVertexBuffer *pvb=this->AcquirePVB(name,nullptr);
|
||||
|
||||
if(!pvb)
|
||||
return(nullptr);
|
||||
|
@ -38,7 +38,6 @@ namespace hgl
|
||||
|
||||
access =nullptr;
|
||||
start_access=nullptr;
|
||||
|
||||
}
|
||||
|
||||
virtual ~VertexAttribDataAccess()=default;
|
||||
|
@ -24,7 +24,7 @@ namespace hgl
|
||||
return(true);
|
||||
}
|
||||
|
||||
PrimitiveCreater::PrimitiveVertexBuffer *PrimitiveCreater::CreatePVB(const AnsiString &name,const void *data)
|
||||
PrimitiveCreater::PrimitiveVertexBuffer *PrimitiveCreater::AcquirePVB(const AnsiString &name,const void *data)
|
||||
{
|
||||
if(!vil)return(nullptr);
|
||||
if(name.IsEmpty())return(nullptr);
|
||||
@ -70,7 +70,7 @@ namespace hgl
|
||||
if(vif->stride*vertices_number!=bytes)
|
||||
return(false);
|
||||
|
||||
return CreatePVB(name,data);
|
||||
return AcquirePVB(name,data);
|
||||
}
|
||||
|
||||
void PrimitiveCreater::ClearAllData()
|
||||
@ -107,6 +107,12 @@ namespace hgl
|
||||
|
||||
Primitive *primitive=db->CreatePrimitive(prim_name,vertices_number);
|
||||
|
||||
if(ibo)
|
||||
{
|
||||
ibo->Unmap();
|
||||
primitive->Set(ibo);
|
||||
}
|
||||
|
||||
const auto *sp=vbo_map.GetDataList();
|
||||
for(uint i=0;i<si_count;i++)
|
||||
{
|
||||
@ -126,12 +132,6 @@ namespace hgl
|
||||
++sp;
|
||||
}
|
||||
|
||||
if(ibo)
|
||||
{
|
||||
ibo->Unmap();
|
||||
primitive->Set(ibo);
|
||||
}
|
||||
|
||||
db->Add(primitive);
|
||||
|
||||
return primitive;
|
||||
|
Loading…
x
Reference in New Issue
Block a user