Class RenderManager
Inheritance
Implements
Inherited Members
Namespace: Evergine.Framework.Managers
Assembly: Evergine.Framework.dll
Syntax
public class RenderManager : DrawableSceneManager, IDependencyObject
Constructors
RenderManager()
Initializes a new instance of the RenderManager class.
Declaration
public RenderManager()
Fields
RenderFeatures
The list of render features.
Declaration
public List<RenderFeature> RenderFeatures
Field Value
| Type | Description |
|---|---|
| List<RenderFeature> |
drawables
The registered drawables.
Declaration
protected List<Drawable> drawables
Field Value
| Type | Description |
|---|---|
| List<Drawable> |
Properties
ActiveCamera3D
Gets or sets the Active Camera3D. This is the main Camera3D of the scene. This instance is suitable for use in behaviors that deal with the camera.
Declaration
public virtual Camera3D ActiveCamera3D { get; set; }
Property Value
| Type | Description |
|---|---|
| Camera3D |
CullingSystem
Gets or sets the culling system used by the Render System. A camera can specify the culling system that it will use.
Declaration
public CullingSystem CullingSystem { get; set; }
Property Value
| Type | Description |
|---|---|
| CullingSystem |
CurrentDrawingCamera3D
Gets the current Camera3D that is used in the Draw cycle. This property is suitable for use in Drawable 2D components.
Declaration
public Camera3D CurrentDrawingCamera3D { get; }
Property Value
| Type | Description |
|---|---|
| Camera3D |
DebugLines
Gets or sets a value indicating whether debug lines are rendered.
Declaration
public bool DebugLines { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
|
LineBatch3D
Gets the render manager's line batch for 3D.
Declaration
public LineBatch3D LineBatch3D { get; }
Property Value
| Type | Description |
|---|---|
| LineBatch3D |
RegisteredCameras
Gets the registered cameras.
Declaration
public IEnumerable<Camera> RegisteredCameras { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<Camera> |
RenderObjectResourcesCache
Gets the rendered object resources cache.
Declaration
public RenderObjectResourcesCache RenderObjectResourcesCache { get; }
Property Value
| Type | Description |
|---|---|
| RenderObjectResourcesCache |
RenderPipeline
Gets the render path.
Declaration
public RenderPipeline RenderPipeline { get; }
Property Value
| Type | Description |
|---|---|
| RenderPipeline |
SortingMesh
Gets or sets the mesh sorting method.
Declaration
public SortingMesh SortingMesh { get; set; }
Property Value
| Type | Description |
|---|---|
| SortingMesh |
Methods
AddCamera(Camera)
Adds a camera.
Declaration
public void AddCamera(Camera camera)
Parameters
| Type | Name | Description |
|---|---|---|
| Camera | camera | The camera. |
AddDrawable(Drawable)
Adds a Drawable to this manager so it is rendered.
Declaration
public void AddDrawable(Drawable drawable)
Parameters
| Type | Name | Description |
|---|---|---|
| Drawable | drawable | The drawable to render. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown if drawable is null. |
AddLight(Light)
Adds a light.
Declaration
public void AddLight(Light light)
Parameters
| Type | Name | Description |
|---|---|---|
| Light | light | The light. |
AddRenderObject(RenderObjectInfo, Drawable)
Adds a mesh to be rendered.
Declaration
public virtual void AddRenderObject(RenderObjectInfo objectInfo, Drawable drawable = null)
Parameters
| Type | Name | Description |
|---|---|---|
| RenderObjectInfo | objectInfo | The mesh to render. |
| Drawable | drawable | The drawable of the render object info. |
CreateRenderPipeline()
Creates the rendering pipeline of the RenderManager.
Declaration
protected virtual RenderPipeline CreateRenderPipeline()
Returns
| Type | Description |
|---|---|
| RenderPipeline | The rendering pipeline. |
Draw(TimeSpan)
Updates this manager.
Declaration
public override void Draw(TimeSpan gameTime)
Parameters
| Type | Name | Description |
|---|---|---|
| TimeSpan | gameTime | The game time. |
Overrides
FindFeatureByObjectType(RenderObjectInfo)
Gets a render feature that is responsible for processing the render object.
Declaration
public RenderFeature FindFeatureByObjectType(RenderObjectInfo renderObjectInfo)
Parameters
| Type | Name | Description |
|---|---|---|
| RenderObjectInfo | renderObjectInfo | The object type. |
Returns
| Type | Description |
|---|---|
| RenderFeature | The render feature. |
FindRenderFeature(Type)
Finds a mesh processor by its type.
Declaration
public RenderFeature FindRenderFeature(Type renderFeatureType)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | renderFeatureType | The mesh processor type. |
Returns
| Type | Description |
|---|---|
| RenderFeature | The render feature. |
FindRenderFeature<T>()
Finds a mesh processor by its type.
Declaration
public T FindRenderFeature<T>() where T : RenderFeature
Returns
| Type | Description |
|---|---|
| T | The mesh processor. |
Type Parameters
| Name | Description |
|---|---|
| T | The mesh processor type. |
OnAttached()
Invoked when the object is attached to the system.
Declaration
protected override bool OnAttached()
Returns
| Type | Description |
|---|---|
| bool | True if everything is OK. |
Overrides
OnDestroy()
Invoked when the object is about to be disposed.
Declaration
protected override void OnDestroy()
Overrides
OnDetach()
Invoked when the object is detached.
Declaration
protected override void OnDetach()
Overrides
OnLoaded()
Invoked when the object is loaded.
Declaration
protected override void OnLoaded()
Overrides
RegisterRenderFeature(RenderFeature)
Registers a render feature.
Declaration
public void RegisterRenderFeature(RenderFeature renderFeature)
Parameters
| Type | Name | Description |
|---|---|---|
| RenderFeature | renderFeature | The render feature. |
RemoveCamera(Camera)
Removes a camera.
Declaration
public void RemoveCamera(Camera camera)
Parameters
| Type | Name | Description |
|---|---|---|
| Camera | camera | The camera. |
RemoveDrawable(Drawable)
Removes a Drawable from this manager so it is not rendered.
Declaration
public void RemoveDrawable(Drawable drawable)
Parameters
| Type | Name | Description |
|---|---|---|
| Drawable | drawable | The drawable to remove. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown if drawable is null. |
RemoveLight(Light)
Removes a light.
Declaration
public void RemoveLight(Light light)
Parameters
| Type | Name | Description |
|---|---|---|
| Light | light | The light. |
RemoveRenderObject(RenderObjectInfo)
Removes a mesh from being rendered.
Declaration
public virtual void RemoveRenderObject(RenderObjectInfo objectInfo)
Parameters
| Type | Name | Description |
|---|---|---|
| RenderObjectInfo | objectInfo | The mesh to be removed from rendering. |
TryGetDisplay(Camera, out Display)
Gets a display ID by its tag.
Declaration
public virtual bool TryGetDisplay(Camera camera, out Display display)
Parameters
| Type | Name | Description |
|---|---|---|
| Camera | camera | The display tag. |
| Display | display | The display. |
Returns
| Type | Description |
|---|---|
| bool | True if the graphic presenter contains a display with the display tag. False otherwise. |
TryGetDisplay(string, out Display)
Gets a display ID by its tag.
Declaration
public virtual bool TryGetDisplay(string displayTag, out Display display)
Parameters
| Type | Name | Description |
|---|---|---|
| string | displayTag | The display tag. |
| Display | display | The display. |
Returns
| Type | Description |
|---|---|
| bool | True if the graphic presenter contains a display with the display tag; false otherwise. |
UnregisterRenderFeature(RenderFeature)
Unregisters a render feature.
Declaration
public void UnregisterRenderFeature(RenderFeature renderFeature)
Parameters
| Type | Name | Description |
|---|---|---|
| RenderFeature | renderFeature | The render feature. |
UnregisterRenderFeature(Type)
Unregisters a render feature.
Declaration
public void UnregisterRenderFeature(Type renderFeatureType)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | renderFeatureType | The render feature type. |
Events
OnAddCamera
Event fires when a camera is registered
Declaration
public event EventHandler<Camera> OnAddCamera
Event Type
| Type | Description |
|---|---|
| EventHandler<Camera> |
OnAddDrawable
Event fired when a drawable is registered.
Declaration
public event EventHandler<Drawable> OnAddDrawable
Event Type
| Type | Description |
|---|---|
| EventHandler<Drawable> |
OnAddLight
Event fired when a light is registered.
Declaration
public event EventHandler<Light> OnAddLight
Event Type
| Type | Description |
|---|---|
| EventHandler<Light> |
OnPostRender
OnPostRender is called after the manager finishes rendering the scene.
Declaration
public event EventHandler<RenderManager> OnPostRender
Event Type
| Type | Description |
|---|---|
| EventHandler<RenderManager> |
OnPreRender
OnPreRender is called before the manager starts rendering the scene.
Declaration
public event EventHandler<RenderManager> OnPreRender
Event Type
| Type | Description |
|---|---|
| EventHandler<RenderManager> |
OnRemoveCamera
Event fired when a camera is removed.
Declaration
public event EventHandler<Camera> OnRemoveCamera
Event Type
| Type | Description |
|---|---|
| EventHandler<Camera> |
OnRemoveDrawable
Event fired when a drawable is removed.
Declaration
public event EventHandler<Drawable> OnRemoveDrawable
Event Type
| Type | Description |
|---|---|
| EventHandler<Drawable> |
OnRemoveLight
Event that is fired when a light is removed
Declaration
public event EventHandler<Light> OnRemoveLight
Event Type
| Type | Description |
|---|---|
| EventHandler<Light> |