Class.
|
Public Member Functions |
| | Framework () |
| | Constructor, init data here.
|
| void | SetCallbackInterface (IFrameworkCallback callback) |
| void | SetDeviceCreationInterface (IDeviceCreation callback) |
| void | SetWndProcCallback (WndProcCallback callback) |
| void | Initialize (bool isParsingCommandLine, bool handleDefaultKeys, bool showMessageBoxOnError) |
| | Optionally parses the command line and sets if default hotkeys are handled Possible command line parameters are: -adapter:# forces app to use this adapter # (fails if the adapter doesn't exist) -windowed forces app to start windowed -fullscreen forces app to start full screen -forceHardware forces app to use Hardware (fails if Hardware doesn't exist) -forceReference forces app to use Reference (fails if Reference doesn't exist) -forcepurehwvp forces app to use pure HWVP (fails if device doesn't support it) -forcehwvp forces app to use HWVP (fails if device doesn't support it) -forceswvp forces app to use SWVP -width:# forces app to use # for width. for full screen, it will pick the closest possible supported mode -height:# forces app to use # for height. for full screen, it will pick the closest possible supported mode -startx:# forces app to use # for the x coord of the window position for windowed mode -starty:# forces app to use # for the y coord of the window position for windowed mode -constantframetime:# forces app to use constant frame time, where # is the time/frame in seconds -quitafterframe:x forces app to quit after # frames -noerrormsgboxes prevents the display of message boxes generated by the framework so the application can be run without user interaction -nostats prevents the display of the stats.
|
| void | CreateWindow (string windowTitle, System.Drawing.Icon icon, System.Windows.Forms.MainMenu menu, int x, int y) |
| | Creates a window with the specified title, icon, menu, and starting position. If Init hasn't been called, this will call with default params. Instead of calling this, you can call SetWindow to use an existing window.
|
| void | CreateWindow (string windowTitle) |
| | Calls into CreateWindow with default paramters.
|
| void | SetWindow (System.Windows.Forms.Control windowFocus, System.Windows.Forms.Control windowDeviceFullscreen, System.Windows.Forms.Control windowDeviceWindowed, bool handleMessages) |
| | Sets a previously created window for the framework to use. If Init has not already been called, it will call it with default parameters. Instead of calling this you can call CreateWindow to create a new window.
|
| void | SetWinformWindow (System.Windows.Forms.Control windowFocus, System.Windows.Forms.Control windowDeviceFullscreen, System.Windows.Forms.Control windowDeviceWindowed) |
| | Sets a previously created window for the framework to use. If Init has not already been called, it will call it with default parameters. Instead of calling this you can call CreateWindow to create a new window.
|
| void | CreateDevice (uint adapterOridinal, bool windowed, int suggestedWidth, int suggestedHeight, IDeviceCreation callback) |
| | Creates a Direct3D device. If CreateWindow or SetWindow has not already been called, it will call CreateWindow with default parameters. Instead of calling this, you can call SetDevice or CreateDeviceFromSettings.
|
| void | CreateDevice (int adapterOridinal, bool windowed, int suggestedWidth, int suggestedHeight, IDeviceCreation callback) |
| | Creates a Direct3D device. If CreateWindow or SetWindow has not already been called, it will call CreateWindow with default parameters. Instead of calling this, you can call SetDevice or CreateDeviceFromSettings This is the CLS compliant version.
|
| void | SetDevice (Device device) |
| | Passes a previously created Direct3D device for use by the framework. If CreateWindow() has not already been called, it will call it with the default parameters. Instead of calling this, you can call CreateDevice() or CreateDeviceFromSettings().
|
| void | CreateDeviceFromSettings (DeviceSettings deviceSettings, bool preserveInput) |
| | Tells the framework to change to a device created from the passed in device settings If CreateWindow() has not already been called, it will call it with the default parameters. Instead of calling this, you can call CreateDevice() or SetDevice().
|
| void | CreateDeviceFromSettings (DeviceSettings deviceSettings) |
| | Tells the framework to change to a device created from the passed in device settings If CreateWindow() has not already been called, it will call it with the default parameters. Instead of calling this, you can call CreateDevice() or SetDevice().
|
| void | ToggleFullscreen () |
| | Toggle between full screen and windowed.
|
| void | ToggleReference () |
| | Toggle between Hardware and Reference.
|
| void | Reset3DEnvironment () |
| | Resets the 3D environment by:
- Calls the device lost callback
- Resets the device
- Stores the back buffer description
- Sets up the full screen Direct3D cursor if requested
- Calls the device reset callback.
|
| void | Render3DEnvironment () |
| | Render the 3D environment by:
- Checking if the device is lost and trying to reset it if it is
- Get the elapsed time since the last frame
- Calling the app's framemove and render callback
- Calling Present() If you're not using MainLoop, consider using Render3DEnvironment.
|
| void | Pause (bool pauseTime, bool pauseRendering) |
| | Pauses time or rendering. Keeps a ref count so pausing can be layered.
|
| void | DisplayErrorMessage (Exception e) |
| | Display an custom error msg box.
|
| System.Drawing.Icon | LoadFirstIconFromResource () |
| | Will try to load the first icon from the resources.
|
| void | SetCursorSettings (bool showCursorWhenFullscreen, bool clipCursorWhenFullscreen) |
| | Handles setting up the cursor settings for fullscreen.
|
| void | SetConstantFrameTime (bool constantFrameTime, float timePerFrame) |
| | Allows to set constant time per frame.
|
| void | SetConstantFrameTime (bool constantFrameTime) |
| | Allows to set constant time per frame.
|
| void | ShowSettingsDialog (bool shouldShow) |
| | Show the settings dialog, and create if needed.
|
| void | ResetState () |
| | Resets the state associated with the sample framework.
|
| int | SetTimer (TimerCallback callbackTimer, float timeoutInSeconds) |
| | Adds a timer to the list of timers for the application.
|
| void | KillTimer (int id) |
| | Kills an already created timer.
|
| void | CloseWindow () |
| | Will close the window.
|
| void | MainLoop () |
| | Handles app's message loop and rendering when idle. If CreateDevice*() or SetDevice() has not already been called, it will call CreateDevice() with the default parameters.
|
| void | Dispose () |
| | Shut down the sample framework.
|
| | Framework () |
| | Constructor, init data here.
|
| void | SetCallbackInterface (IFrameworkCallback callback) |
| void | SetDeviceCreationInterface (IDeviceCreation callback) |
| void | SetWndProcCallback (WndProcCallback callback) |
| void | Initialize (bool isParsingCommandLine, bool handleDefaultKeys, bool showMessageBoxOnError) |
| | Optionally parses the command line and sets if default hotkeys are handled Possible command line parameters are: -adapter:# forces app to use this adapter # (fails if the adapter doesn't exist) -windowed forces app to start windowed -fullscreen forces app to start full screen -forceHardware forces app to use Hardware (fails if Hardware doesn't exist) -forceReference forces app to use Reference (fails if Reference doesn't exist) -forcepurehwvp forces app to use pure HWVP (fails if device doesn't support it) -forcehwvp forces app to use HWVP (fails if device doesn't support it) -forceswvp forces app to use SWVP -width:# forces app to use # for width. for full screen, it will pick the closest possible supported mode -height:# forces app to use # for height. for full screen, it will pick the closest possible supported mode -startx:# forces app to use # for the x coord of the window position for windowed mode -starty:# forces app to use # for the y coord of the window position for windowed mode -constantframetime:# forces app to use constant frame time, where # is the time/frame in seconds -quitafterframe:x forces app to quit after # frames -noerrormsgboxes prevents the display of message boxes generated by the framework so the application can be run without user interaction -nostats prevents the display of the stats.
|
| void | CreateWindow (string windowTitle, System.Drawing.Icon icon, System.Windows.Forms.MainMenu menu, int x, int y) |
| | Creates a window with the specified title, icon, menu, and starting position. If Init hasn't been called, this will call with default params. Instead of calling this, you can call SetWindow to use an existing window.
|
| void | CreateWindow (string windowTitle) |
| | Calls into CreateWindow with default paramters.
|
| void | SetWindow (System.Windows.Forms.Control windowFocus, System.Windows.Forms.Control windowDeviceFullscreen, System.Windows.Forms.Control windowDeviceWindowed, bool handleMessages) |
| | Sets a previously created window for the framework to use. If Init has not already been called, it will call it with default parameters. Instead of calling this you can call CreateWindow to create a new window.
|
| void | SetWinformWindow (System.Windows.Forms.Control windowFocus, System.Windows.Forms.Control windowDeviceFullscreen, System.Windows.Forms.Control windowDeviceWindowed) |
| | Sets a previously created window for the framework to use. If Init has not already been called, it will call it with default parameters. Instead of calling this you can call CreateWindow to create a new window.
|
| void | CreateDevice (uint adapterOridinal, bool windowed, int suggestedWidth, int suggestedHeight, IDeviceCreation callback) |
| | Creates a Direct3D device. If CreateWindow or SetWindow has not already been called, it will call CreateWindow with default parameters. Instead of calling this, you can call SetDevice or CreateDeviceFromSettings.
|
| void | CreateDevice (int adapterOridinal, bool windowed, int suggestedWidth, int suggestedHeight, IDeviceCreation callback) |
| | Creates a Direct3D device. If CreateWindow or SetWindow has not already been called, it will call CreateWindow with default parameters. Instead of calling this, you can call SetDevice or CreateDeviceFromSettings This is the CLS compliant version.
|
| void | SetDevice (Device device) |
| | Passes a previously created Direct3D device for use by the framework. If CreateWindow() has not already been called, it will call it with the default parameters. Instead of calling this, you can call CreateDevice() or CreateDeviceFromSettings().
|
| void | CreateDeviceFromSettings (DeviceSettings deviceSettings, bool preserveInput) |
| | Tells the framework to change to a device created from the passed in device settings If CreateWindow() has not already been called, it will call it with the default parameters. Instead of calling this, you can call CreateDevice() or SetDevice().
|
| void | CreateDeviceFromSettings (DeviceSettings deviceSettings) |
| | Tells the framework to change to a device created from the passed in device settings If CreateWindow() has not already been called, it will call it with the default parameters. Instead of calling this, you can call CreateDevice() or SetDevice().
|
| void | ToggleFullscreen () |
| | Toggle between full screen and windowed.
|
| void | ToggleReference () |
| | Toggle between Hardware and Reference.
|
| void | Reset3DEnvironment () |
| | Resets the 3D environment by:
- Calls the device lost callback
- Resets the device
- Stores the back buffer description
- Sets up the full screen Direct3D cursor if requested
- Calls the device reset callback.
|
| void | Render3DEnvironment () |
| | Render the 3D environment by:
- Checking if the device is lost and trying to reset it if it is
- Get the elapsed time since the last frame
- Calling the app's framemove and render callback
- Calling Present() If you're not using MainLoop, consider using Render3DEnvironment.
|
| void | Pause (bool pauseTime, bool pauseRendering) |
| | Pauses time or rendering. Keeps a ref count so pausing can be layered.
|
| void | DisplayErrorMessage (Exception e) |
| | Display an custom error msg box.
|
| System.Drawing.Icon | LoadFirstIconFromResource () |
| | Will try to load the first icon from the resources.
|
| void | SetCursorSettings (bool showCursorWhenFullscreen, bool clipCursorWhenFullscreen) |
| | Handles setting up the cursor settings for fullscreen.
|
| void | SetConstantFrameTime (bool constantFrameTime, float timePerFrame) |
| | Allows to set constant time per frame.
|
| void | SetConstantFrameTime (bool constantFrameTime) |
| | Allows to set constant time per frame.
|
| void | ShowSettingsDialog (bool shouldShow) |
| | Show the settings dialog, and create if needed.
|
| void | ResetState () |
| | Resets the state associated with the sample framework.
|
| int | SetTimer (TimerCallback callbackTimer, float timeoutInSeconds) |
| | Adds a timer to the list of timers for the application.
|
| void | KillTimer (int id) |
| | Kills an already created timer.
|
| void | CloseWindow () |
| | Will close the window.
|
| void | MainLoop () |
| | Handles app's message loop and rendering when idle. If CreateDevice*() or SetDevice() has not already been called, it will call CreateDevice() with the default parameters.
|
| void | Dispose () |
| | Shut down the sample framework.
|
| | Framework () |
| | Constructor, init data here.
|
| void | SetCallbackInterface (IFrameworkCallback callback) |
| void | SetDeviceCreationInterface (IDeviceCreation callback) |
| void | SetWndProcCallback (WndProcCallback callback) |
| void | Initialize (bool isParsingCommandLine, bool handleDefaultKeys, bool showMessageBoxOnError) |
| | Optionally parses the command line and sets if default hotkeys are handled Possible command line parameters are: -adapter:# forces app to use this adapter # (fails if the adapter doesn't exist) -windowed forces app to start windowed -fullscreen forces app to start full screen -forceHardware forces app to use Hardware (fails if Hardware doesn't exist) -forceReference forces app to use Reference (fails if Reference doesn't exist) -forcepurehwvp forces app to use pure HWVP (fails if device doesn't support it) -forcehwvp forces app to use HWVP (fails if device doesn't support it) -forceswvp forces app to use SWVP -width:# forces app to use # for width. for full screen, it will pick the closest possible supported mode -height:# forces app to use # for height. for full screen, it will pick the closest possible supported mode -startx:# forces app to use # for the x coord of the window position for windowed mode -starty:# forces app to use # for the y coord of the window position for windowed mode -constantframetime:# forces app to use constant frame time, where # is the time/frame in seconds -quitafterframe:x forces app to quit after # frames -noerrormsgboxes prevents the display of message boxes generated by the framework so the application can be run without user interaction -nostats prevents the display of the stats.
|
| void | CreateWindow (string windowTitle, System.Drawing.Icon icon, System.Windows.Forms.MainMenu menu, int x, int y) |
| | Creates a window with the specified title, icon, menu, and starting position. If Init hasn't been called, this will call with default params. Instead of calling this, you can call SetWindow to use an existing window.
|
| void | CreateWindow (string windowTitle) |
| | Calls into CreateWindow with default paramters.
|
| void | SetWindow (System.Windows.Forms.Control windowFocus, System.Windows.Forms.Control windowDeviceFullscreen, System.Windows.Forms.Control windowDeviceWindowed, bool handleMessages) |
| | Sets a previously created window for the framework to use. If Init has not already been called, it will call it with default parameters. Instead of calling this you can call CreateWindow to create a new window.
|
| void | SetWinformWindow (System.Windows.Forms.Control windowFocus, System.Windows.Forms.Control windowDeviceFullscreen, System.Windows.Forms.Control windowDeviceWindowed) |
| | Sets a previously created window for the framework to use. If Init has not already been called, it will call it with default parameters. Instead of calling this you can call CreateWindow to create a new window.
|
| void | CreateDevice (uint adapterOridinal, bool windowed, int suggestedWidth, int suggestedHeight, IDeviceCreation callback) |
| | Creates a Direct3D device. If CreateWindow or SetWindow has not already been called, it will call CreateWindow with default parameters. Instead of calling this, you can call SetDevice or CreateDeviceFromSettings.
|
| void | CreateDevice (int adapterOridinal, bool windowed, int suggestedWidth, int suggestedHeight, IDeviceCreation callback) |
| | Creates a Direct3D device. If CreateWindow or SetWindow has not already been called, it will call CreateWindow with default parameters. Instead of calling this, you can call SetDevice or CreateDeviceFromSettings This is the CLS compliant version.
|
| void | SetDevice (Device device) |
| | Passes a previously created Direct3D device for use by the framework. If CreateWindow() has not already been called, it will call it with the default parameters. Instead of calling this, you can call CreateDevice() or CreateDeviceFromSettings().
|
| void | CreateDeviceFromSettings (DeviceSettings deviceSettings, bool preserveInput) |
| | Tells the framework to change to a device created from the passed in device settings If CreateWindow() has not already been called, it will call it with the default parameters. Instead of calling this, you can call CreateDevice() or SetDevice().
|
| void | CreateDeviceFromSettings (DeviceSettings deviceSettings) |
| | Tells the framework to change to a device created from the passed in device settings If CreateWindow() has not already been called, it will call it with the default parameters. Instead of calling this, you can call CreateDevice() or SetDevice().
|
| void | ToggleFullscreen () |
| | Toggle between full screen and windowed.
|
| void | ToggleReference () |
| | Toggle between Hardware and Reference.
|
| void | Reset3DEnvironment () |
| | Resets the 3D environment by:
- Calls the device lost callback
- Resets the device
- Stores the back buffer description
- Sets up the full screen Direct3D cursor if requested
- Calls the device reset callback.
|
| void | Render3DEnvironment () |
| | Render the 3D environment by:
- Checking if the device is lost and trying to reset it if it is
- Get the elapsed time since the last frame
- Calling the app's framemove and render callback
- Calling Present() If you're not using MainLoop, consider using Render3DEnvironment.
|
| void | Pause (bool pauseTime, bool pauseRendering) |
| | Pauses time or rendering. Keeps a ref count so pausing can be layered.
|
| void | DisplayErrorMessage (Exception e) |
| | Display an custom error msg box.
|
| System.Drawing.Icon | LoadFirstIconFromResource () |
| | Will try to load the first icon from the resources.
|
| void | SetCursorSettings (bool showCursorWhenFullscreen, bool clipCursorWhenFullscreen) |
| | Handles setting up the cursor settings for fullscreen.
|
| void | SetConstantFrameTime (bool constantFrameTime, float timePerFrame) |
| | Allows to set constant time per frame.
|
| void | SetConstantFrameTime (bool constantFrameTime) |
| | Allows to set constant time per frame.
|
| void | ShowSettingsDialog (bool shouldShow) |
| | Show the settings dialog, and create if needed.
|
| void | ResetState () |
| | Resets the state associated with the sample framework.
|
| int | SetTimer (TimerCallback callbackTimer, float timeoutInSeconds) |
| | Adds a timer to the list of timers for the application.
|
| void | KillTimer (int id) |
| | Kills an already created timer.
|
| void | CloseWindow () |
| | Will close the window.
|
| void | MainLoop () |
| | Handles app's message loop and rendering when idle. If CreateDevice*() or SetDevice() has not already been called, it will call CreateDevice() with the default parameters.
|
| void | Dispose () |
| | Shut down the sample framework.
|
Public Attributes |
| const int | DefaultSizeWidth = 640 |
| const int | DefaultSizeHeight = 480 |
Static Public Attributes |
| static readonly IntPtr | TrueIntPtr = new IntPtr(1) |
Properties |
| bool | CanAutomaticallyChangeMonitor [get, set] |
| | Determines if the adapter can automatically change monitors.
|
| int | ExitCode [get] |
| | Exit code from the framework.
|
| Device | Device [get] |
| | Returns the device current in use for the framework.
|
| SurfaceDescription | BackBufferSurfaceDescription [get] |
| | Returns the back buffer surface description.
|
| Caps | DeviceCaps [get] |
| | Returns the device capabilities.
|
| System.Windows.Forms.Control | Window [get] |
| | Get the current window used for rendering.
|
| System.Windows.Forms.Form | WindowForm [get] |
| | Get the current window used for rendering.
|
| System.Windows.Forms.Control | WindowFocus [get] |
| | Get the current focus window.
|
| System.Windows.Forms.Control | WindowDeviceWindowed [get] |
| | Get the current window used for windowed rendering.
|
| System.Windows.Forms.Control | WindowDeviceFullscreen [get] |
| | Get the current window used for full screen rendering.
|
| System.Drawing.Rectangle | WindowClientRectangle [get] |
| | Client rectangle size.
|
| System.Drawing.Rectangle | ClientRectangle [get] |
| | Client rectangle size.
|
| bool | IsWindowed [get] |
| | Return if windowed in the current device. If no device exists yet, return false.
|
| string | FrameStats [get] |
| | Frame statistics.
|
| string | DeviceStats [get] |
| | Device statistics.
|
| float | FPS [get] |
| | Frames per second application is running at.
|
| bool | IsD3DSettingsDialogShowing [get] |
| | Returns whether the settings is showing.
|
| bool | IsShowingMsgBoxOnError [get] |
| | Returns whether the framework is showing errors.
|
| DeviceSettings | DeviceSettings [get] |
| | Return the device settings of the current device. If no device exists yet, then return blank device settings.
|
| PresentParameters | PresentParameters [get] |
| | Return the present params of the current device. If no device exists yet, then return blank present params.
|
| bool | IsNotifiedOnMouseMove [get, set] |
| | Should the framework also notify for mouse moves.
|
| bool | IsOverridingFullScreen [get, set] |
| | Should the framework override and start fullscreen?
|
| bool | IsIgnoringSizeChanges [get, set] |
| | Should the framework ignore size changes?
|
| Capabilities | DeviceCapabilities [get] |
| | Returns the device capabilities.
|
Events |
| EventHandler | Disposing |
| | The event fired for disposing of the device.
|
| EventHandler | DeviceLost |
| | The event fired for when the device is lost.
|
| DeviceEventHandler | DeviceCreated |
| | The event fired for when the device is created.
|
| DeviceEventHandler | DeviceReset |
| | The event fired for when the device is reset.
|
Class.