Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Something is rendering! but still mostly broken.
Analysis
Entities are used all over bevy_egui to refer to items:
To me, it seems that most entities should refer to render world's.
But the source to get these Entities are sometimes
ExtractedWindows
, which is from main world:Questions:
Which world should our key entities be from ?
RenderEntity
Since most operations are from the render schedules, I think it makes sense to be on
RenderEntity
.Not blocking: We can't use
RenderEntity
as a key because Eq and Hash are not derived. We could reimplement our own but it's an annoyance.This should be fixed by bevyengine/bevy#16191
Blocking (?): When in
queue_pipelines_system
, our window doesn't have aRenderEntity
, so it's difficult to add aRenderEntity
key.TODO: ? we could try to replace the window extract (which I believe comes from bevy), to create our own extraction logic which would occur earlier, but I fear this would result in surprises for users. (and I'm not sure it's possible).
MainEntity
So if I can´t rely on RenderEntity, let's try to rely on the Entity from main world:
EguiRenderToTextureNode::render_to_texture_target
is split into 2 entities, to keep links at all times.unfortunately this doesn´t work, I'm not sure where the error is.
I'll hunt for error handling in case of entities not found and add more debug while I think of better debugging strategy 🤔
Debugging attempt
EguiNode::update()
is never called, I guess that suggests a wrong use of bevy's API.