MCPcopy Create free account
hub / github.com/RobLoach/raylib-cpp / Texture

Class Texture

include/Texture.hpp:14–90  ·  view source on GitHub ↗

* Texture type * * The texture will be unloaded on object destruction. Use raylib::TextureUnmanaged if you're looking to not unload. * * @see raylib::TextureUnmanaged */

Source from the content-addressed store, hash-verified

12 * @see raylib::TextureUnmanaged
13 */
14class Texture : public TextureUnmanaged {
15public:
16 using TextureUnmanaged::TextureUnmanaged;
17
18 /**
19 * Explicitly forbid the copy constructor.
20 */
21 Texture(const Texture&) = delete;
22
23 /**
24 * Explicitly forbid copy assignment.
25 */
26 Texture& operator=(const Texture&) = delete;
27
28 /**
29 * Move constructor.
30 */
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
41 /**
42 * On destruction, unload the Texture.
43 */
44 ~Texture() { Unload(); }
45
46 /**
47 * Move assignment.
48 */
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 * Unload previous texture, then load texture from image data
68 */
69 void Load(const ::Image& image) {
70 Unload();
71 TextureUnmanaged::Load(image);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected