2023-10-20 22:50:26 +00:00
|
|
|
pub struct WindowState{
|
2023-10-20 02:36:54 +00:00
|
|
|
//ok
|
|
|
|
}
|
|
|
|
impl WindowState{
|
|
|
|
fn resize(&mut self);
|
|
|
|
fn update(&mut self, window: &winit::window::Window, event: WindowEvent);
|
|
|
|
fn device_event(&mut self, window: &winit::window::Window, event: DeviceEvent);
|
|
|
|
fn render(&self);
|
2023-10-20 22:50:26 +00:00
|
|
|
pub fn create_window(title:&str,event_loop:&winit::event_loop::EventLoop<()>)->Result<winit::window::Window,winit::error::OsError>{
|
|
|
|
let mut builder = winit::window::WindowBuilder::new();
|
|
|
|
builder = builder.with_title(title);
|
|
|
|
#[cfg(windows_OFF)] // TODO
|
|
|
|
{
|
|
|
|
use winit::platform::windows::WindowBuilderExtWindows;
|
|
|
|
builder = builder.with_no_redirection_bitmap(true);
|
|
|
|
}
|
|
|
|
builder.build(event_loop)
|
|
|
|
}
|
2023-10-20 02:36:54 +00:00
|
|
|
}
|