Skip to content
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

execution metadata syntax #163

Open
zaucy opened this issue Aug 14, 2024 · 0 comments
Open

execution metadata syntax #163

zaucy opened this issue Aug 14, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@zaucy
Copy link
Member

zaucy commented Aug 14, 2024

We eventually want to support 'execution metadata' which is data that is available at execution time. An example of this is system 'delta time'. Currently the way to support delta time has been hacky and the intention is to support this kind of data directly.

Here's a idea. We allow exactly one metadata block to be declared per file (and maybe limit it to the top of the file after imports.) We may have to limit it to the main package only or have some kind of merging rules when packages import other packages, but time will tell.

metadata {
  f32 delta_time;
}

ecsact_runtime changes

void ecsact_execute_systems
  ( ecsact_registry_id
  , const void* execution_metadata // NEW PARAMETER
  );

// NEW FUNCTION
const void* ecsact_system_execution_context_get_execution_metadata
  ( ecsact_system_execution_context*
  );

c++ wrapper

void example::ExampleSystem::impl(context& ctx) {
  // Access delta_time like this:
  const float delta_time = ctx.execution_metadata().delta_time;
}
@zaucy zaucy added the enhancement New feature or request label Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant