|
OpenTTD Source 20261112-master-gbcbec5e63f
|
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 226 of file video_driver.hpp.
|
inline |
Lock the video buffer.
Definition at line 228 of file video_driver.hpp.
References VideoDriver::GetInstance(), VideoDriver::LockVideoBuffer(), and unlock.
|
inline |
Release the video buffer.
Definition at line 234 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 240 of file video_driver.hpp.
Referenced by VideoBufferLocker(), and ~VideoBufferLocker().