raylib-cpp
C++ object-oriented wrapper library for raylib.
Loading...
Searching...
No Matches
Texture.hpp
1#ifndef RAYLIB_CPP_INCLUDE_TEXTURE_HPP_
2#define RAYLIB_CPP_INCLUDE_TEXTURE_HPP_
3
4#include "./TextureUnmanaged.hpp"
5
6namespace raylib {
14class Texture : public TextureUnmanaged {
15public:
17
21 Texture(const Texture&) = delete;
22
26 Texture& operator=(const Texture&) = delete;
27
31 Texture(Texture&& other) noexcept {
32 set(other);
33
34 other.id = 0;
35 other.width = 0;
36 other.height = 0;
37 other.mipmaps = 0;
38 other.format = 0;
39 }
40
45
49 Texture& operator=(Texture&& other) noexcept {
50 if (this == &other) {
51 return *this;
52 }
53
54 Unload();
55 set(other);
56
57 other.id = 0;
58 other.width = 0;
59 other.height = 0;
60 other.mipmaps = 0;
61 other.format = 0;
62
63 return *this;
64 }
65};
66
67// Create the Texture aliases.
68using Texture2D = Texture;
69using TextureCubemap = Texture;
70
71} // namespace raylib
72
76
77#endif // RAYLIB_CPP_INCLUDE_TEXTURE_HPP_
Texture type.
Definition: Texture.hpp:14
Texture & operator=(Texture &&other) noexcept
Move assignment.
Definition: Texture.hpp:49
Texture(Texture &&other) noexcept
Move constructor.
Definition: Texture.hpp:31
Texture(const Texture &)=delete
Explicitly forbid the copy constructor.
Texture & operator=(const Texture &)=delete
Explicitly forbid copy assignment.
~Texture()
On destruction, unload the Texture.
Definition: Texture.hpp:44
A Texture that is not managed by C++ RAII.
TextureUnmanaged()
Default texture constructor.
void Unload()
Unload texture from GPU memory (VRAM)
All raylib-cpp classes and functions appear in the raylib namespace.
Definition: AudioDevice.hpp:8