Пример #1
0
        private void InitialiseWindow()
        {
            Glfw3.Init();

            Glfw3.WindowHint(0x00022001, 0);
            this.window             = Glfw3.CreateWindow(SurfaceWidth, SurfaceHeight, "Hello Triangle", IntPtr.Zero, IntPtr.Zero);
            this.windowSizeCallback = (x, y, z) => this.RecreateSwapChain();

            Glfw3.SetWindowSizeCallback(this.window, this.windowSizeCallback);
        }
Пример #2
0
        public override void Initialise(Game game)
        {
            Glfw3.Init();

            Glfw3.WindowHint(0x00022001, 0);
            this.WindowHandle = Glfw3.CreateWindow(this.options.InitialWidth, this.options.InitialHeight, this.options.Title, IntPtr.Zero, IntPtr.Zero);

            this.windowSizeChanged = this.OnWindowSizeChanged;
            Glfw3.SetWindowSizeCallback(this.WindowHandle, this.windowSizeChanged);

            this.game = game;
        }
Пример #3
0
        public VkWindow(bool debugMarkers = false, string name = "VkWindow", uint _width = 1024, uint _height = 768, bool vSync = false)
        {
            currentWindow = this;

            width  = _width;
            height = _height;

            Glfw3.Init();

            Glfw3.WindowHint(WindowAttribute.ClientApi, 0);
            Glfw3.WindowHint(WindowAttribute.Resizable, 1);

            hWin = Glfw3.CreateWindow((int)width, (int)height, name, MonitorHandle.Zero, IntPtr.Zero);

            Glfw3.SetKeyCallback(hWin, HandleKeyDelegate);
            Glfw3.SetMouseButtonPosCallback(hWin, HandleMouseButtonDelegate);
            Glfw3.SetCursorPosCallback(hWin, HandleCursorPosDelegate);
            Glfw3.SetWindowSizeCallback(hWin, HandleWindowSizeDelegate);
            Glfw3.SetScrollCallback(hWin, HandleScrollDelegate);
            Glfw3.SetCharCallback(hWin, HandleCharDelegate);

            initVulkan(vSync, debugMarkers);
        }