Databuffer objects provide storage for arbitrary data. More...
Constructors: |
|
Properties: |
|
Methods: |
|
Functions: |
Data may be written to a databufffer using one of the 'poke' methods, and read from a databuffer using one of the 'peek' methods.
Parameters that specify buffer addresses or array indices for data transfers are not currently range checked. In general, you should always ensure that these are always valid, ie: >=0 And <=length of the buffer/array. Any transfer count parameters should always be >=0, but will always be clipped to make sure no overreads or overwrites occur.
Creates a new data buffer of the specified byte length.
Values can be written into the databuffer using the various 'poke' methods, or read using the 'peek' methods.
The direct parameter should be set to true when creating VBO databuffers for use with OpenGL on android. Direct databuffers cannot be used for reading/writing streams. This parameter only affects the android target and is ignored on all other targets.
Copies count bytes starting at srcAddress from this buffer to dst.
Releases any resources used by the data buffer.
Once discarded, a data buffer should not be used again.
Returns the 8 bit byte contained in the databuffer at address.
Copies count bytes starting at address from the databuffer to bytes.
Data is written to bytes starting at index offset.
Returns the 32 bit float value stored in the data buffer at address.
Copies count 32 bit floats starting at address from the databuffer to bytes.
Data is written to data starting at index offset.
Returns the 32 bit int value contained in the data buffer at address.
Copies count 32 bit ints starting at address from the databuffer to bytes.
Data is written to ints starting at index offset.
Returns the 16 bit int value contained in the data buffer at address.
Copies count 16 bit shorts starting at address from the databuffer to bytes.
Data is written to shorts starting at index offset.
Peeks and returns a string from the data buffer.
Data is read from address up until the end of the data buffer.
The encoding parameter should be one of:
Encoding | Description |
---|---|
"utf8" | Unicode |
"ascii" | 8 bit ascii |
Peeks and returns a string from the data buffer.
Up to count bytes are read from the data buffer starting from address.
The encoding parameter should be one of:
Encoding | Description |
---|---|
"utf8" | Unicode |
"ascii" | 8 bit ascii |
Writes an 8 bit byte into the data buffer at address.
Copies count 8 bit bytes from the bytes array to the databuffer.
offset is the starting index within the source array, and address is the starting byte address within the databuffer.
Writes a 32 bit float value into the data buffer at address.
Copies count 32 bit floats from the floats array to the databuffer.
offset is the starting index within the source array, and address is the starting byte address within the databuffer.
Writes a 32 bit int value into the data buffer at address.
Copies count 32 bit ints from the ints array to the databuffer.
offset is the starting index within the source array, and address is the starting byte address within the databuffer.
Writes a 16 bit int value into the data buffer at address.
Creates and returns a databuffer containing the binary contents of the specified file.
If the file does not exist or cannot be read, null is returned instead.
See also Resource paths
Loads a databuffer asynchronously.
When data has finished loading, the OnLoadDataComplete method of the onComplete object is called.
See also Resource paths