Default3DRenderUtilities

Warning

This documentation is for an implementation of a service. This class is not meant to be used directly; instead use the I3DRenderUtilities service via dependency injection to access this functionality.

Information documented here may not be up to date.

class Default3DRenderUtilities : System.Object, I3DRenderUtilities

The default implementation of T:Protogame.I3DRenderUtilities.

public Vector2 MeasureText(IRenderContext context, string text, Protogame.IAssetReference<FontAsset> font)
Parameters:
  • context (Protogame.IRenderContext) –
  • text (string) –
  • font (Protogame.IAssetReference<FontAsset>) –
public void RenderLine(IRenderContext context, Protogame.IEffect effect, Protogame.IEffectParameterSet effectParameterSet, Vector3 start, Vector3 end, Color color)
Parameters:
  • context (Protogame.IRenderContext) –
  • effect (Protogame.IEffect) –
  • effectParameterSet (Protogame.IEffectParameterSet) –
  • start (Microsoft.Xna.Framework.Vector3) –
  • end (Microsoft.Xna.Framework.Vector3) –
  • color (Microsoft.Xna.Framework.Color) –
public void RenderLine(IRenderContext context, Protogame.IEffect effect, Protogame.IEffectParameterSet effectParameterSet, Vector3 start, Vector3 end, Protogame.TextureAsset texture, Vector2 startUV, Vector2 endUV)
Parameters:
  • context (Protogame.IRenderContext) –
  • effect (Protogame.IEffect) –
  • effectParameterSet (Protogame.IEffectParameterSet) –
  • start (Microsoft.Xna.Framework.Vector3) –
  • end (Microsoft.Xna.Framework.Vector3) –
  • texture (Protogame.TextureAsset) –
  • startUV (Microsoft.Xna.Framework.Vector2) –
  • endUV (Microsoft.Xna.Framework.Vector2) –
public void RenderRectangle(IRenderContext context, Protogame.IEffect effect, Protogame.IEffectParameterSet effectParameterSet, Vector3 start, Vector3 end, Color color, bool filled)
Parameters:
  • context (Protogame.IRenderContext) –
  • effect (Protogame.IEffect) –
  • effectParameterSet (Protogame.IEffectParameterSet) –
  • start (Microsoft.Xna.Framework.Vector3) –
  • end (Microsoft.Xna.Framework.Vector3) –
  • color (Microsoft.Xna.Framework.Color) –
  • filled (bool) –
public void RenderText(IRenderContext context, Protogame.IEffect effect, Protogame.IEffectParameterSet effectParameterSet, Matrix matrix, string text, Protogame.IAssetReference<FontAsset> font, HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment, System.Nullable<Color> textColor, bool renderShadow, System.Nullable<Color> shadowColor)
Parameters:
  • context (Protogame.IRenderContext) –
  • effect (Protogame.IEffect) –
  • effectParameterSet (Protogame.IEffectParameterSet) –
  • matrix (Microsoft.Xna.Framework.Matrix) –
  • text (string) –
  • font (Protogame.IAssetReference<FontAsset>) –
  • horizontalAlignment (Protogame.HorizontalAlignment) –
  • verticalAlignment (Protogame.VerticalAlignment) –
  • textColor (System.Nullable<Color>) –
  • renderShadow (bool) –
  • shadowColor (System.Nullable<Color>) –
public void RenderTexture(IRenderContext context, Protogame.IEffect effect, Protogame.IEffectParameterSet effectParameterSet, Matrix matrix, Protogame.IAssetReference<TextureAsset> texture, System.Nullable<Color> color, bool flipHorizontally, bool flipVertically, System.Nullable<Rectangle> sourceArea)
Parameters:
  • context (Protogame.IRenderContext) –
  • effect (Protogame.IEffect) –
  • effectParameterSet (Protogame.IEffectParameterSet) –
  • matrix (Microsoft.Xna.Framework.Matrix) –
  • texture (Protogame.IAssetReference<TextureAsset>) –
  • color (System.Nullable<Color>) –
  • flipHorizontally (bool) –
  • flipVertically (bool) –
  • sourceArea (System.Nullable<Rectangle>) –
public void RenderCube(IRenderContext context, Protogame.IEffect effect, Protogame.IEffectParameterSet effectParameterSet, Matrix transform, Color color)
Parameters:
  • context (Protogame.IRenderContext) –
  • effect (Protogame.IEffect) –
  • effectParameterSet (Protogame.IEffectParameterSet) –
  • transform (Microsoft.Xna.Framework.Matrix) –
  • color (Microsoft.Xna.Framework.Color) –
public void RenderCube(IRenderContext context, Protogame.IEffect effect, Protogame.IEffectParameterSet effectParameterSet, Matrix transform, Protogame.TextureAsset texture, Vector2 topLeftUV, Vector2 bottomRightUV)
Parameters:
  • context (Protogame.IRenderContext) –
  • effect (Protogame.IEffect) –
  • effectParameterSet (Protogame.IEffectParameterSet) –
  • transform (Microsoft.Xna.Framework.Matrix) –
  • texture (Protogame.TextureAsset) –
  • topLeftUV (Microsoft.Xna.Framework.Vector2) –
  • bottomRightUV (Microsoft.Xna.Framework.Vector2) –
public void RenderPlane(IRenderContext context, Protogame.IEffect effect, Protogame.IEffectParameterSet effectParameterSet, Matrix transform, Color color)
Parameters:
  • context (Protogame.IRenderContext) –
  • effect (Protogame.IEffect) –
  • effectParameterSet (Protogame.IEffectParameterSet) –
  • transform (Microsoft.Xna.Framework.Matrix) –
  • color (Microsoft.Xna.Framework.Color) –
public void RenderPlane(IRenderContext context, Protogame.IEffect effect, Protogame.IEffectParameterSet effectParameterSet, Matrix transform, Protogame.TextureAsset texture, Vector2 topLeftUV, Vector2 bottomRightUV)
Parameters:
  • context (Protogame.IRenderContext) –
  • effect (Protogame.IEffect) –
  • effectParameterSet (Protogame.IEffectParameterSet) –
  • transform (Microsoft.Xna.Framework.Matrix) –
  • texture (Protogame.TextureAsset) –
  • topLeftUV (Microsoft.Xna.Framework.Vector2) –
  • bottomRightUV (Microsoft.Xna.Framework.Vector2) –
public void RenderCircle(IRenderContext context, Protogame.IEffect effect, Protogame.IEffectParameterSet effectParameterSet, Matrix transform, Vector2 center, int radius, Color color, bool filled)
Parameters:
  • context (Protogame.IRenderContext) –
  • effect (Protogame.IEffect) –
  • effectParameterSet (Protogame.IEffectParameterSet) –
  • transform (Microsoft.Xna.Framework.Matrix) –
  • center (Microsoft.Xna.Framework.Vector2) –
  • radius (int) –
  • color (Microsoft.Xna.Framework.Color) –
  • filled (bool) –