载入中...
搜索中...
未找到
Batcher.h
浏览该文件的文档.
1#pragma once
2
3#include "graphics/Canvas.h"
4#include <vector>
5#include <glm/glm.hpp>
6
7namespace eve::graphics {
8
9class Texture;
10
13 glm::vec2 pos;
14 glm::vec4 color;
15 glm::vec2 uv;
16};
17
22class Batcher {
23public:
24 void clear();
25 void addRect(float x, float y, float w, float h, const Color &color);
26 void addRectRotated(float cx, float cy, float w, float h, float degrees, const Color &color);
27 void addTexturedRect(float x, float y, float w, float h, const Color &color,
28 float u0, float v0, float u1, float v1,
29 bool rotatedUV = false);
31 void addTexturedRectRotated(float cx, float cy, float w, float h, float degrees,
32 const Color &color, float u0, float v0, float u1, float v1,
33 bool rotatedUV = false);
34 const std::vector<BatchVertex> &vertices() const { return verts; }
35 bool empty() const { return verts.empty(); }
36
39 void toNDC(int logicalW, int logicalH);
40
41private:
42 std::vector<BatchVertex> verts;
43};
44
45} // namespace eve::graphics
float cx
Definition CardTypes.cpp:31
float cy
Definition CardTypes.cpp:32
float degrees
Definition CardTypes.cpp:33
int y
Definition Grass.cpp:135
int x
Definition Grass.cpp:135
int h
int w
image::ImageData::Colorf color
Accumulates solid / textured quads in logical (Y-down) coordinates. Used by RenderSystem; not a publi...
Definition Batcher.h:22
void addRect(float x, float y, float w, float h, const Color &color)
Definition Batcher.cpp:10
void addRectRotated(float cx, float cy, float w, float h, float degrees, const Color &color)
Definition Batcher.cpp:80
void addTexturedRect(float x, float y, float w, float h, const Color &color, float u0, float v0, float u1, float v1, bool rotatedUV=false)
Definition Batcher.cpp:14
bool empty() const
Definition Batcher.h:35
void addTexturedRectRotated(float cx, float cy, float w, float h, float degrees, const Color &color, float u0, float v0, float u1, float v1, bool rotatedUV=false)
Textured quad rotated degrees (clockwise, screen Y-down) around (cx, cy).
Definition Batcher.cpp:41
void toNDC(int logicalW, int logicalH)
Definition Batcher.cpp:108
const std::vector< BatchVertex > & vertices() const
Definition Batcher.h:34
卡牌游戏 UI 工具模块:工厂 + 脚本绑定入口。 功能参考 ycarowr/UiCard:扇形手牌布局、抽牌/洗牌、悬浮放大、拖拽到落牌区、 敌方手牌(背面/偷看)、费用不足置灰,以及可实时调节的布局...
Definition AnimTrail.h:6
glm::vec4 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:12