Merge branch 'master' into beacon

This commit is contained in:
Héctor Ramón Jiménez 2025-04-01 02:18:20 +02:00
commit e060129951
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
30 changed files with 915 additions and 633 deletions

View file

@ -36,11 +36,9 @@ pub fn main() -> Result<(), winit::error::EventLoopError> {
Loading,
Ready {
window: Arc<winit::window::Window>,
device: wgpu::Device,
queue: wgpu::Queue,
surface: wgpu::Surface<'static>,
format: wgpu::TextureFormat,
engine: Engine,
device: wgpu::Device,
renderer: Renderer,
scene: Scene,
controls: Controls,
@ -146,25 +144,26 @@ pub fn main() -> Result<(), winit::error::EventLoopError> {
let controls = Controls::new();
// Initialize iced
let engine =
Engine::new(&adapter, &device, &queue, format, None);
let renderer = Renderer::new(
&device,
&engine,
Font::default(),
Pixels::from(16),
);
let renderer = {
let engine = Engine::new(
&adapter,
device.clone(),
queue,
format,
None,
);
Renderer::new(engine, Font::default(), Pixels::from(16))
};
// You should change this if you want to render continuously
event_loop.set_control_flow(ControlFlow::Wait);
*self = Self::Ready {
window,
device,
queue,
surface,
format,
engine,
device,
renderer,
scene,
controls,
@ -188,10 +187,8 @@ pub fn main() -> Result<(), winit::error::EventLoopError> {
let Self::Ready {
window,
device,
queue,
surface,
format,
engine,
renderer,
scene,
controls,
@ -285,10 +282,6 @@ pub fn main() -> Result<(), winit::error::EventLoopError> {
*cache = interface.into_cache();
renderer.present(
engine,
device,
queue,
&mut encoder,
None,
frame.texture.format(),
&view,
@ -296,7 +289,6 @@ pub fn main() -> Result<(), winit::error::EventLoopError> {
);
// Then we submit the work
engine.submit(queue, encoder);
frame.present();
// Update the mouse cursor

View file

@ -1,6 +1,6 @@
use iced::widget::{
button, center, center_x, column, horizontal_space, scrollable, text,
text_input,
button, center, center_x, column, container, horizontal_space, scrollable,
text, text_input,
};
use iced::window;
use iced::{
@ -189,13 +189,12 @@ impl Window {
let new_window_button =
button(text("New Window")).on_press(Message::OpenWindow);
let content = scrollable(
column![scale_input, title_input, new_window_button]
.spacing(50)
.width(Fill)
.align_x(Center),
);
let content = column![scale_input, title_input, new_window_button]
.spacing(50)
.width(Fill)
.align_x(Center)
.width(200);
center_x(content).width(200).into()
container(scrollable(center_x(content))).padding(10).into()
}
}

View file

@ -0,0 +1 @@
804a1bb6d49e3b3158463202960447d9e7820b967280f41dd0c34c00d3edf2c3