Skip to content

Port minimal_glfw_gl to Emscripten #758

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

Merged
merged 3 commits into from
Jul 5, 2025
Merged

Port minimal_glfw_gl to Emscripten #758

merged 3 commits into from
Jul 5, 2025

Conversation

hazeycode
Copy link
Member

No description provided.

@hazeycode hazeycode requested a review from Copilot July 5, 2025 17:11
Copilot

This comment was marked as outdated.

@hazeycode hazeycode requested a review from Copilot July 5, 2025 17:23
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds Emscripten (WebAssembly) support for the minimal_glfw_gl sample and aligns the existing sdl2_demo web entry point with a similar init/update pattern.

  • Refactor sdl2_demo web loop to separate one-time init from per-frame update.
  • Extract GLFW logic in minimal_glfw_gl into init/deinit/updateAndRender for reuse.
  • Update build scripts and CI to include a new WebAssembly target and integrate minimal_glfw_gl.

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
samples/sdl2_demo/src/main-web.zig Refactored web loop to guard one-time init before update
samples/minimal_glfw_gl/src/minimal_glfw_gl.zig Introduced init/deinit/shouldQuit/updateAndRender API
samples/minimal_glfw_gl/src/main.zig Added native entrypoint that uses the new API
samples/minimal_glfw_gl/src/main-web.zig Added web entrypoint and loop via Emscripten
samples/minimal_glfw_gl/src/build.zig Switched root file to main.zig and added buildWeb step
build.zig Exposed minimal_glfw_gl under samples.web
.github/workflows/main.yml Added CI step to build wasm32-emscripten target
Comments suppressed due to low confidence (1)

samples/minimal_glfw_gl/src/minimal_glfw_gl.zig:7

  • [nitpick] Public API functions like init should have a doc comment describing the purpose of gl_settings and expected behavior.
pub fn init(gl_settings: struct {

@hazeycode hazeycode force-pushed the port-web branch 5 times, most recently from 89acfae to 4969854 Compare July 5, 2025 22:06
@hazeycode hazeycode merged commit 9ac8281 into main Jul 5, 2025
3 checks passed
@hazeycode hazeycode deleted the port-web branch July 5, 2025 22:23
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

Successfully merging this pull request may close these issues.

1 participant