Rose
Public Member Functions | Protected Attributes | List of all members
rose::gm::SurfaceLock Class Reference

A helper class to wrap the SDL_LockSurface and SDL_UnlockSurface API calls. More...

#include <Surface.h>

Public Member Functions

 ~SurfaceLock ()
 Unlock the surface on destruction.
 
 SurfaceLock ()=delete
 Deleted default constructor.
 
 SurfaceLock (SDL_Surface *surface)
 Construct a SurfaceLock. More...
 
 operator bool () const noexcept
 Check the validity of the surface lock. More...
 

Protected Attributes

int status {0}
 The return status returned by SDL_LockSurface.
 
SDL_Surface * mSurface
 The surface being locked.
 

Detailed Description

A helper class to wrap the SDL_LockSurface and SDL_UnlockSurface API calls.

Constructor & Destructor Documentation

◆ SurfaceLock()

rose::gm::SurfaceLock::SurfaceLock ( SDL_Surface *  surface)
explicit

Construct a SurfaceLock.

Parameters
surfaceThe surface that will be locked.

Member Function Documentation

◆ operator bool()

rose::gm::SurfaceLock::operator bool ( ) const
inlineexplicitnoexcept

Check the validity of the surface lock.

Returns
True if SDL_LockSurface returned 0.

The documentation for this class was generated from the following files: