public void Update() { // Screen get at last cleared but we need to invert it so also the dlg. have to be inverted what get drawn first.. while (VSInfo.isDrawing) { // Run the Delegate for Begin Update Frame VirtualScreenEventHandler.onBeginUpdateFrame(this, this); // Clear the Screen Clear(); // Run the Delegate for Update Frame VirtualScreenEventHandler.onUpdateFrame(this, this); // Update the Screen. Render(); // Run the Delegate for End Frame VirtualScreenEventHandler.onEndFrame(this, this); } try { // Release the DC on the End. ReleaseDC(IntPtr.Zero, VSInfo.Device); } catch (Exception ex) { Console.WriteLine("Update() : Exception"); } }
public void StopRendererThread() { // Stop the While Loop. VSInfo.isDrawing = false; // For Security we Stop the Update Thread. UpdateThread.Abort(); // Call the Delegate to Stop the screen. VirtualScreenEventHandler.onStopScreen(this, this); }