Compare commits
5 Commits
7b83bba1c1
...
d073442e2b
Author | SHA1 | Date |
---|---|---|
Rekai Nyangadzayi Musuka | d073442e2b | |
Rekai Nyangadzayi Musuka | 3bc04248fb | |
Rekai Nyangadzayi Musuka | e37adbd1f0 | |
Rekai Nyangadzayi Musuka | 7ad5658617 | |
Rekai Nyangadzayi Musuka | 0cfa79d0c8 |
|
@ -13,7 +13,7 @@ This is a simple (read: incomplete) for-fun long-term project. I hope to get "mo
|
||||||
- [x] Affine Sprites
|
- [x] Affine Sprites
|
||||||
- [ ] Windowing (see [this branch](https://git.musuka.dev/paoda/zba/src/branch/window))
|
- [ ] Windowing (see [this branch](https://git.musuka.dev/paoda/zba/src/branch/window))
|
||||||
- [ ] Audio Resampler (Having issues with SDL2's)
|
- [ ] Audio Resampler (Having issues with SDL2's)
|
||||||
- [x] Immediate Mode GUI (see [this branch](https://git.musuka.dev/paoda/zba/src/branch/imgui))
|
- [ ] Immediate Mode GUI
|
||||||
- [ ] Refactoring for easy-ish perf boosts
|
- [ ] Refactoring for easy-ish perf boosts
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
@ -91,17 +91,17 @@ zig-datetime | <https://github.com/frmdstryr/zig-datetime>
|
||||||
`bitfields.zig` | [https://github.com/FlorenceOS/Florence](https://github.com/FlorenceOS/Florence/blob/aaa5a9e568/lib/util/bitfields.zig)
|
`bitfields.zig` | [https://github.com/FlorenceOS/Florence](https://github.com/FlorenceOS/Florence/blob/aaa5a9e568/lib/util/bitfields.zig)
|
||||||
`gl.zig` | <https://github.com/MasterQ32/zig-opengl>
|
`gl.zig` | <https://github.com/MasterQ32/zig-opengl>
|
||||||
|
|
||||||
Use `git submodule update --init` from the project root to pull the git relevant git submodules
|
Use `git submodule update --init` from the project root to pull the git submodules `SDL.zig`, `zig-clap`, `known-folders`, `zig-toml` and `zig-datetime`
|
||||||
|
|
||||||
Be sure to provide SDL2 using:
|
Be sure to provide SDL2 using:
|
||||||
|
|
||||||
- Linux: Your distro's package manager
|
- Linux: Your distro's package manager
|
||||||
- MacOS: `brew` (install [this formula](https://formulae.brew.sh/formula/sdl2))
|
- MacOS: ¯\\\_(ツ)_/¯
|
||||||
- Windows: [`vcpkg`](https://github.com/Microsoft/vcpkg) (install `sdl2:x64-windows`)
|
- Windows: [`vcpkg`](https://github.com/Microsoft/vcpkg) (install `sdl2:x64-windows`)
|
||||||
|
|
||||||
`SDL.zig` will provide a helpful compile error if the zig compiler is unable to find SDL2.
|
`SDL.zig` will provide a helpful compile error if the zig compiler is unable to find SDL2.
|
||||||
|
|
||||||
Once you've got all the dependencies, execute `zig build -Doptimize=ReleaseSafe`. The executable is located at `zig-out/bin/`.
|
Once you've got all the dependencies, execute `zig build -Drelease-fast`. The executable is located at `zig-out/bin/`.
|
||||||
|
|
||||||
## Controls
|
## Controls
|
||||||
|
|
||||||
|
|
15
build.zig
15
build.zig
|
@ -25,22 +25,23 @@ pub fn build(b: *std.build.Builder) void {
|
||||||
exe.setMainPkgPath("."); // Necessary so that src/main.zig can embed example.toml
|
exe.setMainPkgPath("."); // Necessary so that src/main.zig can embed example.toml
|
||||||
|
|
||||||
// Known Folders (%APPDATA%, XDG, etc.)
|
// Known Folders (%APPDATA%, XDG, etc.)
|
||||||
exe.addAnonymousModule("known_folders", .{ .source_file = .{ .path = "lib/known-folders/known-folders.zig" } });
|
exe.addPackagePath("known_folders", "lib/known-folders/known-folders.zig");
|
||||||
|
|
||||||
// DateTime Library
|
// DateTime Library
|
||||||
exe.addAnonymousModule("datetime", .{ .source_file = .{ .path = "lib/zig-datetime/src/main.zig" } });
|
exe.addPackagePath("datetime", "lib/zig-datetime/src/main.zig");
|
||||||
|
|
||||||
// Bitfield type from FlorenceOS: https://github.com/FlorenceOS/
|
// Bitfield type from FlorenceOS: https://github.com/FlorenceOS/
|
||||||
exe.addAnonymousModule("bitfield", .{ .source_file = .{ .path = "lib/util/bitfield.zig" } });
|
// exe.addPackage(.{ .name = "bitfield", .path = .{ .path = "lib/util/bitfield.zig" } });
|
||||||
|
exe.addPackagePath("bitfield", "lib/util/bitfield.zig");
|
||||||
|
|
||||||
// Argument Parsing Library
|
// Argument Parsing Library
|
||||||
exe.addAnonymousModule("clap", .{ .source_file = .{ .path = "lib/zig-clap/clap.zig" } });
|
exe.addPackagePath("clap", "lib/zig-clap/clap.zig");
|
||||||
|
|
||||||
// TOML Library
|
// TOML Library
|
||||||
exe.addAnonymousModule("toml", .{ .source_file = .{ .path = "lib/zig-toml/src/toml.zig" } });
|
exe.addPackagePath("toml", "lib/zig-toml/src/toml.zig");
|
||||||
|
|
||||||
// OpenGL 3.3 Bindings
|
// OpenGL 3.3 Bindings
|
||||||
exe.addAnonymousModule("gl", .{ .source_file = .{ .path = "lib/gl.zig" } });
|
exe.addPackagePath("gl", "lib/gl.zig");
|
||||||
|
|
||||||
// gdbstub
|
// gdbstub
|
||||||
Gdbstub.link(exe);
|
Gdbstub.link(exe);
|
||||||
|
@ -48,7 +49,7 @@ pub fn build(b: *std.build.Builder) void {
|
||||||
// Zig SDL Bindings: https://github.com/MasterQ32/SDL.zig
|
// Zig SDL Bindings: https://github.com/MasterQ32/SDL.zig
|
||||||
const sdk = Sdk.init(b, null);
|
const sdk = Sdk.init(b, null);
|
||||||
sdk.link(exe, .dynamic);
|
sdk.link(exe, .dynamic);
|
||||||
exe.addModule("sdl2", sdk.getNativeModule());
|
exe.addPackage(sdk.getNativePackage("sdl2"));
|
||||||
|
|
||||||
exe.install();
|
exe.install();
|
||||||
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 6b33f1f4299ec8814e9fb3b206cda37791ced574
|
Subproject commit 59a458abd9220703ca4d8b7f99080780c61c2f8c
|
|
@ -1 +1 @@
|
||||||
Subproject commit 53fe3b676f32e59d46f4fd201d7ab200e5f6cb98
|
Subproject commit 6b37490ac7285133bf09441850b8102c9728a776
|
|
@ -1 +1 @@
|
||||||
Subproject commit c1158b547e54d82f5ac7aba4cf372c6e061b1eab
|
Subproject commit d7b8d7acb15ce3518480c59218bf2c0a17fa529f
|
|
@ -1 +1 @@
|
||||||
Subproject commit 272d8e2088b2cae037349fb260dc05ec46bba422
|
Subproject commit 6c9ca9025199b145c42a75d10cadb3f97879ee6d
|
Loading…
Reference in New Issue