载入中...
搜索中...
未找到
Texture.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4#include "graphics/Drawable.h"
6
7namespace eve::graphics {
8
9class Graphics;
10
16public:
20 ~Texture() override;
21
23 void draw(Graphics* gfx, const glm::mat4& matrix) const override;
25 void drawOcclusion(Graphics* gfx, const glm::mat4& matrix) const override;
26
28 int getWidth() const;
30 int getHeight() const;
32 int getPixelWidth() const;
34 int getPixelHeight() const;
36 int getMipmapCount() const;
38 const TextureSampler& getSampler() const { return sampler; }
44 void setAlphaConvention(const char* value);
51 const char* getAlphaConvention() const;
53 bool hasPremultipliedAlpha() const { return premultipliedAlpha_; }
54
56 void* gpuHandle = nullptr;
57
58 int width = 0;
59 int height = 0;
60 int depth = 1;
61 int layers = 1;
62 int mipmapCount = 1;
63 int pixelWidth = 0;
64 int pixelHeight = 0;
66
68 void markDeferredFilePixels(Graphics* graphics);
70 void clearDeferredFilePixels();
72 bool hasDeferredFilePixels() const { return filePixelsPending_; }
73
74private:
75 void realizeFilePixelsIfNeeded() const;
76 Graphics* graphics_ = nullptr;
77 bool filePixelsPending_ = false;
78 bool premultipliedAlpha_ = false;
79};
80
81} // namespace eve::graphics
#define EVENGINE_API_BACKENDS
Definition Export.h:108
vk::UniqueSampler sampler
std::uint32_t height
std::uint32_t width
MeshVfxBatchedDraw draw
Object::Ptr value
glm::dmat4 matrix
Graphics * graphics
std::uint32_t depth
Drawable base (textures, meshes, canvases).
Definition Drawable.h:18
GPU texture created via Graphics::newTexture. Owns GPU resources through an opaque backend handle.
Definition Texture.h:15
bool hasDeferredFilePixels() const
True when deferred file pixels.
Definition Texture.h:72
const TextureSampler & getSampler() const
Returns the sampler.
Definition Texture.h:38
bool hasPremultipliedAlpha() const
True when premultiplied alpha.
Definition Texture.h:53
卡牌游戏 UI 工具模块:工厂 + 脚本绑定入口。 功能参考 ycarowr/UiCard:扇形手牌布局、抽牌/洗牌、悬浮放大、拖拽到落牌区、 敌方手牌(背面/偷看)、费用不足置灰,以及可实时调节的布局...
Definition Animation.h:25
Sampler state for a Texture (filter, wrap, mip LOD, anisotropy). Defaults match historical engine beh...