Skip to content

gilzoide/d-sokol-game

Repository files navigation

d-sokol-game

An experimental game made using D + sokol_gfx.

Currently using GLFW for windowing with OpenGL backend and Meson for building.

Available for preview directly in your browser here.

Building

First, ensure git submodules are initialized:

$ git submodule update --init

Running sh tools/setup-all.sh will setup the following build configurations with Meson:

  • build: debug build, using GDC because it's currently the only compiler with support for Makefile-style dependecy files, so incremental rebuilds are done correctly.
  • build/release: release native build, using LDC with the betterC flag and linking the executable as C, so there is no link-time or runtime dependency on libphobos or druntime.
  • build/web: emscripten powered WebAssembly build, using LDC with the betterC flag for D code. If you encounter a compile error with the message Error: version identifier WASI is reserved and cannot be set, run sh libs/remove_wasi_version_gambi.sh for editing some druntime files as a workaround.
  • build/release/web: release web build, with code optimizations turned on.
  • build/release/win32: release Windows x32 build cross-compiled using MinGW. If you encounter a compile error with the message ../../../libs/druntime/src/core/stdc/stdio.d(1209): Error: undefined identifier FILE, run sh libs/rename_cruntime_microsoft_mingw_gambi.sh for editing some druntime files as a workaround. If you encounter a compile error with the message -m32 and -m64 switches cannot be used together with -march and -mtriple switches, run sh tools/remove_mXX_cross_windows_gambi.sh for editing the Ninja build file as a workaround.

For building them:

$ meson compile -C build
$ meson compile -C build/release
$ meson compile -C build/web
$ meson compile -C build/release/web

Running

For native desktop targets, just run the executable files generated by the builds.

For the web build, open a HTTP server on build/web or build/release/web, for example with http-server:

$ http-server build/web
$ http-server build/release/web

Then access your server address and open the HTML file.

About

An experimental game made using D + sokol_gfx

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages