C# Класс Axiom.Core.Root

The Engine class is the main container of all the subsystems. This includes the RenderSystem, various ResourceManagers, etc.
Наследование: IDisposable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
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.

Описание методов

AddMovableObjectFactory() публичный Метод

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. ///
Результат void

AddSceneManagerFactory() публичный Метод

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
Результат void

ConvertColor() публичный Метод

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
Результат int

CreateRenderWindow() публичный Метод

Overloaded method.
public CreateRenderWindow ( string name, int width, int height, bool isFullScreen ) : Axiom.Graphics.RenderWindow
name string
width int
height int
isFullScreen bool
Результат Axiom.Graphics.RenderWindow

CreateRenderWindow() публичный Метод

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
Результат Axiom.Graphics.RenderWindow

CreateSceneManager() публичный Метод

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.
Результат SceneManager

CreateSceneManager() публичный Метод

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. ///
Результат SceneManager

CreateSceneManager() публичный Метод

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.
Результат SceneManager

CreateSceneManager() публичный Метод

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. ///
Результат SceneManager

DestroySceneManager() публичный Метод

Destroys an instance of a SceneManager.
public DestroySceneManager ( SceneManager instance ) : void
instance SceneManager
Результат void

DetachRenderTarget() публичный Метод

public DetachRenderTarget ( RenderTarget target ) : void
target Axiom.Graphics.RenderTarget
Результат void

Dispose() публичный Метод

Called to shutdown the engine and dispose of all it's resources.
public Dispose ( ) : void
Результат void

GetMovableObjectFactory() публичный Метод

Get a MovableObjectFactory for the given type.
public GetMovableObjectFactory ( string typeName ) : MovableObjectFactory
typeName string /// The factory type to obtain. ///
Результат MovableObjectFactory

GetSceneManager() публичный Метод

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.
Результат SceneManager

GetSceneManagerMetaData() публичный Метод

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. ///
Результат SceneManagerMetaData

HasMovableObjectFactory() публичный Метод

Checks whether a factory is registered for a given MovableObject type
public HasMovableObjectFactory ( string typeName ) : bool
typeName string /// The factory type to check for. ///
Результат bool

Initialize() публичный Метод

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. ///
Результат Axiom.Graphics.RenderWindow

Initialize() публичный Метод

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.
Результат Axiom.Graphics.RenderWindow

NextMovableObjectTypeFlag() публичный Метод

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
Результат uint

OnFrameEnded() публичный Метод

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
Результат bool

OnFrameEnded() публичный Метод

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. ///
Результат bool

OnFrameRenderingQueued() публичный Метод

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
Результат bool

OnFrameRenderingQueued() публичный Метод

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
Результат bool

OnFrameStarted() публичный Метод

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
Результат bool

OnFrameStarted() публичный Метод

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. ///
Результат bool

QueueEndRendering() публичный Метод

Requests that the rendering engine shutdown at the beginning of the next frame.
public QueueEndRendering ( ) : void
Результат void

RemoveMovableObjectFactory() публичный Метод

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.
Результат void

RemoveSceneManagerFactory() публичный Метод

Unregisters a SceneManagerFactory.
public RemoveSceneManagerFactory ( SceneManagerFactory factory ) : void
factory SceneManagerFactory
Результат void

RenderOneFrame() публичный Метод

Renders one frame.
Updates all the render targets automatically and then returns, raising frame events before and after.
public RenderOneFrame ( ) : bool
Результат bool

Root() публичный Метод

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
Результат System

Root() публичный Метод

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.
Результат System

Shutdown() публичный Метод

Shuts down the engine and unloads plugins.
public Shutdown ( ) : void
Результат void

StartRendering() публичный Метод

Starts the default rendering loop.
public StartRendering ( ) : void
Результат void

UpdateAllRenderTargets() публичный Метод

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
Результат bool