//Update input handler, then the current state, and then check if new state should be loaded private void windowUpdateFrame(object sender, FrameEventArgs e) { InputHandler.updateState(); if (InputHandler.fullScreen()) { if (window.WindowState == WindowState.Fullscreen) { window.WindowState = WindowState.Normal; } else { window.WindowState = WindowState.Fullscreen; } } current.Update(); if (current.switchTo() != null) { current = current.switchTo(); current.Load(); if (current is ExitState) { window.Close(); } } }
//initial loading of the window, set ortho view and enable transparency on images private void windowLoad(object sender, EventArgs e) { GL.Enable(EnableCap.Texture2D); GL.Ortho(0, ConfigSettings.iResWidth, 0, ConfigSettings.iResHeight, -1, 1); GL.Enable(EnableCap.Blend); GL.BlendFunc(BlendingFactor.SrcAlpha, BlendingFactor.OneMinusSrcAlpha); current.Load(); }