C# Class Nez.Batcher

Inheritance: GraphicsResource
Afficher le fichier Open project: prime31/Nez Class Usage Examples

Méthodes publiques

Méthode Description
Batcher ( GraphicsDevice graphicsDevice ) : System
begin ( ) : void
begin ( BlendState blendState ) : void
begin ( BlendState blendState, SamplerState samplerState, DepthStencilState depthStencilState, RasterizerState rasterizerState ) : void
begin ( BlendState blendState, SamplerState samplerState, DepthStencilState depthStencilState, RasterizerState rasterizerState, Effect effect ) : void
begin ( BlendState blendState, SamplerState samplerState, DepthStencilState depthStencilState, RasterizerState rasterizerState, Effect effect, Matrix transformationMatrix ) : void
begin ( BlendState blendState, SamplerState samplerState, DepthStencilState depthStencilState, RasterizerState rasterizerState, Effect effect, Matrix transformationMatrix, bool disableBatching ) : void
begin ( Effect effect ) : void
begin ( Material material ) : void
begin ( Material material, Matrix transformationMatrix ) : void
begin ( Matrix transformationMatrix ) : void
draw ( Microsoft.Xna.Framework.Graphics.Texture2D texture, Rectangle destinationRectangle ) : void
draw ( Microsoft.Xna.Framework.Graphics.Texture2D texture, Rectangle destinationRectangle, Color color ) : void
draw ( Microsoft.Xna.Framework.Graphics.Texture2D texture, Rectangle destinationRectangle, Rectangle sourceRectangle, Color color ) : void
draw ( Microsoft.Xna.Framework.Graphics.Texture2D texture, Rectangle destinationRectangle, Rectangle sourceRectangle, Color color, float rotation, SpriteEffects effects, float layerDepth, float skewTopX, float skewBottomX, float skewLeftY, float skewRightY ) : void
draw ( Microsoft.Xna.Framework.Graphics.Texture2D texture, Rectangle destinationRectangle, Rectangle sourceRectangle, Color color, float rotation, Vector2 origin, SpriteEffects effects, float layerDepth ) : void
draw ( Microsoft.Xna.Framework.Graphics.Texture2D texture, Vector2 position ) : void
draw ( Microsoft.Xna.Framework.Graphics.Texture2D texture, Vector2 position, Color color ) : void
draw ( Microsoft.Xna.Framework.Graphics.Texture2D texture, Vector2 position, Rectangle sourceRectangle, Color color ) : void
draw ( Microsoft.Xna.Framework.Graphics.Texture2D texture, Vector2 position, Rectangle sourceRectangle, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effects, float layerDepth ) : void
draw ( Microsoft.Xna.Framework.Graphics.Texture2D texture, Vector2 position, Rectangle sourceRectangle, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effects, float layerDepth, float skewTopX, float skewBottomX, float skewLeftY, float skewRightY ) : void
draw ( Microsoft.Xna.Framework.Graphics.Texture2D texture, Vector2 position, Rectangle sourceRectangle, Color color, float rotation, Vector2 origin, float scale, SpriteEffects effects, float layerDepth ) : void
drawPrimitives ( Texture texture, int baseSprite, int batchSize ) : void
drawRaw ( Microsoft.Xna.Framework.Graphics.Texture2D texture, Vector3 verts, Vector2 textureCoords, Color colors ) : void

direct access to setting vert positions, UVs and colors. The order of elements is top-left, top-right, bottom-left, bottom-right

enableScissorTest ( bool shouldEnable ) : void

enables/disables scissor testing. If the RasterizerState changes it will cause a batch flush.

end ( ) : void
flushBatch ( ) : void
prepRenderState ( ) : void

Méthodes protégées

Méthode Description
Dispose ( bool disposing ) : void

Private Methods

Méthode Description
DrawString ( SpriteFont spriteFont, string text, Vector2 position, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effects, float layerDepth ) : void
checkBegin ( ) : void
generateIndexArray ( ) : short[]
pushSprite ( Microsoft.Xna.Framework.Graphics.Texture2D texture, Rectangle sourceRectangle, float destinationX, float destinationY, float destinationW, float destinationH, Color color, Vector2 origin, float rotation, float depth, byte effects, bool destSizeInPixels, float skewTopX, float skewBottomX, float skewLeftY, float skewRightY ) : void

Method Details

Batcher() public méthode

public Batcher ( GraphicsDevice graphicsDevice ) : System
graphicsDevice GraphicsDevice
Résultat System

