The Battle for Wesnoth  1.15.1+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 147 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 150 of file surface.hpp.

Constructor & Destructor Documentation

◆ surface_locker()

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

Definition at line 153 of file surface.hpp.

References surface::surface_.

◆ ~surface_locker()

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

Definition at line 160 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 171 of file surface.hpp.

◆ surface_

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

Definition at line 170 of file surface.hpp.


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