public void Run()
{
// Specify the cursor type as the standard arrow cursor.
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;
};
// Starting camera position
d3dApp.Camera.Position = new SharpDX.Vector3(1, 1, 2);
d3dApp.Camera.LookAtDir = -d3dApp.Camera.Position;
// Enter the render loop. Note that Windows Store apps should never exit.
while (true)
{
if (window.Visible)
{
// Process events incoming to the window.
window.Dispatcher.ProcessEvents(CoreProcessEventsOption.ProcessAllIfPresent);
// Render frame
d3dApp.Render();
}
else
{
window.Dispatcher.ProcessEvents(CoreProcessEventsOption.ProcessOneAndAllPending);
}
}
}