From d17dc3125a8ec4b4b82d5b62ba9abe581ede15e0 Mon Sep 17 00:00:00 2001 From: hyzboy Date: Thu, 24 Feb 2022 21:06:20 +0800 Subject: [PATCH] change RoundBox example --- example/2dVector/roundbox.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/example/2dVector/roundbox.cpp b/example/2dVector/roundbox.cpp index 9c198ab6..c245cf6a 100644 --- a/example/2dVector/roundbox.cpp +++ b/example/2dVector/roundbox.cpp @@ -6,8 +6,8 @@ using namespace hgl; using namespace hgl::graph; -constexpr uint32_t SCREEN_WIDTH=1280; -constexpr uint32_t SCREEN_HEIGHT=720; +constexpr uint32_t SCREEN_WIDTH=256; +constexpr uint32_t SCREEN_HEIGHT=256; constexpr uint32_t VERTEX_COUNT=1; @@ -22,7 +22,7 @@ struct RoundedBoxConfig Color4f Color; Color4f InColor; Color4f OutColor; - float Radius[4]; + float Radius[4]; //bottom-right,top-right,bottom-left,top-left float LineWidth; }; @@ -102,7 +102,6 @@ private: } { - MaterialParameters *mp_value=material_instance->GetMP(DescriptorSetsType::Value); if(!mp_value) @@ -111,8 +110,11 @@ private: rb_config.Color.Set(1,1,1,1); rb_config.OutColor.Set(0,0,0,0); rb_config.InColor.Use(COLOR::MozillaOrange,1.0); - hgl_set(rb_config.Radius,8.0f,4); - rb_config.LineWidth=0; + rb_config.Radius[0]=0; + rb_config.Radius[1]=16; + rb_config.Radius[2]=0; + rb_config.Radius[3]=16; + rb_config.LineWidth=1.5; ubo_rb_config =db->CreateUBO(sizeof(RoundedBoxConfig), &rb_config);