From c10e0d92f46e5eaf25a69e1fafe5f4dbd8eaab9d Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 3 Nov 2021 09:52:26 +0800 Subject: *misc --- Runtime/GUI/UIMesh.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Runtime/GUI/UIMesh.h (limited to 'Runtime/GUI/UIMesh.h') diff --git a/Runtime/GUI/UIMesh.h b/Runtime/GUI/UIMesh.h new file mode 100644 index 0000000..dd83e6e --- /dev/null +++ b/Runtime/GUI/UIMesh.h @@ -0,0 +1,32 @@ +#pragma once + +#include "Runtime/Utilities/Exception.h" +#include "Runtime/Rendering/DynamicMesh.h" +#include "Runtime/Math/Math.h" +#include "Runtime/Utilities/StaticInitiator.h" +#include "Runtime/Graphics/CustomVertexLayout.h" +#include "Runtime/Graphics/DefaultVertexLayout.h" +#include "Runtime/Graphics/Color.h" +#include "Runtime/Graphics/GfxDevice.h" + +struct UIVertexLayout +{ + Vector2 position; + Vector2 uv; + Color32 color; +}; + +CustomException(UIMeshException); + +// 所有的UIMesh都是左上角为原点 +class UIMesh : public DynamicMesh +{ +public: + UIMesh() : DynamicMesh() {} + virtual ~UIMesh() {} + + virtual void Draw() = 0; + + static CustomVertexLayout s_UIVertexLayout; + static unsigned int s_SizePerVertex; +}; -- cgit v1.1-26-g67d0