载入中...
搜索中...
未找到
Batcher.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3#include "graphics/Color.h"
4
5#include <vector>
6#include <glm/glm.hpp>
7
8namespace eve::graphics {
9
10class Texture;
11
14 glm::vec2 pos;
15 glm::vec4 color;
16 glm::vec2 uv;
17};
18
24public:
26 void clear();
28 void addRect(float x, float y, float w, float h, const Color &color);
30 void addTriangle(glm::vec2 a, glm::vec2 b, glm::vec2 c, const Color &color);
32 void addTriangle(glm::vec2 a, glm::vec2 b, glm::vec2 c, const Color &colorA, const Color &colorB,
33 const Color &colorC);
35 void addRectRotated(float cx, float cy, float w, float h, float degrees, const Color &color);
37 void addTexturedRect(float x, float y, float w, float h, const Color &color,
38 float u0, float v0, float u1, float v1,
39 bool rotatedUV = false);
41 void addTexturedRectRotated(float cx, float cy, float w, float h, float degrees,
42 const Color &color, float u0, float v0, float u1, float v1,
43 bool rotatedUV = false);
45 const std::vector<BatchVertex> &vertices() const { return verts; }
47 bool empty() const { return verts.empty(); }
48
52 void toNDC(int logicalW, int logicalH);
53
54private:
55 std::vector<BatchVertex> verts;
56};
57
58} // namespace eve::graphics
double y
double x
float w
Definition AnimClip.cpp:738
std::vector< std::uint32_t > verts
Definition Builder.cpp:27
float cx
Definition CardTypes.cpp:36
float cy
Definition CardTypes.cpp:37
float degrees
Definition CardTypes.cpp:38
#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:23
bool empty() const
Empty.
Definition Batcher.h:47
const std::vector< BatchVertex > & vertices() const
Vertices.
Definition Batcher.h:45
卡牌游戏 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:13
glm::vec4 color