buffer_set_surface

This function writes information from a buffer to a given surface.

Both the buffer and the surface must have been created previously, and the buffer's size must be equal to or greater than the surface's size. If the buffer is smaller than the surface, the function will silently fail.

The surface you are writing to must have the same format as the surface that was written into the buffer. Keep in mind that it can't be guaranteed that a surface saved into a buffer on one platform will be read correctly on another platform, even if both surfaces use the same format.

You can provide an offset into the buffer to start reading from. Reading will always start at the beginning of the buffer plus the offset value and not at the current seek position plus the offset value.

 

Syntax:

buffer_set_surface(buffer, surface, offset);

Argument Type Description
buffer Buffer The buffer to use.
surface Surface The surface to use.
offset Real The data offset value.

 

Returns:

N/A

 

Example:

buffer_set_surface(buff, application_surface, 0);

The above code will copy all the data stored in the buffer indexed in the variable buff to the application surface with no offset.