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 RenderFeature list.
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
ActiveCamera2D
Gets or sets the Active Camera2D. This is the main camera 2D of the scene. This instance is suitable to use in behaviors that deal with the camera.
Declaration
public Camera2D ActiveCamera2D { get; set; }
Property Value
Type | Description |
---|---|
Camera2D |
ActiveCamera3D
Gets or sets the Active Camera3D. This is the main camera 3D of the scene. This instance is suitable to 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 could 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 to use in Drawables 2D components.
Declaration
public Camera3D CurrentDrawingCamera3D { get; }
Property Value
Type | Description |
---|---|
Camera3D |
DebugLines
Gets or sets a value indicating whether debug lines will be rendered.
Declaration
public bool DebugLines { get; set; }
Property Value
Type | Description |
---|---|
bool |
|
LineBatch2D
Gets the render manager line batch 2D.
Declaration
public LineBatch2D LineBatch2D { get; }
Property Value
Type | Description |
---|---|
LineBatch2D |
LineBatch3D
Gets the render manager line batch 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 render 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 sorting mesh method.
Declaration
public SortingMesh SortingMesh { get; set; }
Property Value
Type | Description |
---|---|
SortingMesh |
Methods
AddCamera(Camera)
Add 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 | If drawable is null. |
AddLight(Light)
Add a light.
Declaration
public void AddLight(Light light)
Parameters
Type | Name | Description |
---|---|---|
Light | light | The light. |
AddRenderObject(RenderObjectInfo, Drawable)
Add 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 render pipeline of the RenderManager.
Declaration
protected virtual RenderPipeline CreateRenderPipeline()
Returns
Type | Description |
---|---|
RenderPipeline | The render pipeline. |
Draw(TimeSpan)
Update 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 to process 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)
Find 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>()
Find 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 all is OK. |
Overrides
OnDestroy()
Invoked when the object is going 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)
Register a render feature.
Declaration
public void RegisterRenderFeature(RenderFeature renderFeature)
Parameters
Type | Name | Description |
---|---|---|
RenderFeature | renderFeature | The render feature. |
RemoveCamera(Camera)
Remove 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 | If drawable is null. |
RemoveLight(Light)
Remove a light.
Declaration
public void RemoveLight(Light light)
Parameters
Type | Name | Description |
---|---|---|
Light | light | The light. |
RemoveRenderObject(RenderObjectInfo)
Remove a mesh to be rendered.
Declaration
public virtual void RemoveRenderObject(RenderObjectInfo objectInfo)
Parameters
Type | Name | Description |
---|---|---|
RenderObjectInfo | objectInfo | The mesh to render. |
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)
Unregister a render feature.
Declaration
public void UnregisterRenderFeature(RenderFeature renderFeature)
Parameters
Type | Name | Description |
---|---|---|
RenderFeature | renderFeature | The render feature. |
UnregisterRenderFeature(Type)
Unregister a render feature.
Declaration
public void UnregisterRenderFeature(Type renderFeatureType)
Parameters
Type | Name | Description |
---|---|---|
Type | renderFeatureType | The render feature type. |
Events
OnAddCamera
Event fired 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 finished 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 fired when a light is removed
Declaration
public event EventHandler<Light> OnRemoveLight
Event Type
Type | Description |
---|---|
EventHandler<Light> |