Skip to content
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

Windows as entities #4531

Closed
wants to merge 9 commits into from
Closed

Windows as entities #4531

wants to merge 9 commits into from

Conversation

fowenix
Copy link

@fowenix fowenix commented Apr 19, 2022

Objective

Draft PR of #4530

@github-actions github-actions bot added the S-Needs-Triage This issue needs to be labelled label Apr 19, 2022
@alice-i-cecile alice-i-cecile added A-Windowing Platform-agnostic interface layer to run your app in C-Code-Quality A section of code that is hard to understand or change C-Usability A targeted quality-of-life change that makes Bevy easier to use and removed S-Needs-Triage This issue needs to be labelled labels Apr 19, 2022
@alice-i-cecile
Copy link
Member

separating Window into components seems pretty simple except for Window::set_resolution and Window::set_scale_factor_override that use requested_width/requested_height

@nicopap
Copy link
Contributor

nicopap commented Apr 19, 2022

I love the idea behind the PR. I like the code at least. Looking forward to the completion of the PR.

Just throwing ideas: What about deriving Reflect on the window components so that it's possible to save the window state as easily as the rest of the ECS?

@alice-i-cecile
Copy link
Member

separating Window into components seems pretty simple except for Window::set_resolution and Window::set_scale_factor_override that use requested_width/requested_height

@fowenix for this, I think I would probably just do a Resolution component:

struct Resolution {
   physical_width: u32,
   physical_height: u32,
   scale_factor: f64,
}

And then move those methods to methods on the new Resolution component :)

@fowenix fowenix changed the title add command queue for windows Windows as entities Apr 20, 2022
@fowenix
Copy link
Author

fowenix commented Apr 25, 2022

Gonna rework this some more and eventually reopen this from another branch instead of main

@fowenix fowenix closed this Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Windowing Platform-agnostic interface layer to run your app in C-Code-Quality A section of code that is hard to understand or change C-Usability A targeted quality-of-life change that makes Bevy easier to use
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants