Skip to content

execution metadata syntax #163

@zaucy

Description

@zaucy

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_metadata
  ( ecsact_system_execution_context*
  );

c++ wrapper

void example::ExampleSystem::impl(context& ctx) {
  // Access delta_time like this:
  const float delta_time = ctx.metadata().delta_time;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions