Commit graph

146 commits

Author SHA1 Message Date
Stephen Gutekanst
027939e8ef mach: ensure tools/libs/apple_pie submodule is cloned
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-05-27 21:08:10 -07:00
iddev5
d85c6a8669 mach: build: Use proper application name in case of wasm
This uses the new html-generator tool to automatically fix the file
names in resulting application.html
2022-05-27 21:08:10 -07:00
iddev5
8d4c51738e mach: build+tools: allow address and port of http server be configurable
for wasm

MACH_ADDRESS and MACH_PORT environment variable are added.
2022-05-27 21:08:10 -07:00
iddev5
8b8ed4dc8f mach: build: cleanup and add notes 2022-05-27 21:08:10 -07:00
iddev5
e7f7737cc8 mach: build: Implement run step for wasm applications
This actually compiles and runs a http server (based on apple_pie) and
uses xdg-open (on unixes) and open (on rest) to launch the browser.

The steps actually take place in reverse order because running a web
server would block the current process (limitation of RunStep). Hence we
are assuming that (xdg-)open is just a launcher and would take a while
to open the browser application.
2022-05-27 21:08:10 -07:00
iddev5
84af4e118c mach: build: install additional files (html, js) in case of wasm
Install the files template.html (renamed to application.html) and
mach.js in case of WASM. Also changed the install directory to
{prefix}/www.
2022-05-27 21:08:10 -07:00
iddev5
1c2dbfbd4f mach: build: simplify stating of dependencies for apps 2022-05-27 21:08:10 -07:00
iddev5
b5737af9cd examples: Load all images from Memory (using embedFile) instead of File 2022-05-27 01:09:15 -07:00
d3m1gd
ed0d9c100f mach: fix build.zig 2022-05-26 18:29:43 -07:00
iddev5
f64595393b mach: include example name in step descriptions 2022-05-23 00:06:35 -07:00
iddev5
4fad3b93d2 mach: add compile-only step for examples and shaderexp
These steps will only compile and install the applications but not run
it. To be used as ``zig build example-*`` and ``zig build shaderexp``
respectively, i.e without the run prefix.
2022-05-23 00:06:35 -07:00
iddev5
dbdb2173b8 mach: do not install apps implicitly by default 2022-05-22 11:44:21 -07:00
iddev5
1491167daa mach: wasm: enabled boids example and do not compile examples which are
unsupported
2022-05-22 11:44:21 -07:00
iddev5
ae4374b9df mach: wasm specific build system fixes
- Disable some examples
- Dont compile shaderexp at all
- Block off all run steps
2022-05-22 11:44:21 -07:00
iddev5
7466f32b62 mach: build system SDK improvements for wasm
- Target is now passed as an option in App.init()
- Always install() in all case
- Add functions getInstallStep(), setBuildMode() and run()
2022-05-22 11:44:21 -07:00
PiergiorgioZagaria
1e8ad533e2
examples: gkurve added shapes and textures (#284) 2022-05-22 08:52:40 -07:00
iddev5
657091ed65 mach: Reorganised native backend files, moved structs and fixed circular
dependency
2022-05-15 10:36:08 -07:00
PiergiorgioZagaria
a1daf399a3 examples: created gkurve example 2022-05-08 15:02:39 -07:00
Lee Cannon
4570838304
Update to latest Zig master (0.10.0-dev.2017+a0a2ce92c) (#261)
* use `@ceil` instead of `std.math.ceil`
* `ChildProcess.init` does not allocate anymore
* update CI zig version
* examples: temporarily switch to fork of zigimg compatible with zig-master

Commands executed:

```
git submodule set-url -- examples/libs/zigimg https://github.com/slimsag/zigimg
git submodule set-branch --branch zig-master -- examples/libs/zigimg
git submodule update --init --remote examples/libs/zigimg
```

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
Co-authored-by: Stephen Gutekanst <stephen@hexops.com>
2022-05-01 11:44:27 -07:00
iddev5
e1192877c3 build: compile examples and applications on demand
Without this change, anytime a dependency is modified, all the examples
and applications are rebuilt before tring to run any of them. The
problem with this approach is that it leads to long compile times which
will keep on increasing as more and more examples are added.
2022-04-30 01:10:56 -07:00
iddev5
7c518f7bd6 shaderexp: port to new API 2022-04-29 13:06:42 -07:00
iddev5
218a6a5c08 examples: port to new API 2022-04-29 13:06:34 -07:00
iddev5
5c984d9795 mach: finalizing changes for now 2022-04-29 12:48:47 -07:00
iddev5
2aedc4ca01 mach: implement App struct in terms of unified entry point 2022-04-29 12:48:47 -07:00
iddev5
d99359421e mach: begin unified entry point interface 2022-04-29 12:48:47 -07:00
Stephen Gutekanst
4a5b37787d correct asset submodule path
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-04-24 20:10:17 -07:00
Stephen Gutekanst
d6f1560afd examples: ensure zigimg & assets submodules are cloned
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-04-24 20:00:40 -07:00
PiergiorgioZagaria
d6dad96059 examples: added fractal-cube example 2022-04-24 23:24:34 +00:00
Stephen Gutekanst
d0d0db8725 examples: add textured-cube example
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-04-24 16:07:59 +00:00
PiergiorgioZagaria
8df8b043ad
shaderexp: add initial shader explorer tool (#245)
* shaderexp: first commit
* shaderexp: further improve error handling
* shaderexp: attribute ray_marching example

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
Co-authored-by: Stephen Gutekanst <stephen@hexops.com>
2022-04-21 04:44:02 -07:00
Stephen Gutekanst
8d574e772c examples: rename texture-light -> advanced-gen-texture-light
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-04-21 04:39:24 -07:00
d3m1gd
45df76bdd8 example: texture and light 2022-04-21 04:39:24 -07:00
Johan Forsberg
3b86aa08cc
examples: add instanced-cube example (#246)
add example based on webgpu-samples' instancedCube sample.

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
Co-authored-by: Stephen Gutekanst <stephen@hexops.com>
2022-04-20 23:00:02 -07:00
Stephen Gutekanst
d664c8e55d
do not produce needless libraries (#220)
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-04-18 10:32:21 -07:00
Stephen Gutekanst
e9671f388c examples: ensure zmath submodule is cloned during zig build
Fixes the issue people are running into at e.g.:

* https://old.reddit.com/r/Zig/comments/u622dq/mach_engine_webgpu_examples_showcase/i564w4s/
* https://twitter.com/slimsag/status/1515925666230784000?s=20&t=M2KXFUcLZT0-mJAcMy6sPw

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-04-17 23:00:39 -07:00
PiergiorgioZagaria
3fb59a1e34
examples: add ported two-cubes example (#228) 2022-04-17 14:31:52 -07:00
PiergiorgioZagaria
f96bbb453e
examples: add ported rotating-cube example (#227) 2022-04-17 13:50:25 -07:00
Andrew Gutekanst
a7727c6b54 examples: add ported boids example
Ported from https://github.com/austinEng/webgpu-samples/
2022-04-14 10:46:31 -07:00
Andrew Gutekanst
9489fe7083 examples: prepare for adding more examples 2022-04-14 10:46:31 -07:00
Silver
d82b3f6cbb publicize gpu and glfw from toplevel build.zig 2022-04-07 18:42:15 -07:00
Silver
6ec499cf70 clean up build.zig and add type to pkg def 2022-04-07 18:42:15 -07:00
Stephen Gutekanst
c3f8f9a4d5 correct glfw package dependency
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-04-05 00:16:51 -07:00
Stephen Gutekanst
49f80de6ab add higher-level app library
Fixes hexops/mach#190

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-04-05 00:16:51 -07:00
InKryption
aae3ea8577 constify unmutated variables in build files 2021-11-22 12:59:11 -07:00
Stephen Gutekanst
add19e2577 add -Dtarget option
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-07-10 14:47:32 -07:00
Stephen Gutekanst
7fcd051870 add main engine library + minimal glfw linking example
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-07-06 20:58:46 -07:00