blob: 8b6b56df7fd4d91782d5847edbe0bff852dc8433 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
#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
{
UIVertexLayout(Vector2 pos = Vector2::zero, Vector2 texCoord = Vector2::zero, Color32 col = Color32())
{
position = pos;
uv = texCoord;
color = col;
}
Vector2 position;
Vector2 uv;
Color32 color;
};
typedef uint16 UIIndex;
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;
};
|