Skip to content
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

Add minimal emscripten support #666

Merged
merged 1 commit into from
Jun 7, 2024
Merged

Conversation

zturtleman
Copy link
Member

@zturtleman zturtleman commented Jun 7, 2024

This is a minimal emscripten port that will build and run. It supports the OpenGL2 renderer using WebGL 1.0 and 2.0. It uses the generated html file from emscripten and "--preload-file" to merge all pk3s into a single file that emscripten loads as a VFS.

There is a lot of room to improve different aspects like pk3 loading, html integration, loading game logic from .wasm, and build flags. (Which is to say this is not necessarily better or more complete than the several other ports using emscripten.)

  1. Create "baseq3" directory in the same directory as the Makefile.
  2. Copy pak[0-8].pk3 into the created "baseq3" directory.
  3. Run source "/path/to/emsdk_env.sh" to add emcc to PATH.
  4. Run make PLATFORM=emscripten
  5. Serve the build/release-emscripten-wasm32/ioquake3_opengl2.{html,js,wasm,data} from a web server. (Local files aren't allowed to load wasm.)
  6. Load ioquake3_opengl2.html in a web browser from the web server.

@zturtleman zturtleman merged commit f41bd37 into ioquake:main Jun 7, 2024
3 checks passed
@zturtleman zturtleman deleted the emscripten branch June 7, 2024 00:51
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