• Articles
  • Api Documentation
Show / Hide Table of Contents
  • Inferno
    • CollisionMode
    • DrawMode
    • Game
    • Game.OnResizeEventArgs
    • GameState
    • GameState.StateOnDrawEventArgs
    • GameWindow
    • Instance
    • MathHelper
    • Matrix
    • Point
    • Rectangle
    • Settings
    • SpatialMode
    • UpdateMode
    • Vector2
    • Vector3
    • Vector4
  • Inferno.Audio
    • AudioDevice
    • Sound
  • Inferno.Content
    • ContentLoader
  • Inferno.Formats.Audio
    • WaveFormat
  • Inferno.Formats.Graphics.Text
    • FontFormat
  • Inferno.Graphics
    • Camera
    • Color
    • GraphicsDevice
    • PlatformType
    • Renderable
    • RenderableType
    • Renderer
    • RenderSortMode
    • RenderTarget
    • Shader
    • ShaderLanguage
    • ShaderType
    • Sprite
    • Texture2D
    • Tileset
  • Inferno.Graphics.Text
    • Font
    • FontBuilder
  • Inferno.Input
    • ButtonState
    • Key
    • Keyboard
    • Keyboard.KeyEventArgs
    • KeyboardState
    • KeyState
    • Mouse
    • MouseState
  • Inferno.Tiled
    • RenderOrder
    • TiledLayer
    • TiledLayerChunk
    • TiledLoader
    • TiledMap
    • TiledMapOrientation
    • TiledObject
    • TiledObjectLayer
    • TiledVersion
  • Inferno.UI
    • MessageBox
    • MessageBoxType
    • UserInterface
  • Inferno.UI.Controls
    • Button
    • Control
    • Control.ControlClickedEvent
    • Control.ControlHoveredEvent
    • Control.TextChangedEventArgs
    • ControlState
    • Cursor
    • Label

Class Renderer

Graphics rendering and batching

Inheritance
System.Object
Renderer
Implements
System.IDisposable
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Inferno.Graphics
Assembly: Inferno.Desktop.dll
Syntax
public class Renderer : IDisposable

Constructors

| Improve this Doc View Source

Renderer(GraphicsDevice)

Create a new renderer

Declaration
public Renderer(GraphicsDevice graphicsDevice)
Parameters
Type Name Description
GraphicsDevice graphicsDevice

The current graphics device

Methods

| Improve this Doc View Source

Begin(RenderSortMode, Nullable<Matrix>)

Begin a drawing batch

Declaration
public void Begin(RenderSortMode sortMode = RenderSortMode.Immediate, Matrix? translationMatrix = default(Matrix? ))
Parameters
Type Name Description
RenderSortMode sortMode

Batch sort mode

System.Nullable<Matrix> translationMatrix

Translation matrix for batch

| Improve this Doc View Source

Dispose()

Clean the renderer

Declaration
public void Dispose()
| Improve this Doc View Source

Draw(RenderTarget, Rectangle, Color, Boolean)

Draw Render Target

Declaration
public void Draw(RenderTarget target, Rectangle destRectangle, Color color, bool disposeAfterDraw = false)
Parameters
Type Name Description
RenderTarget target

Render target

Rectangle destRectangle

Destination rectangle

Color color

Color modifier

System.Boolean disposeAfterDraw

Dispose target after draw

| Improve this Doc View Source

Draw(RenderTarget, Vector2, Color, Boolean)

Draw Render Target

Declaration
public void Draw(RenderTarget target, Vector2 position, Color color, bool disposeAfterDraw = false)
Parameters
Type Name Description
RenderTarget target

Render target

Vector2 position

Position

Color color

Color modifier

System.Boolean disposeAfterDraw

Dispose target after draw

| Improve this Doc View Source

Draw(Texture2D, Color, Single, Rectangle, Nullable<Rectangle>, Vector2, Double, Boolean)

Draw texture

Declaration
public void Draw(Texture2D texture, Color color, float depth, Rectangle destinationRectangle, Rectangle? sourceRectangle, Vector2 origin, double rotation = 0, bool disposeAfterDraw = false)
Parameters
Type Name Description
Texture2D texture

Texture to draw

Color color

Color modifier

System.Single depth

Depth to draw at

Rectangle destinationRectangle

Position and size to draw at

System.Nullable<Rectangle> sourceRectangle

Source rectangle

Vector2 origin

Origin

System.Double rotation

Rotation

System.Boolean disposeAfterDraw

Dispose texture after draw

| Improve this Doc View Source

Draw(Texture2D, Color, Single, Vector2, Nullable<Rectangle>, Vector2, Double, Boolean)

Draw texture

