Fusion.Engine.Graphics.SpriteLayer.Draw C# (CSharp) Method

Draw() private method

private Draw ( GameTime gameTime, StereoEye stereoEye ) : void
gameTime Fusion.Engine.Common.GameTime
stereoEye StereoEye
return void
		internal void Draw ( GameTime gameTime, StereoEye stereoEye )
		{
			if (spriteCount==0) {
				return;
			}

			if (dirty) {

				//	realloc buffers in necessary
				if ( vertices.Count > capacity * VertexPerSprite ) {

					var newCapacity	=	MathUtil.IntDivRoundUp( vertices.Count / VertexPerSprite, 64 ) * 64;
					
					ReallocGpuBuffers( newCapacity );
				}

				vertexBuffer.SetData( vertices.ToArray() );

				framesBuffer.SetData( framesData );

				dirty	=	false;
			}


			rs.Device.PixelShaderConstants[1] = framesBuffer;
			rs.Device.SetupVertexInput( vertexBuffer, null );


			foreach ( var group in groups ) {
				rs.Device.PixelShaderResources[0] = group.Texture.Srv;
				rs.Device.Draw( group.SpriteCount * VertexPerSprite, group.StartSprite * VertexPerSprite );
			}
		}

Same methods

SpriteLayer::Draw ( Texture texture, Rectangle dstRect, Color color, int clipRectIndex ) : void
SpriteLayer::Draw ( Texture texture, Rectangle dstRect, Rectangle srcRect, Color color, int clipRectIndex ) : void
SpriteLayer::Draw ( Texture texture, Rectangle dstRect, Rectangle srcRect, int offsetX, int offsetY, Color color, int clipRectIndex ) : void
SpriteLayer::Draw ( Texture texture, RectangleF dstRect, Color color, int clipRectIndex ) : void
SpriteLayer::Draw ( Texture texture, RectangleF dstRect, RectangleF srcRect, Color color, int clipRectIndex ) : void
SpriteLayer::Draw ( Texture srv, float x, float y, float w, float h, Color color, int clipRectIndex ) : void