//public MainWindow() //{ // InitializeComponent(); // //} // //private void Window_Loaded(object sender, RoutedEventArgs e) //{ // //HwndSource hwndSource = (HwndSource)HwndSource.FromVisual(myCanvas); // //myHWND = hwndSource.Handle; // //myEngineThread = new Thread(() => { RunGfxEngine(); }); // //myEngineThread.Start(); // //} //private void RunGfxEngine() //{ // lock (myCanvas) // { // myEngineBridge = new EngineBridge(); // myEngineBridge.Init(myHWND, 1280, 720); // } //} private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { myEngineBridge.ShutDown(); myEngineThread.Join(); }