C# Class Axiom.Core.Root

The Engine class is the main container of all the subsystems. This includes the RenderSystem, various ResourceManagers, etc.
Inheritance: IDisposable
Afficher le fichier Open project: WolfgangSt/axiom Class Usage Examples

Méthodes publiques

Méthode Description
AddMovableObjectFactory ( MovableObjectFactory fact, bool overrideExisting ) : void

Register a new MovableObjectFactory which will create new MovableObject instances of a particular type, as identified by the Type property.

Plugin creators can create subclasses of MovableObjectFactory which construct custom subclasses of MovableObject for insertion in the scene. This is the primary way that plugins can make custom objects available.

AddSceneManagerFactory ( SceneManagerFactory factory ) : void

Registers a new SceneManagerFactory, a factory object for creating instances of specific SceneManagers.

Plugins should call this to register as new SceneManager providers.

ConvertColor ( ColorEx color ) : int

Asks the current API to convert an instance of ColorEx to a 4 byte packed int value the way it would expect it.

CreateRenderWindow ( string name, int width, int height, bool isFullScreen ) : Axiom.Graphics.RenderWindow

Overloaded method.

CreateRenderWindow ( string name, int width, int height, bool isFullscreen, NamedParameterList miscParams ) : Axiom.Graphics.RenderWindow

A collection of addition render system specific options.

CreateSceneManager ( SceneType sceneType ) : SceneManager

Creates a SceneManager instance based on scene type support.

Creates an instance of a SceneManager which supports the scene types identified in the parameter. If more than one type of SceneManager has been registered as handling that combination of scene types, in instance of the last one registered is returned.

CreateSceneManager ( SceneType sceneType, string instanceName ) : SceneManager

Creates a SceneManager instance based on scene type support.

Creates an instance of a SceneManager which supports the scene types identified in the parameter. If more than one type of SceneManager has been registered as handling that combination of scene types, in instance of the last one registered is returned.

CreateSceneManager ( string typeName ) : SceneManager

Creates a SceneManager instance of a given type.

You can use this method to create a SceneManager instance of a given specific type. You may know this type already, or you may have discovered it by looking at the results from Root.GetSceneManagerMetaData.

CreateSceneManager ( string typeName, string instanceName ) : SceneManager

Creates a SceneManager instance of a given type.

You can use this method to create a SceneManager instance of a given specific type. You may know this type already, or you may have discovered it by looking at the results from Root.GetSceneManagerMetaData.

DestroySceneManager ( SceneManager instance ) : void

Destroys an instance of a SceneManager.

DetachRenderTarget ( RenderTarget target ) : void

Dispose ( ) : void

Called to shutdown the engine and dispose of all it's resources.

GetMovableObjectFactory ( string typeName ) : MovableObjectFactory

Get a MovableObjectFactory for the given type.

GetSceneManager ( string instanceName ) : SceneManager

Gets an existing SceneManager instance that has already been created, identified by the instance name.

GetSceneManagerMetaData ( string typeName ) : SceneManagerMetaData

Gets more information about a given type of SceneManager.

The metadata returned tells you a few things about a given type of SceneManager, which can be created using a factory that has been registered already.

HasMovableObjectFactory ( string typeName ) : bool

Checks whether a factory is registered for a given MovableObject type

Initialize ( bool autoCreateWindow ) : Axiom.Graphics.RenderWindow

Initializes the renderer.

This method can only be called after a renderer has been selected with Root.RenderSystem, and it will initialize the selected rendering system ready for use.

Initialize ( bool autoCreateWindow, string windowTitle ) : Axiom.Graphics.RenderWindow

Initializes the renderer.

This method can only be called after a renderer has been selected with Root.RenderSystem, and it will initialize the selected rendering system ready for use.

NextMovableObjectTypeFlag ( ) : uint

Allocate and retrieve the next MovableObject type flag.

This is done automatically if MovableObjectFactory.RequestTypeFlags returns true; don't call this manually unless you're sure you need to.

OnFrameEnded ( ) : bool

Method for raising frame ended events.

