Skip to content

[META::Emscripten] Live version integration strategy and progress report #888

Description

@PavelSharp

The first step in integrating Emscripten is to choose the backend. See the report below.

Emscripten Integration Report

Good News

  1. ⭐⭐ Successfully built and tested demo/sdl3_renderer.
    Everything works, including builds with INCLUDE_ALL. However, this requires either merging the small PR fix(style_configurator): fix unsafe int to nk_bool pointer casts #883 or manually fixing it by adjusting field types.
  2. ⭐ Successfully built and tested demo/sdl_opengles2.
    Everything works as expected. Untested with INCLUDE_ALL.
  3. ❌Successfully built demo/sdl_renderer.
    Launch is currently unsuccessful, since opening index.html results in an infinite loading loop. But I didn't take many attempts.

Bad News

  1. Standard examples (Nuklear/example/) based on GLEW/GLFW do not build due to glMapBuffer and glUnmapBuffer calls.
    1.1 The issue is described here issues/319.
    1.2 There is an interesting PR Reduce differences between the OpenGL 3 and OpenGL ES 2 demos #873 that introduces a have_mapbuffer flag, but it is always true. As a temporary workaround, its value could be set based on the __EMSCRIPTEN__ macro.
    1.3 This PR will only fix demos including demo/glfw_opengl3, but the our examples (based on GLFW/OpenGL3 too) remain unchanged.
  2. If we choose sdl3_renderer as the Emscripten backend, we cannot include demo/common/file_browser.c, since the icon_load uses direct OpenGL calls. This is already fixed in Support the file browser with more demos #590.

Notes

  1. Some work on Emscripten support has already been done by @DeXP:
    1.1. In the old repository, this PR added sdl_opengles2 and a web rule to Makefile.
    1.2. About 10 years ago, a live version was created, but it is no longer maintained.
  2. I believe, for sdl3_renderer, it may also make sense to add a web rule in the Makefile to improve consistency.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions