OpenTTD Source 20260311-master-g511d3794ce
VideoDriver::VideoBufferLocker Struct Reference

Helper struct to ensure the video buffer is locked and ready for drawing. More...

#include <video_driver.hpp>

Public Member Functions

 VideoBufferLocker ()
 Lock the video buffer.
 ~VideoBufferLocker ()
 Release the video buffer.

Private Attributes

bool unlock
 Stores if the lock did anything that has to be undone.

Detailed Description

Helper struct to ensure the video buffer is locked and ready for drawing.

The destructor will make sure the buffer is unlocked no matter how the scope is exited.

Definition at line 215 of file video_driver.hpp.

Constructor & Destructor Documentation

◆ VideoBufferLocker()

VideoDriver::VideoBufferLocker::VideoBufferLocker ( )
inline

Lock the video buffer.

Definition at line 217 of file video_driver.hpp.

References VideoDriver::GetInstance(), VideoDriver::LockVideoBuffer(), and unlock.

◆ ~VideoBufferLocker()

VideoDriver::VideoBufferLocker::~VideoBufferLocker ( )
inline

Release the video buffer.

Definition at line 223 of file video_driver.hpp.

References VideoDriver::GetInstance(), unlock, and VideoDriver::UnlockVideoBuffer().

Field Documentation

◆ unlock

bool VideoDriver::VideoBufferLocker::unlock
private

Stores if the lock did anything that has to be undone.

Definition at line 229 of file video_driver.hpp.

Referenced by VideoBufferLocker(), and ~VideoBufferLocker().


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