Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Hi DPI Support for GLFW #20584

Merged
merged 44 commits into from
Dec 6, 2023
Merged

Commits on Oct 29, 2023

  1. proof of concept for Hi DPI

    - added Browser.isHiDPIAware flag that gets initialized from Module.isHiDPIAware
    - from the webgpu samples (https://webgpu.github.io/webgpu-samples/samples/helloTriangle), the gist of the logic is to scale canvas.width (resp. canvas.height) by the devicePixelRatio and set canvas.clientWidth to the width
    - coordinates are then scaled down to reflect what the client is expecting
    ypujante committed Oct 29, 2023
    Configuration menu
    Copy the full SHA
    811ef54 View commit details
    Browse the repository at this point in the history
  2. fixed fullscreen mode

    - calling Browser.requestFullscreen raises "Failed to execute 'requestFullscreen' on 'Element': API can only be initiated by a user gesture"
    ypujante committed Oct 29, 2023
    Configuration menu
    Copy the full SHA
    7c457a4 View commit details
    Browse the repository at this point in the history
  3. removed log statements

    ypujante committed Oct 29, 2023
    Configuration menu
    Copy the full SHA
    6c0e378 View commit details
    Browse the repository at this point in the history

Commits on Oct 30, 2023

  1. Make sure it works for "default" shell

    - handle case where the canvas size is fixed (default shell)
    - handle case where request full screen is issued by the user (default shell)
    ypujante committed Oct 30, 2023
    Configuration menu
    Copy the full SHA
    cbeb0e1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ba13c6f View commit details
    Browse the repository at this point in the history

Commits on Nov 2, 2023

  1. Configuration menu
    Copy the full SHA
    9f7a2a2 View commit details
    Browse the repository at this point in the history
  2. [PR Review]: Reverting changes (separate issue)

    - created issue emscripten-core#20600 to implement in a separate PR
    ypujante committed Nov 2, 2023
    Configuration menu
    Copy the full SHA
    454cd0f View commit details
    Browse the repository at this point in the history
  3. [PR Review]: getting rid of initialization

    - the rationale is that the client can simply call Module.setHiDPIAware based on the needs
    ypujante committed Nov 2, 2023
    Configuration menu
    Copy the full SHA
    15f1ff1 View commit details
    Browse the repository at this point in the history
  4. [PR Review]: fix bad api call

    - ironically, although the call was wrong, it ended up doing the right thing...
    ypujante committed Nov 2, 2023
    Configuration menu
    Copy the full SHA
    e38a34c View commit details
    Browse the repository at this point in the history

Commits on Nov 3, 2023

  1. Merge branch 'hi-dpi-aware'

    # Conflicts:
    #	src/library_glfw.js
    ypujante committed Nov 3, 2023
    Configuration menu
    Copy the full SHA
    b291873 View commit details
    Browse the repository at this point in the history

Commits on Nov 4, 2023

  1. Configuration menu
    Copy the full SHA
    51f3288 View commit details
    Browse the repository at this point in the history

Commits on Nov 6, 2023

  1. Merge remote-tracking branch 'origin/main' into hi-dpi-aware

    # Conflicts:
    #	src/library_browser.js
    ypujante committed Nov 6, 2023
    Configuration menu
    Copy the full SHA
    08a5b69 View commit details
    Browse the repository at this point in the history

Commits on Nov 7, 2023

  1. added comprehensive test

    - mocking devicePixelRatio allow to write a comprehensive test
    - added handling dynamic changes to devicePixelRatio by installing a listener
    ypujante committed Nov 7, 2023
    Configuration menu
    Copy the full SHA
    f4320c3 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    875f440 View commit details
    Browse the repository at this point in the history
  3. fixes error in CI

    - unclear why it works locally
    ypujante committed Nov 7, 2023
    Configuration menu
    Copy the full SHA
    91aa2ad View commit details
    Browse the repository at this point in the history
  4. changes from code review

    ypujante committed Nov 7, 2023
    Configuration menu
    Copy the full SHA
    80b982b View commit details
    Browse the repository at this point in the history

Commits on Nov 11, 2023

  1. Configuration menu
    Copy the full SHA
    7d4fdcd View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c30e05e View commit details
    Browse the repository at this point in the history

Commits on Nov 14, 2023

  1. Merge remote-tracking branch 'origin/main' into hi-dpi-aware

    # Conflicts:
    #	src/library_glfw.js
    ypujante committed Nov 14, 2023
    Configuration menu
    Copy the full SHA
    f73c502 View commit details
    Browse the repository at this point in the history
  2. simplified code further

    - Browser.setCanvasSize sets win.width and win.height already so it should not be overridden afterwards
    - Browser.setCanvasSize also triggers the win.windowSizeFunc callback when appropriate (window size has actually changed)
    ypujante committed Nov 14, 2023
    Configuration menu
    Copy the full SHA
    6ff6773 View commit details
    Browse the repository at this point in the history

Commits on Nov 21, 2023

  1. Configuration menu
    Copy the full SHA
    11d5832 View commit details
    Browse the repository at this point in the history

Commits on Nov 22, 2023

  1. Configuration menu
    Copy the full SHA
    241e027 View commit details
    Browse the repository at this point in the history
  2. Moved API to GLFW

    - now GLFW use GLFW_SCALE_TO_MONITOR during window creation to determine hi dpi awareness
    - Module.setHiDPIAware is only set when using GLFW (making sure that other platforms don't accidentally use it)
    ypujante committed Nov 22, 2023
    Configuration menu
    Copy the full SHA
    f3de65e View commit details
    Browse the repository at this point in the history

Commits on Nov 29, 2023

  1. Configuration menu
    Copy the full SHA
    a999fd0 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7cc2f59 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    a81f9a0 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    80be65a View commit details
    Browse the repository at this point in the history

Commits on Nov 30, 2023

  1. removed SDL reference

    ypujante committed Nov 30, 2023
    Configuration menu
    Copy the full SHA
    86aff8e View commit details
    Browse the repository at this point in the history
  2. renamed Browser->GLFW

    ypujante committed Nov 30, 2023
    Configuration menu
    Copy the full SHA
    73f6b2f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    4ae7e31 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    95a6918 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    7a7e2ab View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    2365d0e View commit details
    Browse the repository at this point in the history
  7. renamed exported function

    ypujante committed Nov 30, 2023
    Configuration menu
    Copy the full SHA
    1f4f37f View commit details
    Browse the repository at this point in the history

Commits on Dec 1, 2023

  1. use GLFW_SCALE_TO_MONITOR dynamically

    - removed function from module
    - simply use glfwSetWindowAttrib instead
    ypujante committed Dec 1, 2023
    Configuration menu
    Copy the full SHA
    767676a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9d29c8d View commit details
    Browse the repository at this point in the history
  3. removed unecessary options

    ypujante committed Dec 1, 2023
    Configuration menu
    Copy the full SHA
    eb2dbf9 View commit details
    Browse the repository at this point in the history

Commits on Dec 4, 2023

  1. fixed missing ;

    ypujante committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    66c6e2a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4187761 View commit details
    Browse the repository at this point in the history
  3. renamed attribute

    ypujante committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    822f55d View commit details
    Browse the repository at this point in the history
  4. added descriptive comment

    ypujante committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    8a58de4 View commit details
    Browse the repository at this point in the history

Commits on Dec 5, 2023

  1. Configuration menu
    Copy the full SHA
    be0979e View commit details
    Browse the repository at this point in the history
  2. Merge remote-tracking branch 'origin/main' into hi-dpi-aware

    # Conflicts:
    #	src/library_glfw.js
    ypujante committed Dec 5, 2023
    Configuration menu
    Copy the full SHA
    1b87dd7 View commit details
    Browse the repository at this point in the history

Commits on Dec 6, 2023

  1. Configuration menu
    Copy the full SHA
    a3fb66d View commit details
    Browse the repository at this point in the history