webatintel / aquarium

BSD 3-Clause "New" or "Revised" License
26 stars 7 forks source link

Rework window system binding #100

Open hujiajie opened 4 years ago

hujiajie commented 4 years ago

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:

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 commented 4 years ago

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 commented 4 years ago

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