|
constexpr | SurfaceLock ()=default |
| Creates an empty lock.
|
|
constexpr | SurfaceLock (SurfaceLock &&other) |
| Move constructor.
|
|
| SurfaceLock (SurfaceRef surface) |
| Set up a surface for directly accessing the pixels.
|
|
| ~SurfaceLock () |
| Destructor.
|
|
void | Unlock () |
| Release a surface after directly accessing the pixels.
|
|
void | reset () |
| Same as Unlock(), just for uniformity.
|
|
constexpr | LockBase ()=default |
| Default ctor.
|
|
| LockBase (const LockBase &other)=delete |
|
| LockBase (LockBase &&other) |
| Move ctor.
|
|
constexpr | ~LockBase () |
| Dtor.
|
|
LockBase & | operator= (LockBase other) |
| Move assignment.
|
|
RESOURCE | release () |
| Returns reference and reset this.
|
|
constexpr | operator bool () const |
| Check if not null.
|
|
constexpr bool | operator== (const ResourcePtrBase &other) const |
| Comparison.
|
|
constexpr bool | operator== (std::nullptr_t) const |
| Comparison.
|
|
constexpr bool | operator== (std::nullopt_t) const |
| Comparison.
|
|
constexpr reference | operator* () const |
| Gets reference.
|
|
constexpr const reference * | operator-> () const |
| Gets addressable reference.
|
|
constexpr reference * | operator-> () |
| Gets addressable reference.
|
|
reference | get () const |
| Get reference.
|
|
Only really necessary if Surface.MustLock() returns t
SDL::SurfaceLock::SurfaceLock |
( |
SurfaceRef |
surface | ) |
|
|
inline |
Between calls to SurfaceRef.Lock() / SurfaceLock.Unlock(), you can write to and read from surface->pixels
, using the pixel format stored in surface->format
. Once you are done accessing the surface, you should use SurfaceLock.Unlock() to release it.
Not all surfaces require locking. If SDL_MUSTLOCK(surface)
evaluates to 0, then you can read and write to the surface at any time, and the pixel format of the surface will not change.
- Parameters
-
surface | the Surface structure to be locked. |
- Exceptions
-
- Thread safety:
- This function is not thread safe. The locking referred to by this function is making the pixels available for direct access, not thread-safe locking.
- Since
- This function is available since SDL 3.2.0.
- See also
- SDL_MUSTLOCK
-
SurfaceLock.Unlock