From 69b9556ca14bf870c9df45dbcde9842a476d1af5 Mon Sep 17 00:00:00 2001 From: hyzboy Date: Wed, 10 Jul 2024 00:35:57 +0800 Subject: [PATCH] moved GizmoColor/GizmoShape to Gizmo.h --- CMCore | 2 +- example/Gizmo/Gizmo.h | 25 +++++++++++++++++++++++++ example/Gizmo/GizmoResource.cpp | 32 ++++++-------------------------- 3 files changed, 32 insertions(+), 27 deletions(-) diff --git a/CMCore b/CMCore index 913bcfcf..dcbb9ed7 160000 --- a/CMCore +++ b/CMCore @@ -1 +1 @@ -Subproject commit 913bcfcfb2fbee1b0bc748e2e979e8d5c66ec09e +Subproject commit dcbb9ed7a29021cc75bfdd9fb38abaea273257b6 diff --git a/example/Gizmo/Gizmo.h b/example/Gizmo/Gizmo.h index 2f12a63d..914a5525 100644 --- a/example/Gizmo/Gizmo.h +++ b/example/Gizmo/Gizmo.h @@ -4,6 +4,31 @@ VK_NAMESPACE_BEGIN +enum class GizmoColor:uint +{ + Black=0, + White, + + Red, + Green, + Blue, + + Yellow, + + ENUM_CLASS_RANGE(Black,Yellow) +}; + +enum class GizmoShape:uint +{ + Plane=0, //平面 + Cube, //立方体 + Sphere, //球 + Cone, //圆锥 + Cylinder, //圆柱 + + ENUM_CLASS_RANGE(Plane,Cylinder) +}; + bool InitGizmoResource(GPUDevice *); void FreeGizmoResource(); diff --git a/example/Gizmo/GizmoResource.cpp b/example/Gizmo/GizmoResource.cpp index 4d2c2fdf..1aaaece6 100644 --- a/example/Gizmo/GizmoResource.cpp +++ b/example/Gizmo/GizmoResource.cpp @@ -1,4 +1,5 @@ -#include +#include"Gizmo.h" +#include #include #include #include @@ -13,35 +14,14 @@ VK_NAMESPACE_BEGIN namespace { - enum class GizmoColor:uint - { - Black=0, - White, - - Red, - Green, - Blue, - - Yellow, - - ENUM_CLASS_RANGE(Black,Yellow) - }; - static Color4f GizmoColorRGB[size_t(GizmoColor::RANGE_SIZE)]; - enum class GizmoShape:uint - { - Plane=0, //平面 - Cube, //立方体 - Sphere, //球 - Cone, //圆锥 - Cylinder, //圆柱 - - ENUM_CLASS_RANGE(Plane,Cylinder) - }; - static RenderResource * gizmo_rr =nullptr; + static Material * gizmo_mtl_line =nullptr; + static MaterialInstance * gizmo_mi_line =nullptr; + static Pipeline * gizmo_pipeline_line =nullptr; + static Material * gizmo_mtl_triangles =nullptr; static MaterialInstance * gizmo_mi_triangles[size_t(GizmoColor::RANGE_SIZE)]{}; static Pipeline * gizmo_pipeline_triangles =nullptr;