Click or drag to resize
DigitalRuneGraphicsHelperGetSpriteBatch Method
Gets a shared SpriteBatch instance.

Namespace: DigitalRune.Graphics
Assembly: DigitalRune.Graphics (in DigitalRune.Graphics.dll) Version: 1.2.0.0 (1.2.1.14562)
Syntax
public static SpriteBatch GetSpriteBatch(
	this IGraphicsService graphicsService
)

Parameters

graphicsService
Type: DigitalRune.GraphicsIGraphicsService
The graphics service.

Return Value

Type: SpriteBatch
The shared SpriteBatch instance.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IGraphicsService. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Exceptions
ExceptionCondition
ArgumentNullExceptiongraphicsService is .
Remarks
For a certain graphicsService, this method always returns the same SpriteBatch instance. Whenever Begin is called, End must be called before someone else can use the SpriteBatch.This SpriteBatch instance must not be used concurrently in parallel threads, and it must not be disposed.
See Also