renamed values.

This commit is contained in:
hyzboy 2024-04-21 01:28:45 +08:00
parent 0b1a0cadae
commit f0c47cd4f1
4 changed files with 8 additions and 8 deletions

View File

@ -117,8 +117,8 @@ public: //Buffer相关
VBO * CreateVBO (VkFormat format, uint32_t count,const void *data, SharingMode sm=SharingMode::Exclusive); VBO * CreateVBO (VkFormat format, uint32_t count,const void *data, SharingMode sm=SharingMode::Exclusive);
VBO * CreateVBO (VkFormat format, uint32_t count, SharingMode sm=SharingMode::Exclusive){return CreateVBO(format,count,nullptr,sm);} VBO * CreateVBO (VkFormat format, uint32_t count, SharingMode sm=SharingMode::Exclusive){return CreateVBO(format,count,nullptr,sm);}
const IndexType GetIndexType(const VkDeviceSize &vertex_count)const; ///<求一个合适的索引类型 const IndexType ChooseIndexType (const VkDeviceSize &vertex_count)const; ///<求一个合适的索引类型
const bool CheckIndexType(const IndexType,const VkDeviceSize &vertex_count)const; ///<检测一个索引类型是否合适 const bool CheckIndexType (const IndexType,const VkDeviceSize &vertex_count)const; ///<检测一个索引类型是否合适
IndexBuffer * CreateIBO (IndexType type, uint32_t count,const void * data, SharingMode sm=SharingMode::Exclusive); IndexBuffer * CreateIBO (IndexType type, uint32_t count,const void * data, SharingMode sm=SharingMode::Exclusive);
IndexBuffer * CreateIBO8 ( uint32_t count,const void * data, SharingMode sm=SharingMode::Exclusive){return CreateIBO(IndexType::U8, count,(void *)data,sm);} IndexBuffer * CreateIBO8 ( uint32_t count,const void * data, SharingMode sm=SharingMode::Exclusive){return CreateIBO(IndexType::U8, count,(void *)data,sm);}

View File

@ -177,13 +177,13 @@ namespace hgl
const float bottom=float(pgci->grid_size.Height())/2.0f; const float bottom=float(pgci->grid_size.Height())/2.0f;
const float top =-bottom; const float top =-bottom;
for(int row=0;row<=pgci->grid_size.Height();row++) for(uint row=0;row<=pgci->grid_size.Height();row++)
{ {
vertex->WriteLine( Vector3f(left ,top+row,0), vertex->WriteLine( Vector3f(left ,top+row,0),
Vector3f(right,top+row,0)); Vector3f(right,top+row,0));
} }
for(int col=0;col<=pgci->grid_size.Width();col++) for(uint col=0;col<=pgci->grid_size.Width();col++)
{ {
vertex->WriteLine(Vector3f(left+col,top, 0), vertex->WriteLine(Vector3f(left+col,top, 0),
Vector3f(left+col,bottom,0)); Vector3f(left+col,bottom,0));
@ -192,7 +192,7 @@ namespace hgl
AutoDelete<VB1f> lum=rc.AccessVBO<VB1f>(VAN::Luminance); AutoDelete<VB1f> lum=rc.AccessVBO<VB1f>(VAN::Luminance);
if(lum) if(lum)
{ {
for(int row=0;row<=pgci->grid_size.Height();row++) for(uint row=0;row<=pgci->grid_size.Height();row++)
{ {
if((row%pgci->sub_count.Height())==0) if((row%pgci->sub_count.Height())==0)
lum->RepeatWrite(pgci->sub_lum,2); lum->RepeatWrite(pgci->sub_lum,2);
@ -200,7 +200,7 @@ namespace hgl
lum->RepeatWrite(pgci->lum,2); lum->RepeatWrite(pgci->lum,2);
} }
for(int col=0;col<=pgci->grid_size.Width();col++) for(uint col=0;col<=pgci->grid_size.Width();col++)
{ {
if((col%pgci->sub_count.Width())==0) if((col%pgci->sub_count.Width())==0)
lum->RepeatWrite(pgci->sub_lum,2); lum->RepeatWrite(pgci->sub_lum,2);

View File

@ -64,7 +64,7 @@ namespace hgl
{ {
if(it==IndexType::AUTO) if(it==IndexType::AUTO)
{ {
it=device->GetIndexType(vertex_count); it=device->ChooseIndexType(vertex_count);
if(!IsIndexType(it)) if(!IsIndexType(it))
return(false); return(false);

View File

@ -77,7 +77,7 @@ VBO *GPUDevice::CreateVBO(VkFormat format,uint32_t count,const void *data,Sharin
return(new VertexAttribBuffer(attr->device,buf,format,stride,count)); return(new VertexAttribBuffer(attr->device,buf,format,stride,count));
} }
const IndexType GPUDevice::GetIndexType(const VkDeviceSize &vertex_count)const const IndexType GPUDevice::ChooseIndexType(const VkDeviceSize &vertex_count)const
{ {
if(vertex_count<=0)return(IndexType::ERR); if(vertex_count<=0)return(IndexType::ERR);