From 0a9d2af2d2e14f96f28a4e4069f9c4e236275160 Mon Sep 17 00:00:00 2001 From: "HuYingzhuo(hugo/hyzboy)" Date: Thu, 30 Jun 2022 18:34:03 +0800 Subject: [PATCH] used 4 values instead of arrays; --- example/2dVector/roundbox.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/example/2dVector/roundbox.cpp b/example/2dVector/roundbox.cpp index 7700c09a..45536e1b 100644 --- a/example/2dVector/roundbox.cpp +++ b/example/2dVector/roundbox.cpp @@ -22,7 +22,13 @@ struct RoundedBoxConfig Color4f Color; Color4f InColor; Color4f OutColor; - float Radius[4]; //bottom-right,top-right,bottom-left,top-left + struct + { + float bottom_right; + float top_right; + float bottom_left; + float top_left; + }radius; float LineWidth; }; @@ -110,11 +116,11 @@ private: rb_config.Color.Set(1,1,1,1); rb_config.OutColor.Set(0,0,0,0); rb_config.InColor=GetColor4f(COLOR::MozillaOrange,1.0); - rb_config.Radius[0]=0; - rb_config.Radius[1]=16; - rb_config.Radius[2]=0; - rb_config.Radius[3]=16; - rb_config.LineWidth=2; + rb_config.radius.bottom_left=8; + rb_config.radius.bottom_right=8; + rb_config.radius.top_left=8; + rb_config.radius.top_right=8; + rb_config.LineWidth=1.5; ubo_rb_config =db->CreateUBO(sizeof(RoundedBoxConfig), &rb_config);