SDL3pp
A slim C++ wrapper for SDL3
|
Handle to an owned texture. More...
Public Member Functions | |
constexpr | Texture (SDL_Texture *resource={}) |
Constructs from the underlying resource. | |
constexpr | Texture (const Texture &other)=delete |
constexpr | Texture (Texture &&other)=default |
Move constructor. | |
~Texture () | |
Frees up resource when object goes out of scope. | |
Texture & | operator= (Texture other) |
Assignment operator. | |
constexpr | TextureRef (const TextureRef &other) |
Copy constructor. | |
constexpr | TextureRef (TextureRef &&other) |
Move constructor. | |
![]() | |
constexpr | TextureRef (const TextureRef &other) |
Copy constructor. | |
constexpr | TextureRef (TextureRef &&other) |
Move constructor. | |
constexpr | ~TextureRef ()=default |
Default constructor. | |
TextureRef & | operator= (TextureRef other) |
Assignment operator. | |
void | reset (SDL_Texture *newResource={}) |
Destroy the specified texture. | |
TextureBase (RendererBase &renderer, StringParam file) | |
Load an image from a filesystem path into a software surface. | |
TextureBase (RendererBase &renderer, IOStream &src) | |
Load an image from a IOStreamBase into a software surface. | |
TextureBase (RendererBase &renderer, PixelFormat format, TextureAccess access, const SDL_Point &size) | |
Create a texture for a rendering context. | |
TextureBase (RendererBase &renderer, SurfaceBase &surface) | |
Create a texture from an existing surface. | |
TextureBase (RendererBase &renderer, PropertiesBase &props) | |
Create a texture for a rendering context with the specified properties. | |
![]() | |
TextureBase (RendererBase &renderer, StringParam file) | |
Load an image from a filesystem path into a software surface. | |
TextureBase (RendererBase &renderer, IOStream &src) | |
Load an image from a IOStreamBase into a software surface. | |
TextureBase (RendererBase &renderer, PixelFormat format, TextureAccess access, const SDL_Point &size) | |
Create a texture for a rendering context. | |
TextureBase (RendererBase &renderer, SurfaceBase &surface) | |
Create a texture from an existing surface. | |
TextureBase (RendererBase &renderer, PropertiesBase &props) | |
Create a texture for a rendering context with the specified properties. | |
PropertiesRef | GetProperties () const |
Get the properties associated with a texture. | |
RendererRef | GetRenderer () const |
Get the renderer that created an TextureBase. | |
void | SetMod (Color c) |
Set an additional color and alpha values multiplied into render copy operations. | |
void | SetMod (FColor c) |
Set an additional color and alpha values multiplied into render copy operations. | |
FColor | GetMod () const |
Get the additional color value multiplied into render copy operations. | |
void | GetMod (Color *c) const |
Get the additional color value multiplied into render copy operations. | |
void | GetMod (FColor *c) const |
Get the additional color value multiplied into render copy operations. | |
void | SetColorMod (Uint8 r, Uint8 g, Uint8 b) |
Set an additional color value multiplied into render copy operations. | |
void | SetColorMod (float r, float g, float b) |
Set an additional color value multiplied into render copy operations. | |
void | GetColorMod (Uint8 *r, Uint8 *g, Uint8 *b) const |
Get the additional color value multiplied into render copy operations. | |
void | GetColorMod (float *r, float *g, float *b) const |
Get the additional color value multiplied into render copy operations. | |
void | SetAlphaMod (Uint8 alpha) |
Set an additional alpha value multiplied into render copy operations. | |
void | SetAlphaMod (float alpha) |
Set an additional alpha value multiplied into render copy operations. | |
float | GetAlphaMod () const |
Get the additional alpha value multiplied into render copy operations. | |
void | GetAlphaMod (Uint8 *alpha) const |
Get the additional alpha value multiplied into render copy operations. | |
void | GetAlphaMod (float *alpha) const |
Get the additional alpha value multiplied into render copy operations. | |
void | SetBlendMode (BlendMode blendMode) |
Set the blend mode for a texture, used by RendererBase.RenderTexture(). | |
BlendMode | GetBlendMode () const |
Get the blend mode used for texture copy operations. | |
void | SetScaleMode (ScaleMode scaleMode) |
Set the scale mode used for texture scale operations. | |
ScaleMode | GetScaleMode () const |
Get the scale mode used for texture scale operations. | |
void | Update (OptionalRef< const SDL_Rect > rect, const void *pixels, int pitch) |
Update the given texture rectangle with new pixel data. | |
void | UpdateYUV (OptionalRef< const SDL_Rect > rect, const Uint8 *Yplane, int Ypitch, const Uint8 *Uplane, int Upitch, const Uint8 *Vplane, int Vpitch) |
Update a rectangle within a planar YV12 or IYUV texture with new pixel data. | |
void | UpdateNV (OptionalRef< const SDL_Rect > rect, const Uint8 *Yplane, int Ypitch, const Uint8 *UVplane, int UVpitch) |
Update a rectangle within a planar NV12 or NV21 texture with new pixels. | |
TextureLock | Lock (OptionalRef< const SDL_Rect > rect={}) & |
Lock a portion of the texture for write-only pixel access. | |
int | GetWidth () const |
Get the width in pixels. | |
int | GetHeight () const |
Get the height in pixels. | |
Point | GetSize () const |
Get the size in pixels. | |
PixelFormat | GetFormat () const |
Get the pixel format. | |
constexpr | Resource (T resource={}) |
Constructs the underlying resource. | |
constexpr | Resource (std::nullptr_t) |
Equivalent to default ctor. | |
constexpr | Resource (std::nullopt_t) |
Equivalent to default ctor. | |
Resource (const Resource &other)=delete | |
Resource (Resource &&other)=delete | |
![]() | |
constexpr | Resource (SDL_Texture * resource={}) |
Constructs the underlying resource. | |
constexpr | Resource (std::nullptr_t) |
Equivalent to default ctor. | |
constexpr | Resource (std::nullopt_t) |
Equivalent to default ctor. | |
Resource (const Resource &other)=delete | |
Resource (Resource &&other)=delete | |
Resource & | operator= (const Resource &other)=delete |
Resource & | operator= (Resource &&other)=delete |
constexpr | operator bool () const |
True if contains a valid resource. | |
constexpr bool | operator== (const Resource &other) const=default |
Comparison. | |
constexpr bool | operator== (std::nullopt_t) const |
Comparison. | |
constexpr bool | operator== (std::nullptr_t) const |
Comparison. | |
constexpr SDL_Texture * | get () const |
Return contained resource;. | |
constexpr SDL_Texture * | release (SDL_Texture * newResource={}) |
Return contained resource and empties or replace value. | |
constexpr const SDL_Texture * | operator-> () const |
Access to fields. | |
constexpr SDL_Texture * | operator-> () |
Access to fields. | |