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
파일 보기 프로젝트 열기: WolfgangSt/axiom

보호된 프로퍼티들

프로퍼티 타입 설명
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