public void ScreenChanged() { var oldScreenSize = ScreenSize; ScreenSize = Viewer.DisplaySize; // Buffer for screen texture, also same size as viewport and using the backbuffer format. if (Viewer.Settings.WindowGlass) { if (Screen != null) { Screen.Dispose(); } Screen = new ResolveTexture2D(Viewer.GraphicsDevice, ScreenSize.X, ScreenSize.Y, 1, Viewer.GraphicsDevice.PresentationParameters.BackBufferFormat); } // Reposition all the windows. foreach (var window in Windows) { if (oldScreenSize.X - window.Location.Width > 0 && oldScreenSize.Y - window.Location.Height > 0) { window.MoveTo((ScreenSize.X - window.Location.Width) * window.Location.X / (oldScreenSize.X - window.Location.Width), (ScreenSize.Y - window.Location.Height) * window.Location.Y / (oldScreenSize.Y - window.Location.Height)); } window.ScreenChanged(); } }
public void UnloadContent() { _renderTargetA.Dispose(); _renderTargetB.Dispose(); if (_resolveTextureA != null) { _resolveTextureA.Dispose(); } if (_resolveTextureB != null) { _resolveTextureB.Dispose(); } _backbufferTexture.Dispose(); }
public ResolveTexture2D GetTexture() { PresentationParameters parameters = graphicsDevice.PresentationParameters; if (resolveTexture == null || resolveTextureWidth != parameters.BackBufferWidth || resolveTextureHeight != parameters.BackBufferHeight) { if (resolveTexture != null) { resolveTexture.Dispose(); } resolveTexture = new ResolveTexture2D(graphicsDevice, parameters.BackBufferWidth, parameters.BackBufferHeight, 1, parameters.BackBufferFormat); resolveTextureWidth = parameters.BackBufferWidth; resolveTextureHeight = parameters.BackBufferHeight; } graphicsDevice.ResolveBackBuffer(resolveTexture); return(resolveTexture); }
protected override void UnloadContent() { resolveTarget.Dispose(); renderTarget1.Dispose(); renderTarget2.Dispose(); }
/// <summary> /// Unload your graphics content. /// </summary> protected void Dispose() { resolveTarget.Dispose(); renderTarget1.Dispose(); renderTarget2.Dispose(); }