Click or drag to resize
DigitalRuneDebugRenderer Class
Provides methods for rendering debug information.
Inheritance Hierarchy
SystemObject
  DigitalRune.Graphics.RenderingDebugRenderer

Namespace: DigitalRune.Graphics.Rendering
Assembly: DigitalRune.Graphics (in DigitalRune.Graphics.dll) Version: 1.2.0.0 (1.2.1.14562)
Syntax
public class DebugRenderer : IDisposable

The DebugRenderer type exposes the following members.

Constructors
  NameDescription
Public methodDebugRenderer(IGraphicsService, SpriteFont)
Initializes a new instance of the DebugRenderer class.
Public methodDebugRenderer(IGraphicsService, SpriteBatch, SpriteFont) Obsolete.
Initializes a new instance of the DebugRenderer class.
Top
Methods
  NameDescription
Public methodClear
Clears the debug renderer (removes all draw jobs).
Public methodDispose
Releases all resources used by an instance of the DebugRenderer class.
Protected methodDispose(Boolean)
Releases the unmanaged resources used by an instance of the DebugRenderer class and optionally releases the managed resources.
Public methodDrawAabb
Draws an axis-aligned bounding-box (AABB). Wire-frame only.
Public methodDrawAabbs
Draws the axis-aligned bounding-boxes (AABBs) of a collection of geometries.
Public methodDrawArrow
Draws an arrow pointing from start to end.
Public methodDrawAxes
Draws 3 axes for a coordinate cross.
Public methodDrawBox
Draws a box.
Public methodDrawCapsule
Draws a capsule that is centered at the local origin and parallel to the local y axis.
Public methodDrawCone
Draws a cone with the base on the local xz plane pointing up into the local +y direction.
Public methodDrawContact
Draws a contact.
Public methodDrawContacts(ContactSet, Single, NullableColor, Boolean)
Draws contacts.
Public methodDrawContacts(ContactSetCollection, Single, NullableColor, Boolean)
Draws contacts.
Public methodDrawCylinder
Draws a cylinder that is centered at the local origin and parallel to the local y axis.
Public methodDrawLine
Draws a line.
Public methodDrawMesh(Mesh, Pose, Vector3F, Color, Boolean, Boolean)
Draws a mesh.
Public methodDrawMesh(Submesh, Pose, Vector3F, Color, Boolean, Boolean)
Draws a submesh.
Public methodDrawModel(SceneNode, Color, Boolean, Boolean)
Draws a model (meshes without textures).
Public methodDrawModel(Model, Pose, Vector3F, Color, Boolean, Boolean)
Draws a model (without textures).
Public methodDrawObject
Draws a geometric object.
Public methodDrawObjects
Draws geometric objects.
Public methodDrawPoint
Draws a point.
Public methodDrawShape
Draws a geometric object.
Public methodDrawSkeleton(MeshNode, Single, Color, Boolean)
Draws skeleton bones, bone space axes and bone names of a MeshNode for debugging.
Public methodDrawSkeleton(SkeletonPose, Pose, Vector3F, Single, Color, Boolean)
Draws skeleton bones, bone space axes and bone names of a MeshNode for debugging.
Public methodDrawSphere
Draws a sphere.
Public methodDrawText(String)
Draws the text to the screen.
Public methodDrawText(StringBuilder)
Draws the text to the screen.
Public methodDrawText(String, Vector2F, Color)
Draws a text on a 2D position in screen space.
Public methodDrawText(StringBuilder, Vector2F, Color)
Draws a text on a 2D position in screen space.
Public methodDrawText(String, Vector2F, Vector2F, Color)
Draws a text on a 2D position in screen space.
Public methodDrawText(String, Vector3F, Color, Boolean)
Draws a text on a 3D position in world space.
Public methodDrawText(StringBuilder, Vector2F, Vector2F, Color)
Draws a text on a 2D position in screen space.
Public methodDrawText(StringBuilder, Vector3F, Color, Boolean)
Draws a text on a 3D position in world space.
Public methodDrawText(String, Vector3F, Vector2F, Color, Boolean)
Draws a text on a 3D position in world space.
Public methodDrawText(StringBuilder, Vector3F, Vector2F, Color, Boolean)
Draws a text on a 3D position in world space.
Public methodDrawTexture
Draws a texture.
Public methodDrawTriangle(Triangle, Pose, Vector3F, Color, Boolean, Boolean)
Draws a triangle (with counter-clockwise winding for front faces).
Public methodDrawTriangle(Vector3F, Vector3F, Vector3F, Color, Boolean, Boolean)
Draws a triangle (with counter-clockwise winding for front faces).
Public methodDrawTriangle(Triangle, Pose, Vector3F, Vector3F, Color, Boolean, Boolean)
Draws a triangle (with counter-clockwise winding for front faces).
Public methodDrawTriangle(Vector3F, Vector3F, Vector3F, Vector3F, Color, Boolean, Boolean)
Draws a triangle (with counter-clockwise winding for front faces).
Public methodDrawTriangles
Draws the triangles of the given mesh (with counter-clockwise winding for front faces).
Public methodDrawViewVolume(ViewVolume, Pose, Color, Boolean, Boolean)
Draws a view volume (viewing frustum).
Public methodDrawViewVolume(ViewVolume, Pose, Vector3F, Color, Boolean, Boolean)
Draws a view volume (viewing frustum).
Public methodDrawViewVolume(Boolean, Single, Single, Single, Single, Single, Single, Pose, Color, Boolean, Boolean)
Draws a view volume (viewing frustum).
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodRender
Draws the debug information.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodUpdate Obsolete.
Updates the internal caches of the DebugRenderer. (Usually you do not need to call this method, see remarks.)
Top
Properties
  NameDescription
Public propertyArrowHeadSize
Gets or sets the size of the arrow head (relative to the arrow length).
Public propertyAutoRenderStates
Gets or sets a value indicating whether the debug renderer automatically sets the required render states (depth-stencil, blend and rasterizer states required to render solid or wireframe, in or over scene, opaque or transparent).
Public propertyDefaultColor
Gets or sets the default color that is used if no color is explicitly specified.
Public propertyDefaultTextPosition
Gets or sets the default text position.
Public propertyEffect
Gets the effect used for rendering.
Public propertyEnabled
Gets or sets a value indicating whether this DebugRenderer is enabled.
Public propertyIsDisposed
Gets a value indicating whether this instance has been disposed of.
Public propertyPointSize
Gets or sets the size of drawn points.
Public propertySpriteFont
Gets or sets the sprite font.
Top
Remarks

This class is your one-stop-shop for simple debug rendering. It has several DrawXyz() methods to draw points, lines, geometric objects, text, textures, etc. Calling a DrawXyz() method does not immediately draw something - instead the draw job is cached and all draw jobs are rendered when Render(RenderContext) is called. Clear can be used to remove all current draw jobs.

Many draw calls allow to specify a flag "drawOverScene". If this flag is set, the objects are drawn over the scene - they ignore the z-buffer information of the scene. Many draw calls for solid shapes allow to specify a flag "drawWireFrame". If this flag is set, a simplified line representation is drawn instead of solid faces.

For text rendering, a SpriteFont must be set. The DebugRenderer does not have a default sprite font.

Primitives drawn with solid faces can be transparent. All color values use non-premultiplied alpha.

This class assumes that all input color values are non-premultiplied alpha values.

Render Target and Viewport:
This renderer renders into the current render target and viewport of the graphics device.

See Also