public void ChangeSize(SizeF newSize) { var oldSize = ClientSize; ClientSize = newSize; ClientSizeChanged?.Invoke(this, new SizeChangedEventArg(oldSize, newSize)); }
public void EnsureFrame(Rectangle frame) { if (frame == _frame) { return; } _frame = frame; RemoveAndDispose(ref _gameFramebuffer); RemoveAndDispose(ref _gameColorTarget); var width = (uint)_frame.Width; var height = (uint)_frame.Height; _gameColorTarget = AddDisposable(_graphicsDevice.ResourceFactory.CreateTexture( TextureDescription.Texture2D( width, height, 1, 1, PixelFormat.B8_G8_R8_A8_UNorm, TextureUsage.RenderTarget | TextureUsage.Sampled))); _gameFramebuffer = AddDisposable(_graphicsDevice.ResourceFactory.CreateFramebuffer( new FramebufferDescription(null, _gameColorTarget))); ClientSizeChanged?.Invoke(this, EventArgs.Empty); FramebufferChanged?.Invoke(this, EventArgs.Empty); }
protected internal virtual void OnClientSizeChanged(EventArgs e) { ClientSizeChanged?.Invoke(this, e); }
protected void OnClientSizeChanged() { ClientSizeChanged?.Invoke(this, EventArgs.Empty); }
protected virtual void OnClientSizeChanged(object sender, Vector2i e) { ClientSizeChanged?.Invoke(sender, e); }
private void RaiseClientSizeChanged() { ClientSizeChanged?.Invoke(this, EventArgs.Empty); }