diff --git a/inc/hgl/graph/VKDevice.h b/inc/hgl/graph/VKDevice.h index 802437e4..55aed076 100644 --- a/inc/hgl/graph/VKDevice.h +++ b/inc/hgl/graph/VKDevice.h @@ -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, SharingMode sm=SharingMode::Exclusive){return CreateVBO(format,count,nullptr,sm);} - const IndexType GetIndexType(const VkDeviceSize &vertex_count)const; ///<求一个合适的索引类型 - const bool CheckIndexType(const IndexType,const VkDeviceSize &vertex_count)const; ///<检测一个索引类型是否合适 + const IndexType ChooseIndexType (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 * CreateIBO8 ( uint32_t count,const void * data, SharingMode sm=SharingMode::Exclusive){return CreateIBO(IndexType::U8, count,(void *)data,sm);} diff --git a/src/SceneGraph/InlineGeometry.cpp b/src/SceneGraph/InlineGeometry.cpp index 1437ea9a..644c679a 100644 --- a/src/SceneGraph/InlineGeometry.cpp +++ b/src/SceneGraph/InlineGeometry.cpp @@ -177,13 +177,13 @@ namespace hgl const float bottom=float(pgci->grid_size.Height())/2.0f; 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), 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), Vector3f(left+col,bottom,0)); @@ -192,7 +192,7 @@ namespace hgl AutoDelete lum=rc.AccessVBO(VAN::Luminance); 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) lum->RepeatWrite(pgci->sub_lum,2); @@ -200,7 +200,7 @@ namespace hgl 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) lum->RepeatWrite(pgci->sub_lum,2); diff --git a/src/SceneGraph/PrimitiveCreater.cpp b/src/SceneGraph/PrimitiveCreater.cpp index 1fe5885b..6676523e 100644 --- a/src/SceneGraph/PrimitiveCreater.cpp +++ b/src/SceneGraph/PrimitiveCreater.cpp @@ -64,7 +64,7 @@ namespace hgl { if(it==IndexType::AUTO) { - it=device->GetIndexType(vertex_count); + it=device->ChooseIndexType(vertex_count); if(!IsIndexType(it)) return(false); diff --git a/src/SceneGraph/Vulkan/VKDeviceBuffer.cpp b/src/SceneGraph/Vulkan/VKDeviceBuffer.cpp index d41ff1b3..6c8c3c61 100644 --- a/src/SceneGraph/Vulkan/VKDeviceBuffer.cpp +++ b/src/SceneGraph/Vulkan/VKDeviceBuffer.cpp @@ -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)); } -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);