void OnResize(object send, SizeEventArgs e) { WindowWidth = (int)e.Width; WindowHeight = (int)e.Height; UpdateView(); UpdateSurfaceSize(); Debugger?.UpdateSurface(); }
/// <summary> /// Creates a new window for the game to be shown in. /// </summary> /// <param name="width">The width of the window.</param> /// <param name="height">The height of the window.</param> /// <param name="fullscreen">Run the window in fullscreen mode.</param> /// <param name="vsync">Enable vertical sync.</param> public void SetWindow(int width, int height = 0, bool fullscreen = false, bool vsync = false) { if (height == 0) { height = (int)Util.Ceil(width / AspectRatio); } WindowWidth = width; WindowHeight = height; WindowFullscreen = fullscreen; ResetWindow(Title, width, height, fullscreen, vsync); UpdateSurfaceSize(); Debugger?.UpdateSurface(); windowSet = true; }