Hymn to Beauty
C++ 3D Engine
Texture.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <glm/glm.hpp>
4
5namespace Video {
6
8class Texture {
9 public:
11 enum class Type {
12 COLOR,
15 };
16
18 enum class Format {
19 R8,
20 R8G8B8A8,
21 R11G11B10,
23 D32
24 };
25
27
32 Texture(Type type, const glm::uvec2& size, Format format);
33
35 virtual ~Texture() {}
36
38
41 Type GetType() const {
42 return type;
43 }
44
46
49 const glm::uvec2& GetSize() const {
50 return size;
51 }
52
54
57 Format GetFormat() const {
58 return format;
59 }
60
62
65 uint64_t GetUniqueIdentifier() const;
66
67 private:
68 Texture(const Texture& other) = delete;
69
70 Type type;
71 Format format;
72 glm::uvec2 size;
73 uint64_t uniqueIdentifier;
74};
75
76}
A texture.
Definition: Texture.hpp:8
Format
The format of the texture.
Definition: Texture.hpp:18
@ R8G8B8A8
8-bit RGBA color format.
@ R11G11B10
HDR RGB color format.
@ R16G16B16A16
HDR RGBA color format.
@ D32
32-bit depth format.
@ R8
8-bit single channel color format.
Type GetType() const
Get the type of texture.
Definition: Texture.hpp:41
uint64_t GetUniqueIdentifier() const
Get a unique identifier.
Definition: Texture.cpp:15
Texture(Type type, const glm::uvec2 &size, Format format)
Create a new texture.
Definition: Texture.cpp:8
const glm::uvec2 & GetSize() const
Get the size of the texture.
Definition: Texture.hpp:49
virtual ~Texture()
Destructor.
Definition: Texture.hpp:35
Type
The type of texture.
Definition: Texture.hpp:11
@ COLOR
A sampled color texture.
@ RENDER_DEPTH
A depth texture that can be rendered to.
@ RENDER_COLOR
A color texture that can be rendered to.
Format GetFormat() const
Get the format of the texture.
Definition: Texture.hpp:57
Definition: Editor.hpp:18