diff --git a/example/common/VulkanAppFramework.h b/example/common/VulkanAppFramework.h index aaf8443d..a9136498 100644 --- a/example/common/VulkanAppFramework.h +++ b/example/common/VulkanAppFramework.h @@ -80,7 +80,7 @@ public: virtual bool Init(int w,int h) { - clear_color.Zero(); + clear_color.Set(0,0,0,1); #ifdef _DEBUG if(!CheckStrideBytesByFormat()) @@ -211,7 +211,7 @@ public: cb->Begin(); cb->BindFramebuffer(rp,fb); - cb->SetClearColor(0,clear_color.r,clear_color.g,clear_color.b); + cb->SetClearColor(0,clear_color); cb->BeginRenderPass(); cb->BindPipeline(ri->GetPipeline()); cb->BindDescriptorSets(ri); @@ -268,7 +268,7 @@ public: cb->Begin(); cb->BindFramebuffer(sc_render_target->GetRenderPass(),sc_render_target->GetFramebuffer(index)); - cb->SetClearColor(0,clear_color.r,clear_color.g,clear_color.b); + cb->SetClearColor(0,clear_color); cb->BeginRenderPass(); rl->Render(cb); cb->EndRenderPass(); diff --git a/inc/hgl/graph/VKCommandBuffer.h b/inc/hgl/graph/VKCommandBuffer.h index eaa797d9..8356e2c0 100644 --- a/inc/hgl/graph/VKCommandBuffer.h +++ b/inc/hgl/graph/VKCommandBuffer.h @@ -60,16 +60,16 @@ public: void SetRenderArea(const VkExtent2D &); void SetViewport(const VkViewport &vp){viewport=vp;} - void SetClearColor(uint32_t index,float r,float g,float b,float a=1.0f) + void SetClearColor(uint32_t index,const Color4f &cc) { if(index>=cv_count)return; VkClearValue *cv=clear_values+index; - cv->color.float32[0]=r; - cv->color.float32[1]=g; - cv->color.float32[2]=b; - cv->color.float32[3]=a; + cv->color.float32[0]=cc.r; + cv->color.float32[1]=cc.g; + cv->color.float32[2]=cc.b; + cv->color.float32[3]=cc.a; } void SetClearDepthStencil(uint32_t index,float d=1.0f,float s=0)