Pike v8.1 release 6

Method SDL.Surface()->lock()


Method lock

int lock()

Description

This methods locks the surface to allow direct access to the pixels using the get_pixel() and set_pixel() methods.

Note

Note that although all surfaces in SDL don't require locking, you still need to call this method to enable the set/get pixel methods. You should unlock the surface when you're doing modifying it.

Note

Calling this method multiple times means that you need to call unlock an equal number of times for the surface to become unlocked.

Returns

1 for success or 0 if the surface couldn't be locked.

See also

unlock(), set_pixel(), get_pixel()