Exemple #1
0
 /// <summary>
 /// Swaps front and back buffers in the specified <see cref="GameWindow"/>.
 /// </summary>
 /// <param name="window">The window.</param>
 public static void SwapBuffers(GameWindow window)
 {
     GLFW.GLFW.SwapBuffers(window.Handle);
 }
Exemple #2
0
 /// <summary>
 /// Makes current the given window's context.
 /// </summary>
 /// <param name="window">The window.</param>
 public static void MakeContextCurrent(GameWindow window)
 {
     GLFW.GLFW.MakeContextCurrent(window.Handle);
 }
Exemple #3
0
 public GameWindow(int width, int height, string title, bool fullscreen, Monitor monitor, GameWindow share) : this(new Sizei(width, height), title, fullscreen, monitor, share)
 {
 }
Exemple #4
0
        public GameWindow(Sizei size, string title, bool fullscreen, Monitor monitor, GameWindow share) : this()
        {
            // Set default window hints
            GLFW.GLFW.DefaultWindowHints();
            GLFW.GLFW.WindowHint(GLFW.GLFW.Hint.Resizable, false);
            GLFW.GLFW.WindowHint(GLFW.GLFW.Hint.AutoIconify, true);
            GLFW.GLFW.WindowHint(GLFW.GLFW.Hint.Doublebuffer, true);

            if (GameSettings.MultisampleEnabled)
            {
                GLFW.GLFW.WindowHint(GLFW.GLFW.Hint.Samples, GameSettings.MultisampleLevel);
            }
            else
            {
                GLFW.GLFW.WindowHint(GLFW.GLFW.Hint.Samples, 0);
            }

            Handle = GLFW.GLFW.CreateWindow(size.Width, size.Height, title, (GameSettings.GameWindowFullscreenMode) ? monitor.Handle : Monitor.None.Handle, (share != null) ? share.Handle : None.Handle);

            if (!Handle)
            {
                GLFW.GLFW.Shutdown();
                Environment.Exit(-1);
            }

            // Enable V-Sync
            if (GameSettings.VSyncEnabled)
            {
                GLFW.GLFW.SwapInterval(GameSettings.VSyncInterval);
            }
        }
Exemple #5
0
 public GameWindow(int width, int height, string title, GameWindow share) : this(new Sizei(width, height), title, share)
 {
 }