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

Rework window system binding #100

Open
6 tasks
hujiajie opened this issue Apr 18, 2020 · 2 comments
Open
6 tasks

Rework window system binding #100

hujiajie opened this issue Apr 18, 2020 · 2 comments

Comments

@hujiajie
Copy link
Collaborator

hujiajie commented Apr 18, 2020

Aquarium has been using GLFW for window system binding. This currently works for the D3D backend thanks to the GLFW_NO_API and native access tricks. However, GLFW advertises itself as a library for OpenGL, OpenGL ES and Vulkan development, which makes the D3D use case somewhat weird. Taking the planned WebGPU port in consideration, it also sounds too hard or even impossible to extend Emscripten's GLFW simulation layer for the related APIs, so the only feasible solution there is to use Emscripten primitives instead. The proposal is to replace GLFW with a home-made window system binding implementation by:

  • Introducing a window system abstraction layer, and making GLFW a backend of it
  • Implementing the Win32 backend
  • Implementing the X11 backend
  • Implementing the Cocoa backend
  • Implementing the Emscripten backend
  • Dropping the GLFW backend

And a Wayland backend may also be needed in the future, so that's why the proposal tends to avoid naming the backends using OS names.

@JiangYizhou
Copy link
Contributor

Glfw was convenient because it's compatible with different os and it helped to resize the window. It's quite large effort to write all of the window system and resize work by ourselves.

@hujiajie
Copy link
Collaborator Author

Yeah, the work is non-trivial, but I tend to have a try if it can make the WASM build less specialized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants