|
Flint Engine
Modular C++20 2D game engine powered by SDL3
|
Owns an SDL_Texture loaded from memory or created as a render target. More...
#include <flint/graphics/texture.h>
Collaboration diagram for Flint::Texture:Public Member Functions | |
| Texture (const Texture &)=delete | |
| Texture & | operator= (const Texture &)=delete |
| Texture (Texture &&other) noexcept | |
Move constructor; transfers SDL_Texture ownership from the other. | |
| Texture & | operator= (Texture &&other) noexcept |
Move-assignment; releases current texture then steals from the other. | |
| bool | loadFromMemory (SDL_Renderer *renderer, const void *data, size_t size) |
| Load a texture from an in-memory image file. | |
| void | free () |
| SDL_Texture * | getSDLTexture () const |
| Return the underlying SDL_Texture handle. | |
| int | getWidth () const |
| Return the texture width in pixels. | |
| int | getHeight () const |
| Return the texture height in pixels. | |
| bool | createRenderTarget (SDL_Renderer *renderer, int width, int height) |
| Create a render-target texture of the given dimensions. | |
Static Public Member Functions | |
| static Texture | fromRenderer (SDL_Renderer *renderer, int width, int height) |
Owns an SDL_Texture loaded from memory or created as a render target.