export module ra3.wasmgl; import std; export import ra3.core; import ra3.render; import ra3.client; /** * Fallback wasm-worker WebGL backend for builds without Emscripten. `init` fails * so the caller can select another display; the class name matches the real * `ra3.wasmgl` module so the backend factory in `ra3.display` compiles * unchanged. */ export namespace ra3::wasmgl { /** No-op off Emscripten (there is no Emscripten virtual filesystem). */ inline auto mount_assets(const std::string & = "/assets.manifest.json", const std::string & = "/assets", const std::string & = "assets/") -> int { return 0; } class wasmgl_display final : public ra3::client::display { public: [[nodiscard]] auto init(const ra3::client::display_options &) -> bool override { return false; } [[nodiscard]] auto present(const ra3::render::image &, const ra3::render::view_rect &, bool) -> bool override { return false; } [[nodiscard]] auto poll_event(ra3::render::ui_event &) -> bool override { return false; } [[nodiscard]] auto window_size() const -> std::pair override { return {0, 0}; } [[nodiscard]] auto key_down(ra3::render::ui_key) const -> bool override { return false; } auto shutdown() -> void override {} [[nodiscard]] auto name() const -> std::string_view override { return "wasmgl(null)"; } }; }