mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 20:11:50 +00:00
Reuse image data instead of fetching it every time off the GPU
This commit is contained in:
parent
8a8c1525fd
commit
0b6ba2faee
5 changed files with 29 additions and 16 deletions
|
|
@ -15,11 +15,15 @@ namespace gui {
|
|||
|
||||
void draw(const DrawContext& pctx, const Assets& assets) override;
|
||||
|
||||
[[nodiscard]] std::shared_ptr<::Texture> texture() const {
|
||||
[[nodiscard]] auto texture() const {
|
||||
return mTexture;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto data() const {
|
||||
return mData;
|
||||
}
|
||||
private:
|
||||
std::shared_ptr<::Texture> mTexture;
|
||||
std::unique_ptr<ImageData> mData;
|
||||
std::shared_ptr<ImageData> mData;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue