载入中...
搜索中...
未找到
StyleRecipe.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
5#include <memory>
6#include <string>
7#include <vector>
8
9namespace eve::graphics {
10class Canvas;
11class Graphics;
12class Texture;
13} // namespace eve::graphics
14
15namespace eve::stylize {
16
17class StyleInstance;
18class StylePass;
19
27public:
29 StyleRecipe() = default;
32
33 StyleRecipe(const StyleRecipe&) = delete;
35
37 void clear();
39 void add(StyleInstance* instance);
41 int getStyleCount() const { return int(instances_.size()); }
43 StyleInstance* getStyle(int index) const;
44
46 void compile(graphics::Graphics* gfx);
48 bool isCompiled() const { return compiled_; }
50 std::string getStage() const { return stage_; }
51
55 void applyCanvas(graphics::Graphics* gfx, graphics::Canvas* source, graphics::Canvas* dest);
56
57private:
58 void ensureScratch(graphics::Graphics* gfx, graphics::Canvas* dest);
59
60 std::vector<StyleInstance*> instances_;
61 std::vector<std::unique_ptr<StylePass>> passes_;
62 graphics::Graphics* graphics_ = nullptr;
63 graphics::Canvas* scratch_ = nullptr;
64 int scratchWidth_ = 0;
65 int scratchHeight_ = 0;
66 std::string stage_;
67 bool compiled_ = false;
68};
69
70} // namespace eve::stylize
#define EVENGINE_API_WORLD
Definition Export.h:109
uint32_t index
const UnitySourceAsset & source
Canvas public API.
Definition Canvas.h:17
GPU texture created via Graphics::newTexture. Owns GPU resources through an opaque backend handle.
Definition Texture.h:18
Mutable parameter instance of an immutable built-in style definition.
Compilable recipe of style instances sharing one pipeline stage.
Definition StyleRecipe.h:26
std::string getStage() const
Returns the stage.
Definition StyleRecipe.h:50
int getStyleCount() const
Returns the style count.
Definition StyleRecipe.h:41
StyleRecipe(const StyleRecipe &)=delete
~StyleRecipe()
Style recipe.
StyleRecipe()=default
Style recipe.
bool isCompiled() const
True when compiled.
Definition StyleRecipe.h:48
StyleRecipe & operator=(const StyleRecipe &)=delete
卡牌游戏 UI 工具模块:工厂 + 脚本绑定入口。 功能参考 ycarowr/UiCard:扇形手牌布局、抽牌/洗牌、悬浮放大、拖拽到落牌区、 敌方手牌(背面/偷看)、费用不足置灰,以及可实时调节的布局...
Definition Animation.h:25