Difference between revisions of "GraphicsBuffer:clear"

m
m
 
Line 20: Line 20:
 
== Function ==
 
== Function ==
 
Clears a specified byte range within the GraphicsBuffer to zero.
 
Clears a specified byte range within the GraphicsBuffer to zero.
 
The offset and size parameters must be multiples of 4.
 
 
=== Synopsis ===
 
=== Synopsis ===
 
<source lang="lua">
 
<source lang="lua">
Line 31: Line 29:
 
=== Returns ===
 
=== Returns ===
 
Nothing.
 
Nothing.
 +
=== Notes ===
 +
The offset and size parameters must be multiples of 4.
  
  

Latest revision as of 21:37, 25 March 2023

Available since LÖVE 12.0
This function is not supported in earlier versions.

Clears the entire GraphicsBuffer or a specified byte range within it to zero.

This can be more efficient than calling GraphicsBuffer:setArrayData when setting the buffer's contents to zero is desired.

Note that the array element count variants of love.graphics.newBuffer and friends will initialize the buffer's contents to zero when it's first created.

Function

Clears the entire GraphicsBuffer's contents to zero.

Synopsis

GraphicsBuffer:clear( )

Arguments

None.

Returns

Nothing.


Function

Clears a specified byte range within the GraphicsBuffer to zero.

Synopsis

GraphicsBuffer:clear( offset, size )

Arguments

number offset
The offset in bytes within the Buffer.
number size
The size in bytes to clear to zero.

Returns

Nothing.

Notes

The offset and size parameters must be multiples of 4.


See Also

Other Languages