Hymn to Beauty
C++ 3D Engine
TextureAsset.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4#include <glm/glm.hpp>
5
6namespace Video {
7class LowLevelRenderer;
8class Texture2D;
9}
10
13 public:
15
18 explicit TextureAsset(Video::LowLevelRenderer* lowLevelRenderer);
19
21
26 TextureAsset(Video::LowLevelRenderer* lowLevelRenderer, const char* source, int sourceLength);
27
29
34 TextureAsset(Video::LowLevelRenderer* lowLevelRenderer, const glm::uvec2& size, const glm::vec4& color);
35
38
40 void Save() const;
41
43
46 void Load(const std::string& name);
47
49
53
55 std::string name;
56
58 std::string path;
59
60 private:
61 TextureAsset(const TextureAsset& other) = delete;
62
63 Video::LowLevelRenderer* lowLevelRenderer;
64 Video::Texture2D* texture;
65};
A texture used in a hymn.
Definition: TextureAsset.hpp:12
~TextureAsset()
Destructor.
Definition: TextureAsset.cpp:24
void Save() const
Save the texture asset.
Definition: TextureAsset.cpp:28
std::string path
The folder containing the texture files.
Definition: TextureAsset.hpp:58
void Load(const std::string &name)
Load texture asset from disk.
Definition: TextureAsset.cpp:30
Video::Texture2D * GetTexture() const
Get the texture.
Definition: TextureAsset.cpp:46
TextureAsset(Video::LowLevelRenderer *lowLevelRenderer)
Create new texture asset.
Definition: TextureAsset.cpp:11
std::string name
The name of the texture.
Definition: TextureAsset.hpp:55
Low level renderer abstracting the underlaying graphics API (OpenGL or Vulkan).
Definition: LowLevelRenderer.hpp:27
A two-dimensional texture.
Definition: Texture2D.hpp:10
Definition: Editor.hpp:18