wgpu windows (fixed) (#3257)
* Working triangle rendering with wgpu in examples. Resize needs work in order to not reinitialize everything but only the bits needed. Naming of variables and resources are wonky and not the greatest. * The child window wasn't being resized along with the parent. This works. the abstractions in place should be passed the bounds rect down into the desktopservice to resize as opposed to in the app impl instead of how they are rn. --------- Co-authored-by: Vineeth Yeevani <vineethyeevani@Vineeths-MacBook-Air.local> Co-authored-by: Vineeth Yeevani <vineeth.yeevani@gmail.com>
This commit is contained in:
8 files changed
+983
-289
No files matched your search
@@ -49,6 +49,7 @@ impl From<MenuBuilderState> for Option<DioxusMenu> {
|
||||
pub struct Config {
|
||||
pub(crate) event_loop: Option<EventLoop<UserWindowEvent>>,
|
||||
pub(crate) window: WindowBuilder,
|
||||
pub(crate) as_child_window: bool,
|
||||
pub(crate) menu: MenuBuilderState,
|
||||
pub(crate) protocols: Vec<WryProtocol>,
|
||||
pub(crate) asynchronous_protocols: Vec<AsyncWryProtocol>,
|
||||
@@ -92,6 +93,7 @@ impl Config {
|
||||
|
||||
Self {
|
||||
window,
|
||||
as_child_window: false,
|
||||
event_loop: None,
|
||||
menu: MenuBuilderState::Unset,
|
||||
protocols: Vec::new(),
|
||||
@@ -152,6 +154,12 @@ impl Config {
|
||||
self
|
||||
}
|
||||
|
||||
/// Set the window as child
|
||||
pub fn with_as_child_window(mut self) -> Self {
|
||||
self.as_child_window = true;
|
||||
self
|
||||
}
|
||||
|
||||
/// Sets the behaviour of the application when the last window is closed.
|
||||
pub fn with_close_behaviour(mut self, behaviour: WindowCloseBehaviour) -> Self {
|
||||
self.last_window_close_behavior = behaviour;
|
||||
|
||||
Reference in new issue
Block a user