Copy surface data to a buffer.


GML Code Example

buffer_get_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 surface (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 surface to a given buffer. The buffer 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 left at the end of every line (for storing additional data). Note that the function writes each pixel of the surface to the buffer using a BGRA formatting.

Constant Description
0 Copies all data from the surface.


GML Code Example

buffer_get_surface(buff, application_surface, 0, 0, 0);

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

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