Copy buffer data to a surface.


GML Code Example

buffer_set_surface(buffer, surface, mode, offset, modulo);

Argument Description
buffer The index of the buffer to use.
surface The index of the surface to use.
mode The data to get from the buffer (see the list of constants below).
offset The data offset value.
modulo The offset from the end of the line to the start of the next

Returns: N/A


With this function you can write the information from a buffer to a given surface. Both the buffer and the surface must have been created previously. You can choose the copy "mode" for the data being stored which is set by the constants listed below, as well as the offset and modulo values. Both offset and modulo are byte values, with the offset defining the start position within the buffer and modulo being the number of bytes that were left at the end of every line (for storing additional data) when the buffer was written to.

Constant Description
0 Copies all data from the buffer.

NOTE: This function is currently only available for the Windows and Playstation 4 target platforms.


GML Code Example

buffer_set_surface(buff, application_surface, 0, 0, 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 or modulo values.

Back: Buffers

No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here