#pragma once

#ifdef __EMSCRIPTEN__

#include <SDL3/SDL_video.h>

class crApp;

// Bridge to the emscripten shell (wasm_shell/__wasm_shell.html). The shell sends intent through
// exported setters and never reads engine values — SyncDevUi pushes display state back instead.
class crWasmBridge
{
public:
    static void InstallLogRedirect();   // before SDL_Init — boot output must reach the page log
    static void AttachWindow( SDL_Window* window );
    static void AttachApp( crApp* app );   // arms the exported setters
    static void SyncDevUi();               // per frame
    static void PumpShellConsole();        // per frame — drains the shell's command box into crDevConsole

    // browser fullscreen belongs to the shell: it also owns the orientation lock and the wake lock,
    // and SDL's own path would enter without either
    static void RequestFullscreen( bool enable );
    static bool IsFullscreen();
};

#endif
