Doxybook2 Example
Texture.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include "Handle.hpp"
4 
5 namespace Engine {
6  namespace Graphics {
15  class Texture : protected Handle {
16  public:
17  enum class Type {
21  UNKNOWN = 0,
25  RGBA_8,
26  RGB_8,
27  RGBA_16,
28  RGB_16,
29  RGBA_32,
30  RGB_32
31  };
32 
33  explicit Texture(Type type);
34  virtual ~Texture() = default;
39  virtual int getWidth() const = 0;
44  virtual int getHeight() const = 0;
50  virtual int getDepth() const = 0;
51  inline bool isLoaded() const {
55  return loaded;
56  }
57 
58  protected:
59  bool loaded{false};
61  };
62  } // namespace Graphics
63 } // namespace Engine
Engine::Graphics::Texture::Type::RGBA_8
@ RGBA_8
Engine::Graphics::Texture::loaded
bool loaded
Definition: Texture.hpp:59
Engine::Graphics::Texture::Type::RGB_32
@ RGB_32
Engine::Graphics::Texture::Type
Type
Definition: Texture.hpp:17
Engine::Graphics::Handle
Definition: Handle.hpp:8
Engine::Graphics::Texture::getDepth
virtual int getDepth() const =0
Returns the depth of the texture in pixels.
Engine::Graphics::Texture::Type::RGBA_32
@ RGBA_32
Engine::Graphics::Texture::Texture
Texture(Type type)
Engine::Graphics::Texture::getHeight
virtual int getHeight() const =0
Returns the height of the texture in pixels.
Engine::Graphics::Texture::isLoaded
bool isLoaded() const
Definition: Texture.hpp:51
Engine::Graphics::Texture::Type::RGB_8
@ RGB_8
Engine::Graphics::Texture::Type::RGBA_16
@ RGBA_16
Engine::Graphics::Texture::Type::RGB_16
@ RGB_16
Handle.hpp
Engine::Graphics::Texture::getWidth
virtual int getWidth() const =0
Returns the width of the texture in pixels.
Engine::Graphics::Texture
This is a base texture class that serves as a base class for other texture types.
Definition: Texture.hpp:15
Engine
This namespace contains all of the necessary engine components.
Definition: Asset.hpp:5
Engine::Graphics::Texture::type
Type type
Definition: Texture.hpp:60
Engine::Graphics::Texture::~Texture
virtual ~Texture()=default
Engine::Graphics::Texture::Type::UNKNOWN
@ UNKNOWN