C# Класс Axiom.Samples.SampleContext

Base class responsible for setting up a common context for samples. May be subclassed for specific sample types (not specific samples). Allows one sample to run at a time, while maintaining a sample queue.
Наследование: IWindowEventListener, SharpInputSystem.IKeyboardListener, SharpInputSystem.IMouseListener, IDisposable
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
ConfigurationManager IConfigurationManager
InputManager SharpInputSystem.InputManager
IsLastRun bool
IsSamplePaused bool
Keyboard SharpInputSystem.Keyboard
LastSample Sample
LastSampleState NameValuePairList
Mouse SharpInputSystem.Mouse
NextRenderer String
Root Axiom.Core.Root

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

Метод Описание
Dispose ( ) : void
FrameEnded ( object sender, FrameEventArgs evt ) : void

Processes frame ended events.

FrameRenderingQueued ( object sender, FrameEventArgs evt ) : void

Processes rendering queued events.

FrameStarted ( object sender, FrameEventArgs evt ) : void

Processes frame started events.

Go ( ) : void

This function encapsulates the entire lifetime of the context.

Go ( Sample initialSample ) : void

This function encapsulates the entire lifetime of the context.

KeyPressed ( SharpInputSystem evt ) : bool
KeyReleased ( SharpInputSystem evt ) : bool
MouseMoved ( SharpInputSystem evt ) : bool
MousePressed ( SharpInputSystem evt, SharpInputSystem id ) : bool
MouseReleased ( SharpInputSystem evt, SharpInputSystem id ) : bool
PauseCurrentSample ( ) : void

Pauses the current running sample

RunSample ( Sample s ) : void

Quits the current sample and starts a new one.

SampleContext ( IConfigurationManager cfgManager ) : System

Creates a new instance of the type SampleContext

UnpauseCurrentSample ( ) : void

Unpauses the current sample

WindowClosed ( Axiom.Graphics.RenderWindow rw ) : void
WindowClosing ( Axiom.Graphics.RenderWindow rw ) : bool
WindowFocusChange ( Axiom.Graphics.RenderWindow rw ) : void
WindowMoved ( Axiom.Graphics.RenderWindow rw ) : void
WindowResized ( Axiom.Graphics.RenderWindow rw ) : void

Processes window size change event. Adjusts mouse's region to match that of the window. You could also override this method to prevent resizing.

Защищенные методы

Метод Описание
CaptureInputDevices ( ) : void

Captures input device states.

CreateInputDevices ( ) : void

Creates the individual input devices. I only create a keyboard and mouse here because they are the most common, but you can override this method for other modes and devices.

CreateRoot ( ) : void

Creates the Axiom root.

CreateWindow ( ) : void

Creates the render window to be used for this context. I use an auto-created window here, but you can also create an external window if you wish. Just don't forget to initialize the root.

LoadResources ( ) : void

Loads context-wide resource groups. I chose here to simply initialise all groups, but you can fully load specific ones if you wish.

LocateResources ( ) : void

Finds context-wide resource groups. I load paths from a config file here, but you can choose your resource locations however you want.

Log ( string msg ) : void

Logs a message to the default logfile.

OneTimeConfig ( ) : bool

Configures the startup settings for Axiom. It will first load the settings from a configuration file, then open a dialog for any further configuration.

Reconfigure ( String renderer, NameValuePairList options ) : void

Reconfigures the context. Attempts to preserve the current sample state.

RecoverLastSample ( ) : void

Recovers the last sample after a reset. You can override in the case that the last sample is destroyed in the process of resetting, and you have to recover it through another means.

Setup ( ) : void

Sets up the context after configuration.

SetupInput ( ) : void

Sets up SIS input.

Shutdown ( ) : void

Cleans up and shuts down the context.

ShutdownInput ( ) : void

Destroys SIS input devices and the input manager.

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

CaptureInputDevices() защищенный метод

Captures input device states.
protected CaptureInputDevices ( ) : void
Результат void

CreateInputDevices() защищенный метод

Creates the individual input devices. I only create a keyboard and mouse here because they are the most common, but you can override this method for other modes and devices.
protected CreateInputDevices ( ) : void
Результат void

CreateRoot() защищенный метод

Creates the Axiom root.
protected CreateRoot ( ) : void
Результат void

CreateWindow() защищенный метод

Creates the render window to be used for this context. I use an auto-created window here, but you can also create an external window if you wish. Just don't forget to initialize the root.
protected CreateWindow ( ) : void
Результат void

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

public Dispose ( ) : void
Результат void

FrameEnded() публичный метод

Processes frame ended events.
public FrameEnded ( object sender, FrameEventArgs evt ) : void
sender object
evt FrameEventArgs
Результат void

FrameRenderingQueued() публичный метод

Processes rendering queued events.
public FrameRenderingQueued ( object sender, FrameEventArgs evt ) : void
sender object
evt FrameEventArgs
Результат void

FrameStarted() публичный метод

Processes frame started events.
public FrameStarted ( object sender, FrameEventArgs evt ) : void
sender object
evt FrameEventArgs
Результат void

Go() публичный метод

This function encapsulates the entire lifetime of the context.
public Go ( ) : void
Результат void

Go() публичный метод

