The Battle for Wesnoth  1.15.7+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 145 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 148 of file surface.hpp.

Constructor & Destructor Documentation

◆ surface_locker()

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

Definition at line 151 of file surface.hpp.

References surface::surface_.

◆ ~surface_locker()

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

Definition at line 158 of file surface.hpp.

References surface::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

Definition at line 169 of file surface.hpp.

◆ surface_

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

Definition at line 168 of file surface.hpp.


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