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.

52 lines
1.6 KiB

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