few codes of PrimitiveCreater, but can't run.
This commit is contained in:
parent
0a752446b0
commit
2bc6246dc0
@ -12,6 +12,7 @@ namespace hgl
|
||||
device =sdb->GetDevice();
|
||||
phy_device =device->GetPhysicalDevice();
|
||||
|
||||
vdm =nullptr;
|
||||
db =sdb;
|
||||
vil =v;
|
||||
|
||||
@ -25,12 +26,11 @@ namespace hgl
|
||||
phy_device =device->GetPhysicalDevice();
|
||||
|
||||
vdm =_vdm;
|
||||
db =nullptr;
|
||||
vil =vdm->GetVIL();
|
||||
|
||||
vertices_number =0;
|
||||
ibo =nullptr;
|
||||
|
||||
|
||||
}
|
||||
|
||||
bool PrimitiveCreater::Init(const uint32 vertex_count,const uint32 index_count,IndexType it)
|
||||
@ -40,17 +40,49 @@ namespace hgl
|
||||
vertices_number=vertex_count;
|
||||
|
||||
if(index_count>0)
|
||||
{
|
||||
if(vdm)
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if(it==IndexType::ERR)
|
||||
{
|
||||
if(vertex_count<=0xFF&&phy_device->SupportU8Index())
|
||||
it=IndexType::U8;
|
||||
else
|
||||
if(vertex_count<=0xFFFF)
|
||||
it=IndexType::U16;
|
||||
else
|
||||
if(phy_device->SupportU32Index())
|
||||
it=IndexType::U32;
|
||||
else
|
||||
return(false);
|
||||
}
|
||||
else if(it==IndexType::U8)
|
||||
{
|
||||
if(!phy_device->SupportU8Index()||vertex_count>0xFF)
|
||||
return(false);
|
||||
}
|
||||
else if(it==IndexType::U16)
|
||||
{
|
||||
if(vertex_count>0xFFFF)
|
||||
return(false);
|
||||
}
|
||||
else if(it==IndexType::U32)
|
||||
{
|
||||
if(!phy_device->SupportU32Index())
|
||||
return(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
return(false);
|
||||
}
|
||||
|
||||
ibo=db->CreateIBO(it,index_count);
|
||||
if(!ibo)return(false);
|
||||
}
|
||||
|
||||
ibo->Map();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user