Lugdunum  0.1.0
Texture.hpp
Go to the documentation of this file.
1 #pragma once
2 
5 
6 namespace lug {
7 namespace Graphics {
8 
9 // For friend
10 namespace Builder {
11 class Texture;
12 } // Builder
13 
14 namespace Render {
15 
17  friend class ::lug::Graphics::Builder::Texture;
18 
19 public:
20  enum class Filter : uint8_t {
21  Nearest,
22  Linear
23  };
24 
25  enum class WrappingMode : uint8_t {
26  ClampToEdge,
27  MirroredRepeat,
28  Repeat
29  };
30 
31  enum class Format : uint8_t {
32  Undefined,
33  R8G8B8A8_UNORM,
34  R16G16_SFLOAT,
35  R16G16B16_SFLOAT,
36  R32G32B32A32_SFLOAT
37  };
38 
39 public:
40  Texture(const std::string& name);
41 
42  Texture(const Texture&) = delete;
43  Texture(Texture&&) = delete;
44 
45  Texture& operator=(const Texture&) = delete;
46  Texture& operator=(Texture&&) = delete;
47 
48  virtual ~Texture() = default;
49 
50  uint32_t getWidth() const;
51  uint32_t getHeight() const;
52  Render::Texture::Format getFormat() const;
53 
54  Render::Texture::Filter getMagFilter() const;
55  Render::Texture::Filter getMinFilter() const;
56  Render::Texture::Filter getMipMapFilter() const;
57  Render::Texture::WrappingMode getWrapS() const;
58  Render::Texture::WrappingMode getWrapT() const;
59 
60  static size_t formatToSize(Render::Texture::Format format);
61 
62 private:
63  uint32_t _width{0};
64  uint32_t _height{0};
66 
70 
73 };
74 
76 
77 } // Render
78 } // Graphics
79 } // lug
Render::Texture::Format _format
Definition: Texture.hpp:65
#define LUG_GRAPHICS_API
Definition: Export.hpp:11
Render::Texture::WrappingMode _wrapT
Definition: Texture.hpp:72
Render::Texture::WrappingMode _wrapS
Definition: Texture.hpp:71
Class for resource.
Definition: Resource.hpp:17
Render::Texture::Filter _mipMapFilter
Definition: Texture.hpp:69
Render::Texture::Filter _magFilter
Definition: Texture.hpp:67
Render::Texture::Filter _minFilter
Definition: Texture.hpp:68