Graphics Reference
In-Depth Information
7.
The implementation of the IFrameworkView members of D3DAppViewProvider
allows us to initialize an instance of a concrete descendent of the
D3DAppCoreWindowTarget class within SetWindow and to implement
the main application loop in the Run method.
Windows.UI.Core.CoreWindow window;
D3DApp d3dApp; // descends from D3DAppCoreWindowTarget
public void Initialize(CoreApplicationView applicationView)
{ }
public void Load(string entryPoint) { }
public void SetWindow(Windows.UI.Core.CoreWindow window)
{
RemoveAndDispose(ref d3dApp);
this.window = window;
d3dApp = ToDispose(new D3DApp(window));
d3dApp.Initialize();
}
public void Uninitialize() { }
public void Run()
{
// Specify the cursor type as the standard arrow.
window.PointerCursor = new CoreCursor(
CoreCursorType.Arrow, 0);
// Activate the application window, making it visible
// and enabling it to receive events.
window.Activate();
// Set the DPI and handle changes
d3dApp.DeviceManager.Dpi = Windows.Graphics.Display
.DisplayInformation.GetForCurrentView().LogicalDpi;
Windows.Graphics.Display.DisplayInformation
.GetForCurrentView().DpiChanged += (sender, args) =>
{
d3dApp.DeviceManager.Dpi = Windows.Graphics.Display
.DisplayInformation.GetForCurrentView().LogicalDpi;
};
// Enter the render loop. Note that Windows Store apps
// should never exit here.
while (true)
{
// Process events incoming to the window.
window.Dispatcher.ProcessEvents(
CoreProcessEventsOption.ProcessAllIfPresent);
 
Search WWH ::




Custom Search