The Battle for Wesnoth  1.19.5+dev
Public Member Functions | Private Types | Private Attributes | List of all members
surface_locker< T > Class Template Reference

Helper class for pinning SDL surfaces into memory. More...

#include <surface.hpp>

Public Member Functions

 surface_locker (T &surf)
 
 ~surface_locker ()
 
pixel_tpixels () const
 

Private Types

using pixel_t = utils::const_clone_t< uint32_t, T >
 

Private Attributes

T & surface_
 
bool locked_
 

Detailed Description

template<typename T>
class surface_locker< T >

Helper class for pinning SDL surfaces into memory.

Note
This class should be used only with neutral surfaces, so that the pointer returned by pixels is meaningful.

Definition at line 126 of file surface.hpp.

Member Typedef Documentation

◆ pixel_t

template<typename T >
using surface_locker< T >::pixel_t = utils::const_clone_t<uint32_t, T>
private

Definition at line 129 of file surface.hpp.

Constructor & Destructor Documentation

◆ surface_locker()

template<typename T >
surface_locker< T >::surface_locker ( T &  surf)
inline

Definition at line 132 of file surface.hpp.

References surface_locker< T >::locked_, and surface_locker< T >::surface_.

◆ ~surface_locker()

template<typename T >
surface_locker< T >::~surface_locker ( )
inline

Definition at line 139 of file surface.hpp.

References surface_locker< T >::locked_, and surface_locker< T >::surface_.

Member Function Documentation

◆ pixels()

template<typename T >
pixel_t* surface_locker< T >::pixels ( ) const
inline

Member Data Documentation

◆ locked_

template<typename T >
bool surface_locker< T >::locked_
private

◆ surface_

template<typename T >
T& surface_locker< T >::surface_
private

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