A stealth-based 2D platformer where you don't have to kill anyone unless you want to. https://www.semicolin.games
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.5 KiB

  1. using Microsoft.Xna.Framework;
  2. using System;
  3. namespace SemiColinGames {
  4. public class DesktopGLDisplay : IDisplay {
  5. private GameWindow window;
  6. private GraphicsDeviceManager graphics;
  7. public void Initialize(GameWindow window, GraphicsDeviceManager graphics) {
  8. this.window = window;
  9. this.graphics = graphics;
  10. window.Title = "Sneak";
  11. }
  12. public void SetFullScreen(bool fullScreen) {
  13. if (fullScreen) {
  14. // In DesktopGL, we misappropriate "fullscreen" to be "the settings good for recording
  15. // gameplay GIFs".
  16. window.IsBorderless = true;
  17. // graphics.PreferredBackBufferWidth = 720;
  18. // graphics.PreferredBackBufferHeight = 405;
  19. graphics.PreferredBackBufferWidth = graphics.GraphicsDevice.DisplayMode.Width;
  20. graphics.PreferredBackBufferHeight = graphics.GraphicsDevice.DisplayMode.Height;
  21. } else {
  22. window.IsBorderless = false;
  23. graphics.PreferredBackBufferWidth = 1920;
  24. graphics.PreferredBackBufferHeight = 1080;
  25. }
  26. Debug.WriteLine("display: {0}x{1}, fullscreen={2}",
  27. graphics.PreferredBackBufferWidth,
  28. graphics.PreferredBackBufferHeight,
  29. fullScreen);
  30. graphics.ApplyChanges();
  31. }
  32. }
  33. public static class DesktopGLProgram {
  34. [STAThread]
  35. static void Main() {
  36. using (var game = new SneakGame()) {
  37. game.Services.AddService(typeof(IDisplay), new DesktopGLDisplay());
  38. game.Run();
  39. }
  40. }
  41. }
  42. }