Buffers

These functions can be used to read and write directly to the device buffer memory.

A binary buffer is a region of physical memory used to temporarily hold data while it is being moved from one place to another or manipulated in some way, for example you can use a buffer to hold packet data awaiting transmission over a network or for storing a packet that has been received over a network. GameMaker: Studio has a number of specific functions related to creating, modifying and loading/saving buffers, but before using them please note the following points:

The following pages explain how buffers work within the context of GameMaker: Studio and contain a couple of code examples for those users that are unsure of how to use them:

  1. Using Buffers
  2. Buffer Examples

The following functions exist for you to use with binary buffers in your games:

  1. buffer_create
  2. buffer_create_from_vertex_buffer
  3. buffer_create_from_vertex_buffer_ext
  4. buffer_delete
  5. buffer_read
  6. buffer_write
  7. buffer_fill
  8. buffer_seek
  9. buffer_tell
  10. buffer_peek
  11. buffer_poke
  12. buffer_save
  13. buffer_save_ext
  14. buffer_save_async
  15. buffer_load
  16. buffer_load_ext
  17. buffer_load_async
  18. buffer_async_group_begin
  19. buffer_async_group_option
  20. buffer_async_group_end
  21. buffer_copy
  22. buffer_copy_from_vertex_buffer
  23. buffer_get_type
  24. buffer_get_alignment
  25. buffer_get_address
  26. buffer_get_size
  27. buffer_get_surface
  28. buffer_set_surface
  29. buffer_resize
  30. buffer_sizeof
  31. buffer_md5
  32. buffer_sha1
  33. buffer_base64_encode
  34. buffer_base64_decode
  35. buffer_base64_decode_ext

There are also two extra functions related to buffers that can be used to save and load game states (note that they require a buffer to have been created previously):

  1. game_load_buffer
  2. game_save_buffer

Finally, you can also use special Vertex Buffers to create your own custom primitives or models, etc... You can find out more about these from the following section of the manual:

  1. Vertex Buffers


Back: Reference
© Copyright YoYo Games Ltd. 2018 All Rights Reserved