Declaration
public void Draw(Texture2D texture, Color color, float depth, Vector2 position, Rectangle? sourceRectangle, Vector2 origin, double rotation = 0, bool disposeAfterDraw = false)
Parameters
Type Name Description
Texture2D texture

Texture to draw

Color color

Color modifier

System.Single depth

Depth to draw at

Vector2 position

Position

System.Nullable<Rectangle> sourceRectangle

Source rectangle

Vector2 origin

Origin

System.Double rotation

Rotation

System.Boolean disposeAfterDraw

Dispose texture after draw

| Improve this Doc View Source

Draw(Texture2D, Vector2)

Draw a texture

Declaration
public void Draw(Texture2D texture, Vector2 position)
Parameters
Type Name Description
Texture2D texture

Texture to draw

Vector2 position

Position

| Improve this Doc View Source

Draw(Texture2D, Vector2, Color)

Draw texture

Declaration
public void Draw(Texture2D texture, Vector2 position, Color color)
Parameters
Type Name Description
Texture2D texture

Texture to draw

Vector2 position

Position

Color color

Color modifier

| Improve this Doc View Source

Draw(Texture2D, Vector2, Color, Single)

Draw texture

Declaration
public void Draw(Texture2D texture, Vector2 position, Color color, float depth)
Parameters
Type Name Description
Texture2D texture

Textyre to draw

Vector2 position

Position

Color color

Color modifier

System.Single depth

Depth to draw at

| Improve this Doc View Source

DrawCircle(Vector2, Int32, Color, Single, Boolean, Int32, Int32)

Draw circle

Declaration
public void DrawCircle(Vector2 position, int radius, Color color, float depth = 0F, bool filled = true, int lineWidth = 1, int circlePrecision = 24)
Parameters
Type Name Description
Vector2 position

Position to draw at

System.Int32 radius

Circle radius

Color color

Color to draw

System.Single depth

Depth to draw at

System.Boolean filled

Whether or not it is filled

System.Int32 lineWidth

Line width (only affects non filled)

System.Int32 circlePrecision

Lines/Points per circle

| Improve this Doc View Source

DrawLine(Vector2, Vector2, Color, Int32, Single)

Draw a line

Declaration
public void DrawLine(Vector2 a, Vector2 b, Color color, int lineWidth = 1, float depth = 0F)
Parameters
Type Name Description
Vector2 a

Point a

Vector2 b

Point b

Color color

Color of line

System.Int32 lineWidth

Line width

System.Single depth

Line depth

| Improve this Doc View Source

DrawLines(Vector2[], Color, Int32, Single)

Draw a line array

Declaration
public void DrawLines(Vector2[] points, Color color, int lineWidth = 1, float depth = 0F)
Parameters
Type Name Description
Vector2[] points

Points on the line

Color color

Color of line

System.Int32 lineWidth

Line width

System.Single depth

Depth to draw at

| Improve this Doc View Source

DrawRectangle(Rectangle, Color, Single, Boolean, Int32)

Draw Rectangle

Declaration
public void DrawRectangle(Rectangle rect, Color color, float depth = 0F, bool filled = true, int lineWidth = 1)
Parameters
Type Name Description
Rectangle rect

Rectangle to draw

Color color

Color to draw

System.Single depth

Depth to draw at

System.Boolean filled

Whether or not it is filled

System.Int32 lineWidth

Line width (only affects non-filled)

| Improve this Doc View Source

DrawText(String, Vector2, Font)

Draw text

Declaration
public void DrawText(string text, Vector2 position, Font font)
Parameters
Type Name Description
System.String text

Text to draw

Vector2 position

Position to draw

Font font

Font to draw in

| Improve this Doc View Source

DrawText(String, Vector2, Font, Color, Single)

Draw text

Declaration
public void DrawText(string text, Vector2 position, Font font, Color color, float depth = 0F)
Parameters
Type Name Description
System.String text

Text to draw

Vector2 position

Position to draw

Font font

Font to draw in

Color color

Text color

System.Single depth

Depth to draw at

| Improve this Doc View Source

DrawText(String, Vector2, Font, Color, Single, Vector2, Double, Boolean)

Draw text

Declaration
public void DrawText(string text, Vector2 position, Font font, Color color, float depth, Vector2 origin, double rotation, bool disposeAfterDraw = false)
Parameters
Type Name Description
System.String text

Text to draw

Vector2 position

Position to draw

Font font

Font to draw in

Color color

Text color

System.Single depth

Depth to draw at

Vector2 origin

Origin of text

System.Double rotation

Text Rotation

System.Boolean disposeAfterDraw

Dispose font after drawing

| Improve this Doc View Source

End()

End a drawing batch

Declaration
public void End()

Implements

System.IDisposable
  • Improve this Doc
  • View Source
Back to top Generated by DocFX