Hymn to Beauty
C++ 3D Engine
Texture2D.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <glm/glm.hpp>
4
5namespace Video {
6class Texture;
7class LowLevelRenderer;
8
10class Texture2D {
11 public:
13
18 Texture2D(LowLevelRenderer* lowLevelRenderer, const char* filename);
19
21
26 Texture2D(LowLevelRenderer* lowLevelRenderer, const char* source, int sourceLength);
27
29
34 Texture2D(LowLevelRenderer* lowLevelRenderer, const glm::uvec2& size, const glm::vec4& color);
35
37 ~Texture2D();
38
40
44
46
49 bool IsLoaded() const;
50
51 protected:
53 Texture2D();
54
55 private:
56 Texture2D(const Texture2D& other) = delete;
57
58 Texture* texture = nullptr;
59 bool loaded = false;
60};
61} // namespace Video
Low level renderer abstracting the underlaying graphics API (OpenGL or Vulkan).
Definition: LowLevelRenderer.hpp:27
A two-dimensional texture.
Definition: Texture2D.hpp:10
Texture * GetTexture()
Get the low-level texture.
Definition: Texture2D.cpp:75
bool IsLoaded() const
Get whether the texture has been loaded yet.
Definition: Texture2D.cpp:79
~Texture2D()
Destructor.
Definition: Texture2D.cpp:70
Texture2D()
Create new texture.
Definition: Texture2D.cpp:14
A texture.
Definition: Texture.hpp:8
Definition: Editor.hpp:18