Difference between revisions of "SpriteBatch:bind"

Line 1: Line 1:
 
{{newin|[[0.8.0]]|080|type=function|text=It has been renamed from [[SpriteBatch:lock]]}}
 
{{newin|[[0.8.0]]|080|type=function|text=It has been renamed from [[SpriteBatch:lock]]}}
Binds the SpriteBatch to the memory.
+
Binds the [[SpriteBatch]] to the memory.
  
 
Binding a SpriteBatch before updating its content can improve the performance as it doesn't push each update to the graphics card separately. Don't forget to [[SpriteBatch:unbind|unbind]] the SpriteBatch or the updates won't show up.
 
Binding a SpriteBatch before updating its content can improve the performance as it doesn't push each update to the graphics card separately. Don't forget to [[SpriteBatch:unbind|unbind]] the SpriteBatch or the updates won't show up.

Revision as of 16:18, 26 July 2012

Available since LÖVE 0.8.0
It has been renamed from SpriteBatch:lock.

Binds the SpriteBatch to the memory.

Binding a SpriteBatch before updating its content can improve the performance as it doesn't push each update to the graphics card separately. Don't forget to unbind the SpriteBatch or the updates won't show up.

Function

Synopsis

SpriteBatch:bind( )

Arguments

None.

Returns

Nothing.

Examples

Updating a SpriteBatch with binding

function update_spritebatch(sb)
	sb:bind()

	for i = 1, 10 do
		add_tile(sb)
	end

	sb:unbind()
end

See Also

Other Languages