This method is only for internal use when you use the built-in rendering loop (Root.StartRendering). However, if you run your own rendering loop then you should call this method to ensure that FrameEvent handlers are notified of frame events; processes like texture animation and particle systems rely on this.

This method calculates the frame timing information for you based on the elapsed time. If you want to specify elapsed times yourself you should call the other version of this method which takes event details as a parameter.

OnFrameEnded ( FrameEventArgs e ) : bool

Method for raising frame ended events.

This method is only for internal use when you use the built-in rendering loop (Root.StartRendering). However, if you run your own rendering loop then you should call this method to ensure that FrameEvent handlers are notified of frame events; processes like texture animation and particle systems rely on this.

This method takes an event object as a parameter, so you can specify the times yourself. If you are happy for the engine to automatically calculate the frame time for you, then call the other version of this method with no parameters.

OnFrameRenderingQueued ( ) : bool

Method for raising frame rendering queued events.

This method is only for internal use when you use the built-in rendering loop (Root.StartRendering). However, if you run your own rendering loop then you you may want to call this method too, although nothing in Axiom relies on this particular event. Really if you're running your own rendering loop at this level of detail then you can get the same effect as doing your updates in a OnFrameRenderingQueued event by just calling with the 'swapBuffers' option set to false.

OnFrameRenderingQueued ( FrameEventArgs e ) : bool

Method for raising frame rendering queued events.

This method is only for internal use when you use the built-in rendering loop (Root.StartRendering). However, if you run your own rendering loop then you you may want to call this method too, although nothing in Axiom relies on this particular event. Really if you're running your own rendering loop at this level of detail then you can get the same effect as doing your updates in a OnFrameRenderingQueued event by just calling with the 'swapBuffers' option set to false.

OnFrameStarted ( ) : bool

Method for raising frame started events.

This method is only for internal use when you use the built-in rendering loop (Root.StartRendering). However, if you run your own rendering loop then you should call this method to ensure that FrameEvent handlers are notified of frame events; processes like texture animation and particle systems rely on this.

This method calculates the frame timing information for you based on the elapsed time. If you want to specify elapsed times yourself you should call the other version of this method which takes event details as a parameter.

OnFrameStarted ( FrameEventArgs e ) : bool

Method for raising frame started events.

This method is only for internal use when you use the built-in rendering loop (Root.StartRendering). However, if you run your own rendering loop then you should call this method to ensure that FrameEvent handlers are notified of frame events; processes like texture animation and particle systems rely on this.

This method takes an event object as a parameter, so you can specify the times yourself. If you are happy for the engine to automatically calculate the frame time for you, then call the other version of this method with no parameters.

QueueEndRendering ( ) : void

Requests that the rendering engine shutdown at the beginning of the next frame.

RemoveMovableObjectFactory ( MovableObjectFactory fact ) : void

Removes a previously registered MovableObjectFactory.

All instances of objects created by this factory will be destroyed before removing the factory (by calling back the factories 'DestroyInstance' method). The plugin writer is responsible for actually destroying the factory.

RemoveSceneManagerFactory ( SceneManagerFactory factory ) : void

Unregisters a SceneManagerFactory.

RenderOneFrame ( ) : bool

Renders one frame.

Updates all the render targets automatically and then returns, raising frame events before and after.

Root ( ) : System

Constructor.

This public contructor is intended for the user to decide when the Root object gets instantiated. This is a critical step in preparing the engine for use.

Root ( string logFilename ) : System

Constructor.

This public contructor is intended for the user to decide when the Root object gets instantiated. This is a critical step in preparing the engine for use.

Shutdown ( ) : void

Shuts down the engine and unloads plugins.

StartRendering ( ) : void

Starts the default rendering loop.

UpdateAllRenderTargets ( ) : bool

Internal method used for updating all RenderTarget objects (windows, renderable textures etc) which are set to auto-update.

You don't need to use this method if you're using Axiom's own internal rendering loop (Root.StartRendering). If you're running your own loop you may wish to call it to update all the render targets which are set to auto update (RenderTarget.IsAutoUpdated). You can also update individual RenderTarget instances using their own Update() method.

