C# Class TEdit.UI.Xaml.XnaContentHost.GraphicsDeviceControl

A control that enables XNA graphics rendering inside a WPF control through the use of a hosted child Hwnd.
Inheritance: System.Windows.Interop.HwndHost
Exibir arquivo Open project: TEdit/Terraria-Map-Editor

Public Methods

Method Description
CaptureMouse ( ) : void

Captures the mouse, hiding it and trapping it inside the window bounds.

This method is useful for tooling scenarios where you only care about the mouse deltas and want the user to be able to continue interacting with the window while they move the mouse. A good example of this is rotating an object based on the mouse deltas where through capturing you can spin and spin without having the cursor leave the window.

GraphicsDeviceControl ( ) : System
ReleaseMouseCapture ( ) : void

Releases the capture of the mouse which makes it visible and allows it to leave the window bounds.

SetCursor ( System.Windows.Input.Cursor cursor ) : void

Protected Methods

Method Description
BuildWindowCore ( HandleRef hwndParent ) : HandleRef
DestroyWindowCore ( HandleRef hwnd ) : void
Dispose ( bool disposing ) : void
WndProc ( IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, bool &handled ) : IntPtr

Private Methods

Method Description
CompositionTarget_Rendering ( object sender, EventArgs e ) : void
CreateHostWindow ( IntPtr hWndParent ) : IntPtr

Creates the host window as a child of the parent window.

Current_Activated ( object sender, EventArgs e ) : void
Current_Deactivated ( object sender, EventArgs e ) : void
InitGraphicsDevice ( ) : bool
RegisterWindowClass ( ) : void

Registers the window class.

ResetMouseState ( ) : void
XnaWindowHost_Loaded ( object sender, RoutedEventArgs e ) : void
XnaWindowHost_SizeChanged ( object sender, System.Windows.SizeChangedEventArgs e ) : void

Method Details

BuildWindowCore() protected method

protected BuildWindowCore ( HandleRef hwndParent ) : HandleRef
hwndParent System.Runtime.InteropServices.HandleRef
return System.Runtime.InteropServices.HandleRef

CaptureMouse() public method

Captures the mouse, hiding it and trapping it inside the window bounds.
This method is useful for tooling scenarios where you only care about the mouse deltas and want the user to be able to continue interacting with the window while they move the mouse. A good example of this is rotating an object based on the mouse deltas where through capturing you can spin and spin without having the cursor leave the window.
public CaptureMouse ( ) : void
return void

DestroyWindowCore() protected method

protected DestroyWindowCore ( HandleRef hwnd ) : void
hwnd System.Runtime.InteropServices.HandleRef
return void

Dispose() protected method

protected Dispose ( bool disposing ) : void
disposing bool
return void

GraphicsDeviceControl() public method

public GraphicsDeviceControl ( ) : System
return System

ReleaseMouseCapture() public method

Releases the capture of the mouse which makes it visible and allows it to leave the window bounds.
public ReleaseMouseCapture ( ) : void
return void

SetCursor() public method

public SetCursor ( System.Windows.Input.Cursor cursor ) : void
cursor System.Windows.Input.Cursor
return void

WndProc() protected method

protected WndProc ( IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, bool &handled ) : IntPtr
hwnd System.IntPtr
msg int
wParam System.IntPtr
lParam System.IntPtr
handled bool
return System.IntPtr