|
OpenTTD Source 20260311-master-g511d3794ce
|
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. | |
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.
|
inline |
Lock the video buffer.
Definition at line 217 of file video_driver.hpp.
References VideoDriver::GetInstance(), VideoDriver::LockVideoBuffer(), and unlock.
|
inline |
Release the video buffer.
Definition at line 223 of file video_driver.hpp.
References VideoDriver::GetInstance(), unlock, and VideoDriver::UnlockVideoBuffer().
|
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().