diff --git a/src/sdl/texture.cpp b/src/sdl/texture.cpp index 026c69bd3a2..67488290b34 100644 --- a/src/sdl/texture.cpp +++ b/src/sdl/texture.cpp @@ -343,6 +343,11 @@ void ttexture::update_pixels(SDL_Surface *surf) } } +bool ttexture::null() const +{ + return texture_ == NULL; +} + void ttexture::initialise_from_surface(SDL_Renderer& renderer, const int access) { if(access == SDL_TEXTUREACCESS_STATIC) { diff --git a/src/sdl/texture.hpp b/src/sdl/texture.hpp index 519fd7f29ff..84bed8a6681 100644 --- a/src/sdl/texture.hpp +++ b/src/sdl/texture.hpp @@ -281,6 +281,13 @@ public: */ void update_pixels(SDL_Surface* surf); + /** + * Tells whether the instance really handles an SDL_Texture object. + * + * @return True if the handled pointer is NULL. + */ + bool null() const; + private: /** * The reference count of the texture.