Add a function to check if the handled pointer is NULL.

This commit is contained in:
Boldizsár Lipka 2014-06-05 16:20:55 +02:00
parent f3258c7504
commit 0ec70a22fd
2 changed files with 12 additions and 0 deletions

View file

@ -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) {

View file

@ -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.