Dispose() protected méthode

protected Dispose ( bool disposing ) : void
disposing bool
Résultat void

begin() public méthode

public begin ( ) : void
Résultat void

begin() public méthode

public begin ( BlendState blendState ) : void
blendState Microsoft.Xna.Framework.Graphics.BlendState
Résultat void

begin() public méthode

public begin ( BlendState blendState, SamplerState samplerState, DepthStencilState depthStencilState, RasterizerState rasterizerState ) : void
blendState Microsoft.Xna.Framework.Graphics.BlendState
samplerState Microsoft.Xna.Framework.Graphics.SamplerState
depthStencilState Microsoft.Xna.Framework.Graphics.DepthStencilState
rasterizerState Microsoft.Xna.Framework.Graphics.RasterizerState
Résultat void

begin() public méthode

public begin ( BlendState blendState, SamplerState samplerState, DepthStencilState depthStencilState, RasterizerState rasterizerState, Effect effect ) : void
blendState Microsoft.Xna.Framework.Graphics.BlendState
samplerState Microsoft.Xna.Framework.Graphics.SamplerState
depthStencilState Microsoft.Xna.Framework.Graphics.DepthStencilState
rasterizerState Microsoft.Xna.Framework.Graphics.RasterizerState
effect Microsoft.Xna.Framework.Graphics.Effect
Résultat void

begin() public méthode

public begin ( BlendState blendState, SamplerState samplerState, DepthStencilState depthStencilState, RasterizerState rasterizerState, Effect effect, Matrix transformationMatrix ) : void
blendState Microsoft.Xna.Framework.Graphics.BlendState
samplerState Microsoft.Xna.Framework.Graphics.SamplerState
depthStencilState Microsoft.Xna.Framework.Graphics.DepthStencilState
rasterizerState Microsoft.Xna.Framework.Graphics.RasterizerState
effect Microsoft.Xna.Framework.Graphics.Effect
transformationMatrix Matrix
Résultat void

begin() public méthode

public begin ( BlendState blendState, SamplerState samplerState, DepthStencilState depthStencilState, RasterizerState rasterizerState, Effect effect, Matrix transformationMatrix, bool disableBatching ) : void
blendState Microsoft.Xna.Framework.Graphics.BlendState
samplerState Microsoft.Xna.Framework.Graphics.SamplerState
depthStencilState Microsoft.Xna.Framework.Graphics.DepthStencilState
rasterizerState Microsoft.Xna.Framework.Graphics.RasterizerState
effect Microsoft.Xna.Framework.Graphics.Effect
transformationMatrix Matrix
disableBatching bool
Résultat void

begin() public méthode

public begin ( Effect effect ) : void
effect Microsoft.Xna.Framework.Graphics.Effect
Résultat void

begin() public méthode

public begin ( Material material ) : void
material Material
Résultat void

begin() public méthode

public begin ( Material material, Matrix transformationMatrix ) : void
material Material
transformationMatrix Matrix
Résultat void

begin() public méthode

public begin ( Matrix transformationMatrix ) : void
transformationMatrix Matrix
Résultat void

draw() public méthode

public draw ( Microsoft.Xna.Framework.Graphics.Texture2D texture, Rectangle destinationRectangle ) : void
texture Microsoft.Xna.Framework.Graphics.Texture2D
destinationRectangle Microsoft.Xna.Framework.Rectangle
Résultat void

draw() public méthode

public draw ( Microsoft.Xna.Framework.Graphics.Texture2D texture, Rectangle destinationRectangle, Color color ) : void
texture Microsoft.Xna.Framework.Graphics.Texture2D
destinationRectangle Microsoft.Xna.Framework.Rectangle
color Color
Résultat void

draw() public méthode

public draw ( Microsoft.Xna.Framework.Graphics.Texture2D texture, Rectangle destinationRectangle, Rectangle sourceRectangle, Color color ) : void
texture Microsoft.Xna.Framework.Graphics.Texture2D
destinationRectangle Microsoft.Xna.Framework.Rectangle
sourceRectangle Microsoft.Xna.Framework.Rectangle
color Color
Résultat void

draw() public méthode

