Difference between revisions of "SpriteBatch:bind"

m (Wrong link)
m (Wrong link, again.)
Line 26: Line 26:
 
== See Also ==
 
== See Also ==
 
* [[parent::SpriteBatch]]
 
* [[parent::SpriteBatch]]
* [[SpriteBatch::unbind]]
+
* [[SpriteBatch:unbind]]
 
[[Category:Functions]]
 
[[Category:Functions]]
 
{{#set:Description=Binds the SpriteBatch to the memory.}}
 
{{#set:Description=Binds the SpriteBatch to the memory.}}

Revision as of 00:47, 24 June 2011

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