This function encapsulates the entire lifetime of the context.
public Go ( Sample initialSample ) : void
initialSample Sample
Результат void

KeyPressed() публичный метод

public KeyPressed ( SharpInputSystem evt ) : bool
evt SharpInputSystem
Результат bool

KeyReleased() публичный метод

public KeyReleased ( SharpInputSystem evt ) : bool
evt SharpInputSystem
Результат bool

LoadResources() защищенный метод

Loads context-wide resource groups. I chose here to simply initialise all groups, but you can fully load specific ones if you wish.
protected LoadResources ( ) : void
Результат void

LocateResources() защищенный метод

Finds context-wide resource groups. I load paths from a config file here, but you can choose your resource locations however you want.
protected LocateResources ( ) : void
Результат void

Log() защищенный метод

Logs a message to the default logfile.
protected Log ( string msg ) : void
msg string
Результат void

MouseMoved() публичный метод

public MouseMoved ( SharpInputSystem evt ) : bool
evt SharpInputSystem
Результат bool

MousePressed() публичный метод

public MousePressed ( SharpInputSystem evt, SharpInputSystem id ) : bool
evt SharpInputSystem
id SharpInputSystem
Результат bool

MouseReleased() публичный метод

public MouseReleased ( SharpInputSystem evt, SharpInputSystem id ) : bool
evt SharpInputSystem
id SharpInputSystem
Результат bool

OneTimeConfig() защищенный метод

Configures the startup settings for Axiom. It will first load the settings from a configuration file, then open a dialog for any further configuration.
protected OneTimeConfig ( ) : bool
Результат bool

PauseCurrentSample() публичный метод

Pauses the current running sample
public PauseCurrentSample ( ) : void
Результат void

Reconfigure() защищенный метод

Reconfigures the context. Attempts to preserve the current sample state.
protected Reconfigure ( String renderer, NameValuePairList options ) : void
renderer String
options NameValuePairList
Результат void

RecoverLastSample() защищенный метод

Recovers the last sample after a reset. You can override in the case that the last sample is destroyed in the process of resetting, and you have to recover it through another means.
protected RecoverLastSample ( ) : void
Результат void

RunSample() публичный метод

Quits the current sample and starts a new one.
public RunSample ( Sample s ) : void
s Sample
Результат void

SampleContext() публичный метод

Creates a new instance of the type SampleContext
public SampleContext ( IConfigurationManager cfgManager ) : System
cfgManager IConfigurationManager
Результат System

Setup() защищенный метод

Sets up the context after configuration.
protected Setup ( ) : void
Результат void

SetupInput() защищенный метод

Sets up SIS input.
protected SetupInput ( ) : void
Результат void

Shutdown() защищенный метод

Cleans up and shuts down the context.
protected Shutdown ( ) : void
Результат void

ShutdownInput() защищенный метод

Destroys SIS input devices and the input manager.
protected ShutdownInput ( ) : void
Результат void

UnpauseCurrentSample() публичный метод

Unpauses the current sample
public UnpauseCurrentSample ( ) : void
Результат void

WindowClosed() публичный метод

public WindowClosed ( Axiom.Graphics.RenderWindow rw ) : void
rw Axiom.Graphics.RenderWindow
Результат void

WindowClosing() публичный метод

public WindowClosing ( Axiom.Graphics.RenderWindow rw ) : bool
rw Axiom.Graphics.RenderWindow
Результат bool

WindowFocusChange() публичный метод

public WindowFocusChange ( Axiom.Graphics.RenderWindow rw ) : void
rw Axiom.Graphics.RenderWindow
Результат void

WindowMoved() публичный метод

public WindowMoved ( Axiom.Graphics.RenderWindow rw ) : void
rw Axiom.Graphics.RenderWindow
Результат void

WindowResized() публичный метод

Processes window size change event. Adjusts mouse's region to match that of the window. You could also override this method to prevent resizing.
public WindowResized ( Axiom.Graphics.RenderWindow rw ) : void
rw Axiom.Graphics.RenderWindow
Результат void

Описание свойств

ConfigurationManager защищенное свойство

Configuration Manager
protected IConfigurationManager ConfigurationManager
Результат IConfigurationManager

InputManager защищенное свойство

SharpInputSystem Input Manager
protected InputManager,SharpInputSystem InputManager
Результат SharpInputSystem.InputManager

IsLastRun защищенное свойство

Whether or not this is the final run
protected bool IsLastRun
Результат bool

IsSamplePaused защищенное свойство

protected bool IsSamplePaused
Результат bool

Keyboard защищенное свойство

Keyboard Device
protected Keyboard,SharpInputSystem Keyboard
Результат SharpInputSystem.Keyboard

LastSample защищенное свойство

last sample run before reconfiguration
protected Sample LastSample
Результат Sample

LastSampleState защищенное свойство

state of last sample
protected NameValuePairList LastSampleState
Результат NameValuePairList

Mouse защищенное свойство

Mouse Device
protected Mouse,SharpInputSystem Mouse
Результат SharpInputSystem.Mouse

NextRenderer защищенное свойство

Name of renderer used for next run
protected String NextRenderer
Результат String

Root защищенное свойство

Axiom root
protected Root,Axiom.Core Root
Результат Axiom.Core.Root