private static void Main() { //var process = Process.GetProcessesByName("telegram").Single(x => x.MainWindowHandle != IntPtr.Zero); var window = new OverlayWindow(0, 0, 1920, 1080, true) { FramesPerSecond = 5000 }; window.OnDraw += Overlay_OnDraw; GenerateCircles(window); void UpdateCircles() { foreach (var circle in Circles) { circle.Update(window.Width, window.Height); } } for (int i = 0; i < 180; i++) { RunHelper.ConsistentRun(UpdateCircles, 16); } window.Dispose(); Console.ReadKey(true); }
public override int Startup(IPluginHostDelegates hostDelegates) { _hostDelegates = hostDelegates; Config = LoadConfiguration <PluginConfig>(); try { GenerateClipping(); InitializeOverlay(); } catch (Exception ex) { _hostDelegates.ExceptionMessage(ex); _characterToImageTranslation = null; _graphics?.Dispose(); _graphics = null; _window?.Dispose(); _window = null; _isOverlayInitialized = false; _isOverlayReady = false; return(1); } try { Thread t = new Thread(new ThreadStart(() => { _windowEventDispatcher = Dispatcher.CurrentDispatcher; Dispatcher.Run(); })); t.IsBackground = true; t.SetApartmentState(ApartmentState.STA); t.Start(); } catch (Exception ex) { _hostDelegates.ExceptionMessage(ex); _windowEventDispatcher = null; } return(0); }
public void DestroyInstance() { _frameTimer.Stop(); _frameTimer.Dispose(); _device.Dispose(); _window.Dispose(); _device = null; _frameTimer = null; }
public void Uninitialize() { if (graphics != null) { graphics.Dispose(); } if (overlayWindow != null) { overlayWindow.Dispose(); } }
public void Dispose() { Free(); if (_graphics != null) { _graphics.Dispose(); _graphics = null; } if (_window != null) { _window.Dispose(); _window = null; } }
public bool Detach() { if (overlay != null) { overlay.Close(); overlay.Dispose(); overlay = null; } syncTimer.Stop(); gameCheckTimer.Stop(); selectedUnitTimer.Stop(); if (Pickit != null) { Pickit.Stop(); Pickit = null; } if (MapHandler != null) { MapHandler.Reset(); MapHandler = null; } if (AutoTeleport != null) { AutoTeleport.Terminate(); AutoTeleport = null; } PlayerInfo = null; if (Installed) { try { pd.StopDebugging(); pd.Join(); pd = null; } catch { return(false); } } return(true); }
public void DestroyInstance() { _frameTimer.Stop(); //Begin and clear scene to stop last draw sticking on screen _device.BeginScene(); _device.ClearScene(); _frameTimer.Dispose(); _device.Dispose(); _window.Dispose(); _window = null; _device = null; _frameTimer = null; }
private bool disposedValue = false; // To detect redundant calls protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { // TODO: dispose managed state (managed objects). _graphics?.Dispose(); _window?.Dispose(); } // TODO: free unmanaged resources (unmanaged objects) and override a finalizer below. // TODO: set large fields to null. disposedValue = true; } }
public void Dispose() { if (_graphics != null) { _graphics.Dispose(); _graphics = null; } if (_window != null) { _window.Dispose(); _window = null; } if (exitEvent != null) { exitEvent.Dispose(); exitEvent = null; } }
protected override void Dispose(bool isDisposing) { if (_isDisposed) { return; } if (isDisposing) { _tickEngine.PreTick -= OnPreTick; _tickEngine.Tick -= OnTick; ClearScreen(); OverlayWindow?.Dispose(); } base.Dispose(); _isDisposed = true; }
public override void Dispose() { OverlayWindow.Dispose(); base.Dispose(); }