载入中...
搜索中...
未找到
Batcher.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
5#include "graphics/Canvas.h"
6#include <vector>
7#include <glm/glm.hpp>
8
9namespace eve::graphics {
10
11class Texture;
12
15 glm::vec2 pos;
16 glm::vec4 color;
17 glm::vec2 uv;
18};
19
25public:
27 void clear();
29 void addRect(float x, float y, float w, float h, const Color &color);
31 void addTriangle(glm::vec2 a, glm::vec2 b, glm::vec2 c, const Color &color);
33 void addTriangle(glm::vec2 a, glm::vec2 b, glm::vec2 c, const Color &colorA, const Color &colorB,
34 const Color &colorC);
36 void addRectRotated(float cx, float cy, float w, float h, float degrees, const Color &color);
38 void addTexturedRect(float x, float y, float w, float h, const Color &color,
39 float u0, float v0, float u1, float v1,
40 bool rotatedUV = false);
42 void addTexturedRectRotated(float cx, float cy, float w, float h, float degrees,
43 const Color &color, float u0, float v0, float u1, float v1,
44 bool rotatedUV = false);
46 const std::vector<BatchVertex> &vertices() const { return verts; }
48 bool empty() const { return verts.empty(); }
49
53 void toNDC(int logicalW, int logicalH);
54
55private:
56 std::vector<BatchVertex> verts;
57};
58
59} // namespace eve::graphics
float w
Definition AnimClip.cpp:738
float y
Definition AnimClip.cpp:738
float x
Definition AnimClip.cpp:738
std::vector< std::uint32_t > verts
Definition Builder.cpp:27
float cx
Definition CardTypes.cpp:33
float cy
Definition CardTypes.cpp:34
float degrees
Definition CardTypes.cpp:35
#define EVENGINE_API_BACKENDS
Definition Export.h:108
std::int32_t c
int h
MeleePoint3 b
Definition MeleeHit.cpp:41
MeleePoint3 a
Definition MeleeHit.cpp:40
Accumulates solid / textured quads in logical (Y-down) coordinates. Used by RenderSystem; not a publi...
Definition Batcher.h:24
bool empty() const
Empty.
Definition Batcher.h:48
const std::vector< BatchVertex > & vertices() const
Vertices.
Definition Batcher.h:46
卡牌游戏 UI 工具模块:工厂 + 脚本绑定入口。 功能参考 ycarowr/UiCard:扇形手牌布局、抽牌/洗牌、悬浮放大、拖拽到落牌区、 敌方手牌(背面/偷看)、费用不足置灰,以及可实时调节的布局...
Definition Animation.h:25
eve::Color Color
RGBA color used by every graphics draw call. Lives inside eve::graphics so including a graphics heade...
Definition Color.h:13
CPU-side vertex for 2D batching (logical or NDC depending on stage).
Definition Batcher.h:14
glm::vec4 color