HoverRace
2.0
|
Wrapper for an SDL texture that can be updated. More...
#include <SdlDynamicTexture.h>
Public Member Functions | |
SdlDynamicTexture ()=delete | |
SdlDynamicTexture (SdlDisplay &display, SDL_Texture *texture) | |
Constructor. More... | |
SdlDynamicTexture (SdlDisplay &display, int width, int height) | |
Constructor, with a new texture. More... | |
SdlDynamicTexture (const SdlDynamicTexture &)=delete | |
virtual | ~SdlDynamicTexture () |
bool | IsDirty () const |
Check if this texture has changes that haven't been updated yet. More... | |
SdlDynamicTexture & | operator= (const SdlDynamicTexture &)=delete |
bool | Update () |
Updates the texture from the backing surface. More... | |
template<class Fn > | |
void | Update (Fn fn) |
Updates the texture with new pixel data. More... | |
Public Member Functions inherited from HoverRace::Display::SDL::SdlTexture | |
SdlTexture ()=delete | |
SdlTexture (SdlDisplay &display, SDL_Texture *texture) | |
SdlTexture (const SdlTexture &)=delete | |
virtual | ~SdlTexture () |
SDL_Texture * | Get () const |
SdlTexture & | operator= (const SdlTexture &)=delete |
Public Member Functions inherited from HoverRace::Display::Texture | |
Texture () | |
virtual | ~Texture () |
Protected Attributes | |
bool | dirty |
SDL_Surface * | surface |
Protected Attributes inherited from HoverRace::Display::SDL::SdlTexture | |
SdlDisplay & | display |
SDL_Texture * | texture |
Private Types | |
using | SUPER = SdlTexture |
Wrapper for an SDL texture that can be updated.
|
private |
|
delete |
HoverRace::Display::SDL::SdlDynamicTexture::SdlDynamicTexture | ( | SdlDisplay & | display, |
SDL_Texture * | texture | ||
) |
Constructor.
display | The display. |
texture | The texture (may not be nullptr ). |
DynamicTextureExn | Could not be created (texture will still be freed). |
HoverRace::Display::SDL::SdlDynamicTexture::SdlDynamicTexture | ( | SdlDisplay & | display, |
int | width, | ||
int | height | ||
) |
Constructor, with a new texture.
display | The display. |
width | The requested width. |
height | The requested height. |
DynamicTextureExn | Could not be created. |
|
delete |
|
inlinevirtual |
|
inline |
Check if this texture has changes that haven't been updated yet.
Call Update() to write the commit the changes to the texture.
true
if dirty, false
if not.
|
delete |
|
inline |
Updates the texture from the backing surface.
true
if an update was performed (dirty flag was set), false
if no update was needed.
|
inline |
Updates the texture with new pixel data.
fn | The update function. Will be passed the drawing surface. Returns true to update the texture immediately, or false to defer the update until a later call to Update(). |
|
protected |
|
protected |