Skip to content

mach: Unified entry point and redesigned engine core #257

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

Merged
merged 7 commits into from
Apr 29, 2022

Conversation

iddev5
Copy link
Contributor

@iddev5 iddev5 commented Apr 28, 2022

From https://matrix.to/#/!hPlvgnLQhMkTucKPrh:matrix.org/$_m_5exLov-5Ue5sGq-6_veTZ0k-RVJAZo9Lj5igjeXA?via=matrix.org


This PR implements:

  • Unified entry point which would be consistent across all backends (platforms). Right now, we only support desktops which has pub fn main as their entry point but it doesnt work in other environments like wasm (web) and android or require additional configurations, like in iOS. So instead ask the end application to provide a set of functions: init, deinit, update and resize (and more in future) which are used as per platform limitations behind the scenes
  • The bare bones of the Engine struct which would hold the actual engine functionality. It currently has core (window, events etc) and gpu_driver (webgpu structs). The goal is to provide a cross platform abstraction over these interfaces.

Additionally:

  • An App struct was added in root build.zig which acts as the build system SDK, Its point is to set up the complex build process behind the scenes.
  • The Options which were previously being passed to old App on init is now managed though an exported declaration in the app file using pub const options: mach,Engine.Options = {...};

This PR does not includes:

  • Tests, will need discussion on how to do it, in future (Note that even the old application code didnt had any tests)
  • All the examples and shader toy. This is because modifications of examples create ugly diffs and would make this PR difficult to review. In order to not regress the engine, I have ported the examples over in another branch, which I will PR soon keeping really short time difference between both. Or additionally, I can push it over to this branch as soon as review of these below commits are done.

Progress towards #18


  • By selecting this checkbox, I agree to license my contributions to this project under the license(s) described in the LICENSE file, and I have the right to do so or have received permission to do so by an employer or client I am producing work for whom has this right.

@emidoots
Copy link
Member

I have a few thoughts about the core and gpu_driver structs, but I can imagine I don't have full picture of how they will be swapped out in a browser context yet so I'm happy to wait to discuss those.

This is a clear improvement over the status quo, so merging!

@emidoots emidoots merged commit 5c984d9 into hexops:main Apr 29, 2022
@iddev5 iddev5 deleted the ay-app-entry branch April 30, 2022 01:38
@emidoots emidoots added the mach label Aug 6, 2022
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.

2 participants