public draw ( Microsoft.Xna.Framework.Graphics.Texture2D texture, Rectangle destinationRectangle, Rectangle sourceRectangle, Color color, float rotation, SpriteEffects effects, float layerDepth, float skewTopX, float skewBottomX, float skewLeftY, float skewRightY ) : void
texture Microsoft.Xna.Framework.Graphics.Texture2D
destinationRectangle Microsoft.Xna.Framework.Rectangle
sourceRectangle Microsoft.Xna.Framework.Rectangle
color Color
rotation float
effects SpriteEffects
layerDepth float
skewTopX float
skewBottomX float
skewLeftY float
skewRightY float
Résultat void

draw() public méthode

public draw ( Microsoft.Xna.Framework.Graphics.Texture2D texture, Rectangle destinationRectangle, Rectangle sourceRectangle, Color color, float rotation, Vector2 origin, SpriteEffects effects, float layerDepth ) : void
texture Microsoft.Xna.Framework.Graphics.Texture2D
destinationRectangle Microsoft.Xna.Framework.Rectangle
sourceRectangle Microsoft.Xna.Framework.Rectangle
color Color
rotation float
origin Vector2
effects SpriteEffects
layerDepth float
Résultat void

draw() public méthode

public draw ( Microsoft.Xna.Framework.Graphics.Texture2D texture, Vector2 position ) : void
texture Microsoft.Xna.Framework.Graphics.Texture2D
position Vector2
Résultat void

draw() public méthode

public draw ( Microsoft.Xna.Framework.Graphics.Texture2D texture, Vector2 position, Color color ) : void
texture Microsoft.Xna.Framework.Graphics.Texture2D
position Vector2
color Color
Résultat void

draw() public méthode

public draw ( Microsoft.Xna.Framework.Graphics.Texture2D texture, Vector2 position, Rectangle sourceRectangle, Color color ) : void
texture Microsoft.Xna.Framework.Graphics.Texture2D
position Vector2
sourceRectangle Microsoft.Xna.Framework.Rectangle
color Color
Résultat void

draw() public méthode

public draw ( Microsoft.Xna.Framework.Graphics.Texture2D texture, Vector2 position, Rectangle sourceRectangle, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effects, float layerDepth ) : void
texture Microsoft.Xna.Framework.Graphics.Texture2D
position Vector2
sourceRectangle Microsoft.Xna.Framework.Rectangle
color Color
rotation float
origin Vector2
scale Vector2
effects SpriteEffects
layerDepth float
Résultat void

draw() public méthode

public draw ( Microsoft.Xna.Framework.Graphics.Texture2D texture, Vector2 position, Rectangle sourceRectangle, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effects, float layerDepth, float skewTopX, float skewBottomX, float skewLeftY, float skewRightY ) : void
texture Microsoft.Xna.Framework.Graphics.Texture2D
position Vector2
sourceRectangle Microsoft.Xna.Framework.Rectangle
color Color
rotation float
origin Vector2
scale Vector2
effects SpriteEffects
layerDepth float
skewTopX float
skewBottomX float
skewLeftY float
skewRightY float
Résultat void

draw() public méthode

public draw ( Microsoft.Xna.Framework.Graphics.Texture2D texture, Vector2 position, Rectangle sourceRectangle, Color color, float rotation, Vector2 origin, float scale, SpriteEffects effects, float layerDepth ) : void
texture Microsoft.Xna.Framework.Graphics.Texture2D
position Vector2
sourceRectangle Microsoft.Xna.Framework.Rectangle
color Color
rotation float
origin Vector2
scale float
effects SpriteEffects
layerDepth float
Résultat void

drawPrimitives() public méthode

public drawPrimitives ( Texture texture, int baseSprite, int batchSize ) : void
texture Microsoft.Xna.Framework.Graphics.Texture
baseSprite int
batchSize int
Résultat void

drawRaw() public méthode

direct access to setting vert positions, UVs and colors. The order of elements is top-left, top-right, bottom-left, bottom-right
public drawRaw ( Microsoft.Xna.Framework.Graphics.Texture2D texture, Vector3 verts, Vector2 textureCoords, Color colors ) : void
texture Microsoft.Xna.Framework.Graphics.Texture2D Texture.
verts Vector3 Verts.
textureCoords Vector2 Texture coords.
colors Color Colors.
Résultat void

enableScissorTest() public méthode

enables/disables scissor testing. If the RasterizerState changes it will cause a batch flush.
public enableScissorTest ( bool shouldEnable ) : void
shouldEnable bool Should enable.
Résultat void

end() public méthode

public end ( ) : void
Résultat void

flushBatch() public méthode

public flushBatch ( ) : void
Résultat void

prepRenderState() public méthode

public prepRenderState ( ) : void
Résultat void