* RenderTexture type, for texture rendering. * * The render texture will be unloaded on object destruction. Use raylib::RenderTextureUnmanaged * if you're looking to not unload. * * @see raylib::RenderTextureUnmanaged */
| 13 | * @see raylib::RenderTextureUnmanaged |
| 14 | */ |
| 15 | class RenderTexture : public RenderTextureUnmanaged { |
| 16 | public: |
| 17 | using RenderTextureUnmanaged::RenderTextureUnmanaged; |
| 18 | |
| 19 | RenderTexture(const RenderTexture&) = delete; |
| 20 | RenderTexture& operator=(const RenderTexture&) = delete; |
| 21 | |
| 22 | RenderTexture(RenderTexture&& other) noexcept { |
| 23 | set(other); |
| 24 | other.id = 0; |
| 25 | other.texture = {}; |
| 26 | other.depth = {}; |
| 27 | } |
| 28 | |
| 29 | RenderTexture& operator=(RenderTexture&& other) noexcept { |
| 30 | if (this == &other) { |
| 31 | return *this; |
| 32 | } |
| 33 | Unload(); |
| 34 | set(other); |
| 35 | other.id = 0; |
| 36 | other.texture = {}; |
| 37 | other.depth = {}; |
| 38 | return *this; |
| 39 | } |
| 40 | |
| 41 | RenderTexture& operator=(const ::RenderTexture& other) { |
| 42 | Unload(); |
| 43 | set(other); |
| 44 | return *this; |
| 45 | } |
| 46 | |
| 47 | ~RenderTexture() { Unload(); } |
| 48 | |
| 49 | /** |
| 50 | * Unload previous render texture, then load a new one. |
| 51 | */ |
| 52 | void Load(int width, int height) { |
| 53 | Unload(); |
| 54 | RenderTextureUnmanaged::Load(width, height); |
| 55 | } |
| 56 | }; |
| 57 | |
| 58 | using RenderTexture2D = RenderTexture; |
| 59 |
nothing calls this directly
no outgoing calls
no test coverage detected