No description
Find a file
InKryption 28a0aebd95
glfw: window hints rework (#71)
* glfw: make comments into doc comments
* glfw: Publicize Window.CursorPos, Window.Size, Window.Pos, and Window.FrameSize
* glfw: Make enum value name the same format as other enum value names
* glfw: Window hints rework patch
* glfw: Relegate `Window.hint` to testing; move it down to just above the tests to reflect this, add doc comment line
* glfw: handle error `Error.InvalidEnum` explicitly, for clear error message in this unlikely edge case
* glfw: instate `Hint.context_no_error` as a hint, as it actually is specified to be a Window creation hint by the docs, and affirm removal of `Hint.context_revision`, which isn't.
The docs don't seem to specify a default value for `Hints.context_no_error` to take on, so we could set it based on `std.debug.runtime_safety` like this.
* glfw: default `context_no_error` to `false`, and added a note of caution about its usage as suggested.
* glfw: Inline enum values of `ClientApi`, `ContextCreationApi`, `ContextRobustness`, `ContextReleaseBehavior`, and `OpenGlProfile` from consts.zig, and remove the now unused constants (replaced by aformentioned enum values).
* glfw: Reference `Window.Hint` enum instead of `Window.Hints` struct to ensure fields are the same
* glfw: add comment explaining default values of `Window.Hints`
* glfw: change `OpenGlProfile` to `OpenGLProfile` based on established naming convention
* glfw: Update actual declaration of `OpenGLProfile`
* glfw: call `Window.defaultHints` after window creation, not before
* glfw: remove 'consts.zig', and move `dont_care` directly into 'main.zig'; fix anything referencing it.
* glfw: put `Window.defaultHints` into defer statement to handle cleanup in all paths
* glfw: move `Hint.focused` to match position of `Hints.focused`
* glfw: do 'zig fmt glfw/src'
* glfw: Cull `Window.Hint` comments, polish remaining; match order entirely according to current GLFW docs
* glfw: Change `Window.Hints.*Api` to `Window.Hints.*API`

Co-authored-by: Stephen Gutekanst <stephen@hexops.com>
2021-11-15 18:41:16 -07:00
.github CI: correct generation of Silver sponsors section 2021-11-07 13:16:36 -07:00
dev move GLFW into sub-repository, use git subtree to sync (#42) 2021-10-24 07:19:38 -07:00
glfw glfw: window hints rework (#71) 2021-11-15 18:41:16 -07:00
src glfw: add terminate function 2021-07-16 15:24:45 -07:00
webgpu webgpu: add README 2021-07-04 12:17:37 -07:00
.gitattributes initialize repository 2021-07-04 10:36:34 -07:00
.gitignore gitignore: update to latest from ziglang/zig repo 2021-07-06 20:51:19 -07:00
build.zig add -Dtarget option 2021-07-10 14:47:32 -07:00
LICENSE LICENSE: note directories with a separate LICENSE file 2021-07-05 12:46:20 -07:00
LICENSE-APACHE initialize repository 2021-07-04 10:36:34 -07:00
LICENSE-MIT initialize repository 2021-07-04 10:36:34 -07:00
README.md README: regenerate sponsors section 2021-11-15 22:37:30 +00:00

Mach - Game engine & graphics toolkit for the future

Mach engine CI Hexops logo

⚠️ Project status: in-development ⚠️

Under heavy development, not ready for use currently. Follow @machengine on Twitter for updates.

News

You can read about major Mach engine developments at devlog.hexops.com:

Zero fuss installation & cross compilation

Mach is built from the ground up to support zero fuss installation & cross compilation, only zig and git are needed to build from any OS and produce binaries for every platform.

If you've ever worked with game engines in C, C++, Rust, Go, or any other language you've probably run into issues at one point getting the right system dependencies installed, whether it be library versions, compilers, system SDKs, X11/GLFW/SDL C dependencies, etc. With Mach, none of this is needed - it's all sorted out for you automagically.

Mach is able to do this thanks to Zig being a C/C++ compiler, Zig's linker zld supporting macOS cross compilation, and us doing the heavy lifting of packaging the required system SDK libraries and C sources for every dependency we need so our Zig build scripts can simply git clone them for you as needed for the target OS you're building for, completely automagically.

Supported platforms

Mach is still incredibly early stages, so far we have support for building from the following OS to the following targets:

Building for From macOS x86_64 From macOS M1/aarch64 From Linux x86_64 From Windows x86_64
macOS x86_64
macOS M1/aarch64
Linux x86_64
Windows x86_64
iOS 🏃 🏃 🏃 🏃
Android 🏃 🏃 🏃 🏃
  • Tested and verified via CI.
  • ✔️ Should work, not tested via CI yet.
  • 🏃 Planned or in progress.
  • ⚠️ Implemented, but has known issues (e.g. bugs in Zig.)

Libraries for all

Whether you're interested in using all of Mach, or just some parts of it, you get to choose. Our libraries all aim to have the same zero-fuss installation, cross compilation, and platform support:

  • mach-glfw: Ziggified GLFW bindings with 100% API coverage

About sub-repositories

In this repository, we maintain Mach as a monorepo. We pull in all commits from our library sub-repositories listed above using git subtree:

git subtree pull --prefix glfw https://github.com/hexops/mach-glfw main

This pulls in all commits from our sub-repositories, and effectively leads to a full history of all Mach development across all core repositories.

Pull requests can be made to any repository (we synchronize both ways via git subtree pull and git subtree push.)

There are only two requirements:

  1. Pull requests in sub-repositories must have a commit message prefix, e.g. glfw: <commit message> to keep our monorepo history nicer - we generally squash merge pull requests so this is not an issue.
  2. Pull requests to this repository may not change multiple sub-repositories in the same commit (e.g. a commit to glfw/ should not also include changes to webgpu/, to avoid confusion.)

Sponsors

If you like Mach engine, or my other work, you may sponsor me on GitHub. This will make my day, it's a huge vote of confidence and I really appreciate your support!

Silver sponsors

Bronze sponsors