Private Methods

Méthode Description
CalculateEventTime ( long time, FrameEventType type ) : float

Internal method for calculating the average time between recently fired events.

CaptureCurrentTime ( ) : long
OneTimePostWindowInit ( ) : void

Internal method for one-time tasks after first window creation.

Method Details

AddMovableObjectFactory() public méthode

Register a new MovableObjectFactory which will create new MovableObject instances of a particular type, as identified by the Type property.
Plugin creators can create subclasses of MovableObjectFactory which construct custom subclasses of MovableObject for insertion in the scene. This is the primary way that plugins can make custom objects available.
public AddMovableObjectFactory ( MovableObjectFactory fact, bool overrideExisting ) : void
fact MovableObjectFactory /// The factory instance. ///
overrideExisting bool /// Set this to true to override any existing /// factories which are registered for the same type. You should only /// change this if you are very sure you know what you're doing. ///
Résultat void

AddSceneManagerFactory() public méthode

Registers a new SceneManagerFactory, a factory object for creating instances of specific SceneManagers.
Plugins should call this to register as new SceneManager providers.
public AddSceneManagerFactory ( SceneManagerFactory factory ) : void
factory SceneManagerFactory
Résultat void

ConvertColor() public méthode

Asks the current API to convert an instance of ColorEx to a 4 byte packed int value the way it would expect it.
public ConvertColor ( ColorEx color ) : int
color ColorEx
Résultat int

CreateRenderWindow() public méthode

Overloaded method.
public CreateRenderWindow ( string name, int width, int height, bool isFullScreen ) : Axiom.Graphics.RenderWindow
name string
width int
height int
isFullScreen bool
Résultat Axiom.Graphics.RenderWindow

CreateRenderWindow() public méthode

A collection of addition render system specific options.
public CreateRenderWindow ( string name, int width, int height, bool isFullscreen, NamedParameterList miscParams ) : Axiom.Graphics.RenderWindow
name string
width int
height int
isFullscreen bool
miscParams NamedParameterList
Résultat Axiom.Graphics.RenderWindow

CreateSceneManager() public méthode

Creates a SceneManager instance based on scene type support.
Creates an instance of a SceneManager which supports the scene types identified in the parameter. If more than one type of SceneManager has been registered as handling that combination of scene types, in instance of the last one registered is returned.
public CreateSceneManager ( SceneType sceneType ) : SceneManager
sceneType SceneType A mask containing one or more flags.
Résultat SceneManager

CreateSceneManager() public méthode

Creates a SceneManager instance based on scene type support.
Creates an instance of a SceneManager which supports the scene types identified in the parameter. If more than one type of SceneManager has been registered as handling that combination of scene types, in instance of the last one registered is returned.
public CreateSceneManager ( SceneType sceneType, string instanceName ) : SceneManager
sceneType SceneType A mask containing one or more flags.
instanceName string /// Optional name to given the new instance that is /// created. If you leave this blank, an auto name will be assigned. ///
Résultat SceneManager

CreateSceneManager() public méthode

Creates a SceneManager instance of a given type.
You can use this method to create a SceneManager instance of a given specific type. You may know this type already, or you may have discovered it by looking at the results from Root.GetSceneManagerMetaData.
public CreateSceneManager ( string typeName ) : SceneManager
typeName string String identifying a unique SceneManager type.
Résultat SceneManager

CreateSceneManager() public méthode

Creates a SceneManager instance of a given type.
You can use this method to create a SceneManager instance of a given specific type. You may know this type already, or you may have discovered it by looking at the results from Root.GetSceneManagerMetaData.
public CreateSceneManager ( string typeName, string instanceName ) : SceneManager
typeName string String identifying a unique SceneManager type.
instanceName string /// Optional name to given the new instance that is created. /// If you leave this blank, an auto name will be assigned. ///
Résultat SceneManager

DestroySceneManager() public méthode

Destroys an instance of a SceneManager.
public DestroySceneManager ( SceneManager instance ) : void
instance SceneManager
Résultat void

DetachRenderTarget() public méthode

