Skip to content

Allow using RenderPlugin and WinitPlugin with WindowPlugin being disabled #19042

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

Closed
wants to merge 10 commits into from

Conversation

hukasu
Copy link
Contributor

@hukasu hukasu commented May 3, 2025

Objective

Allow using RenderPlugin and WinitPlugin on apps that have WindowPlugin disabled.

Solution

Create guards for systems and methods that rely on resources inserted by WindowPlugin.

Testing

Doing experiments for #19311

@alice-i-cecile alice-i-cecile added A-Rendering Drawing game state to the screen A-Windowing Platform-agnostic interface layer to run your app in C-Usability A targeted quality-of-life change that makes Bevy easier to use S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels May 5, 2025
@alice-i-cecile
Copy link
Member

Generally pretty reasonable idea. Can you explain your use case here? I assume this is for headless testing or something?

@hukasu
Copy link
Contributor Author

hukasu commented May 5, 2025

I was trying to make a test for programatic detection of the memory leaks when using get_mut on Mesh or Material, which required RenderPlugin, but would be nice if it could run without a window, that is how i got the data for #19035

@hukasu hukasu mentioned this pull request May 20, 2025
1 task
@hukasu
Copy link
Contributor Author

hukasu commented May 20, 2025

@alice-i-cecile the test for render asset leak detection is up

Copy link
Member

@tychedelia tychedelia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally a few issues here with this approach even if one does want to use headless rendering, but I'm not sure this makes sense overall. I'm not opposed to more decoupling, but bevy_window barely adds any behavior in the first place as is intended to serve as an interface for bevy_winit. Further, even in the headless scenario, there may be instances where the user wants to mock input. Using events is a form of decoupling already and it seems relatively harmless to register them even if a window is not being created. In addition to adding a lot of cruft in terms of guards, I'm not sure the juice is worth the squeeze here.

@hukasu
Copy link
Contributor Author

hukasu commented May 24, 2025

@alice-i-cecile what happened?

@hukasu
Copy link
Contributor Author

hukasu commented May 25, 2025

@tychedelia i think i have fixed the 3 complaints that you raised, and created a test that takes a screenshot through a headless app but the image still comes out completely black, so there must be somewhere else that i went to hard that still needs proper treatment

@hukasu
Copy link
Contributor Author

hukasu commented May 25, 2025

sometimes my reading skills are just...

so you mean to just do .set(WindowPlugin { primary_window: None, exit_condition: ExitCondition::DontExit, ..default())

@alice-i-cecile
Copy link
Member

I'm a little bit skeptical of the value of this use case after @tychedelia's comments. Sorry for not being more communicative: feel free to reopen and argue your case.

@hukasu
Copy link
Contributor Author

hukasu commented May 25, 2025

I've tried again without disabling Window plugin and got it to work, and now I don't remember what block I hit to lead me into going into this track

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen A-Windowing Platform-agnostic interface layer to run your app in C-Usability A targeted quality-of-life change that makes Bevy easier to use S-Needs-Review Needs reviewer attention (from anyone!) to move forward
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy