예제 #1
0
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (ApplicationWindow != null)
         {
             ApplicationWindow.Dispose();
             ApplicationWindow = null;
         }
     }
 }
예제 #2
0
        public virtual DirectXDevice CreateDevice(DeviceInformation deviceInformation)
        {
            var device = DirectXDevice.New(deviceInformation.Adapter, deviceInformation.DeviceCreationFlags,
                                           deviceInformation.GraphicsProfile);

            var parameters = deviceInformation.PresentationParameters;

            CreatePresenter(device, parameters);

            // Force to resize the applicationWindow
            ApplicationWindow.Resize(parameters.BackBufferWidth, parameters.BackBufferHeight);

            return(device);
        }
예제 #3
0
        public void Run(ApplicationContext applicationContext)
        {
            ApplicationWindow = CreateWindow(applicationContext);

            // Register on Activated
            ApplicationWindow.Activated      += OnActivated;
            ApplicationWindow.Deactivated    += OnDeactivated;
            ApplicationWindow.Initialization += OnInitialize;
            ApplicationWindow.Tick           += (s, e) => application.Tick();
            ApplicationWindow.Shutdown       += OnExiting;

            var windowCreated = WindowCreated;

            if (windowCreated != null)
            {
                windowCreated(this, EventArgs.Empty);
            }

            ApplicationWindow.Run();
        }