public DetachRenderTarget ( RenderTarget target ) : void
target Axiom.Graphics.RenderTarget
Résultat void

Dispose() public méthode

Called to shutdown the engine and dispose of all it's resources.
public Dispose ( ) : void
Résultat void

GetMovableObjectFactory() public méthode

Get a MovableObjectFactory for the given type.
public GetMovableObjectFactory ( string typeName ) : MovableObjectFactory
typeName string /// The factory type to obtain. ///
Résultat MovableObjectFactory

GetSceneManager() public méthode

Gets an existing SceneManager instance that has already been created, identified by the instance name.
public GetSceneManager ( string instanceName ) : SceneManager
instanceName string The name of the instance to retrieve.
Résultat SceneManager

GetSceneManagerMetaData() public méthode

Gets more information about a given type of SceneManager.
The metadata returned tells you a few things about a given type of SceneManager, which can be created using a factory that has been registered already.
public GetSceneManagerMetaData ( string typeName ) : SceneManagerMetaData
typeName string /// The type name of the SceneManager you want to enquire on. /// If you don't know the typeName already, you can iterate over the /// metadata for all types using getMetaDataIterator. ///
Résultat SceneManagerMetaData

HasMovableObjectFactory() public méthode

Checks whether a factory is registered for a given MovableObject type
public HasMovableObjectFactory ( string typeName ) : bool
typeName string /// The factory type to check for. ///
Résultat bool

Initialize() public méthode

Initializes the renderer.
This method can only be called after a renderer has been selected with Root.RenderSystem, and it will initialize the selected rendering system ready for use.
public Initialize ( bool autoCreateWindow ) : Axiom.Graphics.RenderWindow
autoCreateWindow bool /// If true, a rendering window will automatically be created. The window will be /// created based on the options currently set on the render system. ///
Résultat Axiom.Graphics.RenderWindow

Initialize() public méthode

Initializes the renderer.
This method can only be called after a renderer has been selected with Root.RenderSystem, and it will initialize the selected rendering system ready for use.
public Initialize ( bool autoCreateWindow, string windowTitle ) : Axiom.Graphics.RenderWindow
autoCreateWindow bool /// If true, a rendering window will automatically be created The window will be /// created based on the options currently set on the render system. ///
windowTitle string Title to use by the window.
Résultat Axiom.Graphics.RenderWindow

NextMovableObjectTypeFlag() public méthode

Allocate and retrieve the next MovableObject type flag.
This is done automatically if MovableObjectFactory.RequestTypeFlags returns true; don't call this manually unless you're sure you need to.
public NextMovableObjectTypeFlag ( ) : uint
Résultat uint

OnFrameEnded() public méthode

Method for raising frame ended events.
This method is only for internal use when you use the built-in rendering loop (Root.StartRendering). However, if you run your own rendering loop then you should call this method to ensure that FrameEvent handlers are notified of frame events; processes like texture animation and particle systems rely on this.

This method calculates the frame timing information for you based on the elapsed time. If you want to specify elapsed times yourself you should call the other version of this method which takes event details as a parameter.

public OnFrameEnded ( ) : bool
Résultat bool

OnFrameEnded() public méthode

Method for raising frame ended events.
This method is only for internal use when you use the built-in rendering loop (Root.StartRendering). However, if you run your own rendering loop then you should call this method to ensure that FrameEvent handlers are notified of frame events; processes like texture animation and particle systems rely on this.

This method takes an event object as a parameter, so you can specify the times yourself. If you are happy for the engine to automatically calculate the frame time for you, then call the other version of this method with no parameters.

public OnFrameEnded ( FrameEventArgs e ) : bool
e FrameEventArgs /// Event object which includes all the timing information which must already be /// calculated. RequestShutdown should be checked after each call, because that means /// an event handler is requesting that shudown begin for one reason or another. ///
Résultat bool

OnFrameRenderingQueued() public méthode

Method for raising frame rendering queued events.
This method is only for internal use when you use the built-in rendering loop (Root.StartRendering). However, if you run your own rendering loop then you you may want to call this method too, although nothing in Axiom relies on this particular event. Really if you're running your own rendering loop at this level of detail then you can get the same effect as doing your updates in a OnFrameRenderingQueued event by just calling with the 'swapBuffers' option set to false.
public OnFrameRenderingQueued ( ) : bool
Résultat bool

OnFrameRenderingQueued() public méthode

Method for raising frame rendering queued events.
This method is only for internal use when you use the built-in rendering loop (Root.StartRendering). However, if you run your own rendering loop then you you may want to call this method too, although nothing in Axiom relies on this particular event. Really if you're running your own rendering loop at this level of detail then you can get the same effect as doing your updates in a OnFrameRenderingQueued event by just calling with the 'swapBuffers' option set to false.
public OnFrameRenderingQueued ( FrameEventArgs e ) : bool
e FrameEventArgs
Résultat bool

OnFrameStarted() public méthode

Method for raising frame started events.
This method is only for internal use when you use the built-in rendering loop (Root.StartRendering). However, if you run your own rendering loop then you should call this method to ensure that FrameEvent handlers are notified of frame events; processes like texture animation and particle systems rely on this.

This method calculates the frame timing information for you based on the elapsed time. If you want to specify elapsed times yourself you should call the other version of this method which takes event details as a parameter.

public OnFrameStarted ( ) : bool
Résultat bool

OnFrameStarted() public méthode

Method for raising frame started events.
This method is only for internal use when you use the built-in rendering loop (Root.StartRendering). However, if you run your own rendering loop then you should call this method to ensure that FrameEvent handlers are notified of frame events; processes like texture animation and particle systems rely on this.

This method takes an event object as a parameter, so you can specify the times yourself. If you are happy for the engine to automatically calculate the frame time for you, then call the other version of this method with no parameters.

public OnFrameStarted ( FrameEventArgs e ) : bool
e FrameEventArgs /// Event object which includes all the timing information which must already be /// calculated. RequestShutdown should be checked after each call, because that means /// an event handler is requesting that shudown begin for one reason or another. ///
Résultat bool

QueueEndRendering() public méthode

Requests that the rendering engine shutdown at the beginning of the next frame.
public QueueEndRendering ( ) : void
Résultat void

RemoveMovableObjectFactory() public méthode

Removes a previously registered MovableObjectFactory.
All instances of objects created by this factory will be destroyed before removing the factory (by calling back the factories 'DestroyInstance' method). The plugin writer is responsible for actually destroying the factory.
public RemoveMovableObjectFactory ( MovableObjectFactory fact ) : void
fact MovableObjectFactory The instance to remove.
Résultat void

RemoveSceneManagerFactory() public méthode

Unregisters a SceneManagerFactory.
public RemoveSceneManagerFactory ( SceneManagerFactory factory ) : void
factory SceneManagerFactory
Résultat void

RenderOneFrame() public méthode

Renders one frame.
Updates all the render targets automatically and then returns, raising frame events before and after.
public RenderOneFrame ( ) : bool
Résultat bool

Root() public méthode

Constructor.
This public contructor is intended for the user to decide when the Root object gets instantiated. This is a critical step in preparing the engine for use.
public Root ( ) : System
Résultat System

Root() public méthode

Constructor.
This public contructor is intended for the user to decide when the Root object gets instantiated. This is a critical step in preparing the engine for use.
public Root ( string logFilename ) : System
logFilename string Name of the default log file.
Résultat System

Shutdown() public méthode

Shuts down the engine and unloads plugins.
public Shutdown ( ) : void
Résultat void

StartRendering() public méthode

Starts the default rendering loop.
public StartRendering ( ) : void
Résultat void

UpdateAllRenderTargets() public méthode

Internal method used for updating all RenderTarget objects (windows, renderable textures etc) which are set to auto-update.
You don't need to use this method if you're using Axiom's own internal rendering loop (Root.StartRendering). If you're running your own loop you may wish to call it to update all the render targets which are set to auto update (RenderTarget.IsAutoUpdated). You can also update individual RenderTarget instances using their own Update() method.
public UpdateAllRenderTargets ( ) : bool
Résultat bool