mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-13 06:51:51 +00:00
Add canvas UI node
This commit is contained in:
parent
cb960ceaad
commit
ee31f401aa
12 changed files with 279 additions and 2 deletions
25
src/graphics/ui/elements/Canvas.hpp
Normal file
25
src/graphics/ui/elements/Canvas.hpp
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
#pragma once
|
||||
|
||||
#include "UINode.hpp"
|
||||
#include "graphics/core/ImageData.hpp"
|
||||
#include "graphics/core/Texture.hpp"
|
||||
|
||||
class Texture;
|
||||
|
||||
namespace gui {
|
||||
class Canvas final : public UINode {
|
||||
public:
|
||||
explicit Canvas(ImageFormat inFormat, glm::uvec2 inSize);
|
||||
|
||||
~Canvas() override = default;
|
||||
|
||||
void draw(const DrawContext& pctx, const Assets& assets) override;
|
||||
|
||||
[[nodiscard]] std::shared_ptr<::Texture> texture() const {
|
||||
return mTexture;
|
||||
}
|
||||
private:
|
||||
std::shared_ptr<::Texture> mTexture;
|
||||
std::unique_ptr<ImageData> mData;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue