C# Класс Nez.Batcher

Наследование: GraphicsResource
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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

Защищенные методы

Метод Описание
Dispose ( bool disposing ) : void

Приватные методы

Метод Описание
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

Описание методов

Batcher() публичный Метод

public Batcher ( GraphicsDevice graphicsDevice ) : System
graphicsDevice GraphicsDevice
Результат System

Dispose() защищенный Метод

protected Dispose ( bool disposing ) : void
disposing bool
Результат void

begin() публичный Метод

public begin ( ) : void
Результат void

begin() публичный Метод

public begin ( BlendState blendState ) : void
blendState Microsoft.Xna.Framework.Graphics.BlendState
Результат void

begin() публичный Метод

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
Результат void

begin() публичный Метод

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
Результат void

begin() публичный Метод

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
Результат void

begin() публичный Метод

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
Результат void

begin() публичный Метод

public begin ( Effect effect ) : void
effect Microsoft.Xna.Framework.Graphics.Effect
Результат void

begin() публичный Метод

public begin ( Material material ) : void
material Material
Результат void

begin() публичный Метод

public begin ( Material material, Matrix transformationMatrix ) : void
material Material
transformationMatrix Matrix
Результат void

begin() публичный Метод

public begin ( Matrix transformationMatrix ) : void
transformationMatrix Matrix
Результат void

draw() публичный Метод

public draw ( Microsoft.Xna.Framework.Graphics.Texture2D texture, Rectangle destinationRectangle ) : void
texture Microsoft.Xna.Framework.Graphics.Texture2D
destinationRectangle Microsoft.Xna.Framework.Rectangle
Результат void

draw() публичный Метод

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
Результат void

draw() публичный Метод

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
Результат void

draw() публичный Метод

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
Результат void

draw() публичный Метод

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
Результат void

draw() публичный Метод

public draw ( Microsoft.Xna.Framework.Graphics.Texture2D texture, Vector2 position ) : void
texture Microsoft.Xna.Framework.Graphics.Texture2D
position Vector2
Результат void

draw() публичный Метод

public draw ( Microsoft.Xna.Framework.Graphics.Texture2D texture, Vector2 position, Color color ) : void
texture Microsoft.Xna.Framework.Graphics.Texture2D
position Vector2
color Color
Результат void

draw() публичный Метод

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
Результат void

draw() публичный Метод

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
Результат void

draw() публичный Метод

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
Результат void

draw() публичный Метод

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
Результат void

drawPrimitives() публичный Метод

public drawPrimitives ( Texture texture, int baseSprite, int batchSize ) : void
texture Microsoft.Xna.Framework.Graphics.Texture
baseSprite int
batchSize int
Результат void

drawRaw() публичный Метод

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.
Результат void

enableScissorTest() публичный Метод

enables/disables scissor testing. If the RasterizerState changes it will cause a batch flush.
public enableScissorTest ( bool shouldEnable ) : void
shouldEnable bool Should enable.
Результат void

end() публичный Метод

public end ( ) : void
Результат void

flushBatch() публичный Метод

public flushBatch ( ) : void
Результат void

prepRenderState() публичный Метод

public prepRenderState ( ) : void
Результат void