Skip to content

Am I doing this right: using context to add systems #1031

Answered by skypjack
rudiHammad asked this question in Q&A
Discussion options

You must be logged in to vote

I think this is a matter of tastes. In my case, all systems are plain free functions. No need to register them anywhere.
The update function of a scene looks like this:

bool my_scene::update(const renderer &renderer) {
    imgui_system(registry);
    rmlui_context->Update();
    // ....
    scene_system(renderer, registry, owner());
    return true;
}

However, this isn't the first time I've heard of systems being registered with the registry. So I guees it works too.
I strongly prefer to flip the problem on its head because I want each scene to be able to choose to have one, ten, or a hundred registries as well as none at all and just work without a registry (for example, imagine a credit…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by rudiHammad
Comment options

You must be logged in to vote
1 reply
@rudiHammad
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
discussion it sounds interesting, let's discuss it
3 participants