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