C# Class ModelViewer.Renderer.Sample

Implements core application logic of a SlimDX sample. The Sample class provides a minimal wrapper around window setup, user interaction, and OS-level details, but provides very little abstraction of the underlying DirectX functionality. The reason for this is that the purpose of a SlimDX sample is to illustrate how a particular technique might be implemented using SlimDX; providing high level rendering abstractions in the sample framework simplify obfuscates that. A sample is implemented by overriding various base class methods (those prefixed with "on").
Inheritance: IDisposable
Mostra file Open project: nohbdy/ffxivmodelviewer

Protected Properties

Property Type Description
EnableCamera bool
arcBall ModelViewer.ArcBall
cameraForward SlimDX.Vector3
cameraForwardDirection float
cameraPosition SlimDX.Vector3
cameraRaiseDirection float
cameraRight SlimDX.Vector3
cameraStrafeDirection float
cameraUp SlimDX.Vector3
cameraVelocity float
globalSettings ModelViewer.Renderer.GlobalRenderSettings
renderList List
sceneOffset SlimDX.Vector3
zoom float
zoomSensitivity float

Public Methods

Method Description
Dispose ( ) : void

Disposes of object resources.

Run ( ) : void

Runs the sample.

Sample ( ) : System

Protected Methods

Method Description
CreateForm ( SampleConfiguration config ) : Form
Dispose ( bool disposeManagedResources ) : void

Disposes of object resources.

InitializeDevice ( DeviceSettings9 settings ) : void

Initializes a Direct3D9 device context according to the specified settings. The base class retains ownership of the context and will dispose of it when appropriate.

OnConfigure ( ) : SampleConfiguration

In a derived class, implements logic to control the configuration of the sample via a SampleConfiguration object.

OnInitialize ( ) : void

In a derived class, implements logic to initialize the sample.

OnKeyDown ( object sender, KeyEventArgs e ) : void
OnKeyUp ( object sender, KeyEventArgs e ) : void
OnRender ( ) : void

In a derived class, implements logic to render the sample.

OnRenderBegin ( bool isScreenshot ) : void

In a derived class, implements logic that should occur before all other rendering.

OnRenderEnd ( bool isScreenshot ) : void

In a derived class, implements logic that should occur after all other rendering.

OnResourceLoad ( ) : void
OnResourceUnload ( ) : void
OnUpdate ( ) : void

In a derived class, implements logic to update any relevant sample state.

Quit ( ) : void

Quits the sample.

Private Methods

Method Description
HandleKeyDown ( object sender, KeyEventArgs e ) : void

Handles a key down event.

HandleKeyUp ( object sender, KeyEventArgs e ) : void

Handles a key up event.

HandleMouseClick ( object sender, MouseEventArgs e ) : void

Handles a mouse click event.

HandleMouseDown ( object sender, MouseEventArgs e ) : void
HandleMouseMove ( object sender, MouseEventArgs e ) : void
HandleMouseUp ( object sender, MouseEventArgs e ) : void
HandleResize ( object sender, EventArgs e ) : void
Render ( bool isScreenshot ) : void

Renders the sample.

RenderScreenshot ( ) : void
Update ( ) : void

Updates sample state.

Method Details

CreateForm() protected method

protected CreateForm ( SampleConfiguration config ) : Form
config SampleConfiguration
return System.Windows.Forms.Form

Dispose() public method

Disposes of object resources.
public Dispose ( ) : void
return void

Dispose() protected method

Disposes of object resources.
protected Dispose ( bool disposeManagedResources ) : void
disposeManagedResources bool If true, managed resources should be /// disposed of in addition to unmanaged resources.
return void

InitializeDevice() protected method

Initializes a Direct3D9 device context according to the specified settings. The base class retains ownership of the context and will dispose of it when appropriate.
protected InitializeDevice ( DeviceSettings9 settings ) : void
settings DeviceSettings9 The settings.
return void

OnConfigure() protected method

In a derived class, implements logic to control the configuration of the sample via a SampleConfiguration object.
protected OnConfigure ( ) : SampleConfiguration
return SampleConfiguration

OnInitialize() protected method

In a derived class, implements logic to initialize the sample.
protected OnInitialize ( ) : void
return void

OnKeyDown() protected method

protected OnKeyDown ( object sender, KeyEventArgs e ) : void
sender object
e System.Windows.Forms.KeyEventArgs
return void

OnKeyUp() protected method

protected OnKeyUp ( object sender, KeyEventArgs e ) : void
sender object
e System.Windows.Forms.KeyEventArgs
return void

OnRender() protected method

In a derived class, implements logic to render the sample.
protected OnRender ( ) : void
return void

OnRenderBegin() protected method

In a derived class, implements logic that should occur before all other rendering.
protected OnRenderBegin ( bool isScreenshot ) : void
isScreenshot bool
return void

OnRenderEnd() protected method

In a derived class, implements logic that should occur after all other rendering.
protected OnRenderEnd ( bool isScreenshot ) : void
isScreenshot bool
return void

OnResourceLoad() protected method

protected OnResourceLoad ( ) : void
return void

OnResourceUnload() protected method

protected OnResourceUnload ( ) : void
return void

OnUpdate() protected method

In a derived class, implements logic to update any relevant sample state.
protected OnUpdate ( ) : void
return void

Quit() protected method

Quits the sample.
protected Quit ( ) : void
return void

Run() public method

Runs the sample.
public Run ( ) : void
return void

Sample() public method

public Sample ( ) : System
return System

Property Details

EnableCamera protected_oe property

protected bool EnableCamera
return bool

arcBall protected_oe property

protected ModelViewer.ArcBall arcBall
return ModelViewer.ArcBall

cameraForward protected_oe property

protected SlimDX.Vector3 cameraForward
return SlimDX.Vector3

cameraForwardDirection protected_oe property

protected float cameraForwardDirection
return float

cameraPosition protected_oe property

protected SlimDX.Vector3 cameraPosition
return SlimDX.Vector3

cameraRaiseDirection protected_oe property

protected float cameraRaiseDirection
return float

cameraRight protected_oe property

protected SlimDX.Vector3 cameraRight
return SlimDX.Vector3

cameraStrafeDirection protected_oe property

protected float cameraStrafeDirection
return float

cameraUp protected_oe property

protected SlimDX.Vector3 cameraUp
return SlimDX.Vector3

cameraVelocity protected_oe property

protected float cameraVelocity
return float

globalSettings protected_oe property

protected ModelViewer.Renderer.GlobalRenderSettings globalSettings
return ModelViewer.Renderer.GlobalRenderSettings

renderList protected_oe property

protected List renderList
return List

sceneOffset protected_oe property

protected SlimDX.Vector3 sceneOffset
return SlimDX.Vector3

zoom protected_oe property

protected float zoom
return float

zoomSensitivity protected_oe property

protected float zoomSensitivity
return float