Skip to content

Buffer_constants

hugh greene edited this page Jun 20, 2022 · 1 revision

This article is an overview of buffer related constants.

Constant Description
buffer_generalerror Unknown
buffer_invalidtype Unknown
buffer_outofbounds Unknown
buffer_outofspace Unknown
buffer_vbuffer Unknown
buffer_seek_start The beginning of the buffer
buffer_seek_end The end of the buffer
buffer_seek_relative Position in the buffer that is relative to the current read and write position.

These are the various types of buffers that can be created.

Constant Description
buffer_fast A special optimized buffer that is extremely fast to read and write to and from because it does not have to be able to dynamically allocate memory. It can only be used with buffer_u8 and buffer_s8 data types, and its data must be 1 byte aligned.
buffer_fixed A buffer that is created with an initial fixed size in bytes which can not be changed.
buffer_grow A buffer that can dynamically allocate new memory as data is appended, which is initially created with an approximate of its maximum size which will expand as data begins to overflow the buffer.
buffer_wrap A fixed size buffer that wraps the seek position to the beginning of the buffer and overwrites previous data when the data begins to overflow the buffer.

The following are data types for buffers which are used to describe how many bytes are being read/written.

Constant Bytes Data Type Description
buffer_u8 1 byte 8bit unsigned integer. Positive value in the range of 0 to 255
buffer_s8 1 byte 8bit signed integer. Positive or negative value in the range of -128 to 127 (0 is classed as positive)
buffer_u16 2 bytes 16bit unsigned integer. Positive value in the range of 0 to 65,535
buffer_s16 2 bytes 16bit signed integer. Positive or negative value in the range of -32,768 to 32,767 (0 is classed as positive)
buffer_u32 4 bytes 32bit unsigned integer. Positive value in the range of 0 to 4,294,967,295
buffer_s32 4 bytes 32bit signed integer. Positive or negative value in the range of -2,147,483,648 to 2,147,483,647 (0 is classed as positive).
buffer_f16 2 bytes 16bit floating point number. Positive or negative value within the range of a 16 bit signed integer.
buffer_f32 4 bytes 32bit floating point number. Positive or negative value in the range of within the range of a 32 bit signed integer.
buffer_f64 8 bytes 64bit floating point number. Positive or negative value in the range of within the range of -(263) to 263 - 1.
buffer_bool 1 byte boolean value. Can only be either 1 or 0 (true or false)
buffer_string N/A UTF-8 null terminated (0x00) string. Basically a GameMaker string is dumped in the buffer, and a 0 put at the end.
Clone this wiki locally