Skip to content
This repository has been archived by the owner. It is now read-only.

Fixes for Wayland (HiDPI and mouse lock) support, FreeBSD #723

Merged
merged 5 commits into from Nov 16, 2020

Commits on Sep 28, 2020

  1. Use glfwSetFramebufferSizeCallback instead of glfwSetWindowSizeCallback

    Framebuffer size is scaled by the display scale.
    This fixes the game being shrunk to the bottom left quarter of the window on Wayland HiDPI setups.
    
    Corresponding change in librw: glfwGetWindowSize -> glfwGetFramebufferSize.
    unrelentingtech committed Sep 28, 2020
  2. glfw: scale cursor position by the ratio of framebuffer to screen size

    This fixes the mouse being constrained to the top left quarter of the window on Wayland HiDPI setups.
    unrelentingtech committed Sep 28, 2020
  3. Use GLFW_CURSOR_DISABLED (glfw's native mouse restriction)

    On Wayland, clients cannot move the mouse pointer.
    Mouse constraints, as required for 3D camera movement, are an explicit specific thing,
    and glfw supports it with GLFW_CURSOR_DISABLED.
    Use DISABLED, unless we're in a menu in windowed mode, where HIDDEN is still appropriate.
    unrelentingtech committed Sep 28, 2020
  4. Use CLOCK_MONOTONIC_FAST when available (FreeBSD)

    CLOCK_MONOTONIC_FAST is the equivalent of Linux's CLOCK_MONOTONIC_RAW.
    unrelentingtech committed Sep 28, 2020