Separate Systems/Pipelines for Update and Draw cycles #1737
-
|
Hi, I'm using Flecs.NET with Monogame, but this question applies to the framework, language-independent. If I want to have a set of systems in a pipeline meant for dealing with the game's logic and another set of systems in a separate pipeline meant for drawing, how can I accomplish that using Flecs? I'm new to Flecs, but a first read of the docs seems to assume there will always be a single pipeline. I think I can just keep swapping pipelines with // Initialization
{
...
var updatePipeline = world.Pipeline()
.With(Ecs.System)
.Without<DrawPhase>()
.Build();
var drawPipeline = world.Pipeline()
.With(Ecs.System)
.With<DrawPhase>()
.Build();
...
}
// Update
{
...
world.SetPipeline(updatePipeline);
world.Progress();
...
}
// Draw
{
...
world.SetPipeline(drawPipeline);
world.Progress();
...
} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
Switching pipelines should be fast enough! You can also use |
Beta Was this translation helpful? Give feedback.
Switching pipelines should be fast enough! You can also use
world.RunPipeline(drawPipeline).