add onresize

This commit is contained in:
shenjack 2025-01-23 18:55:52 +08:00
parent 479b19d182
commit 9cef45c426
Signed by: shenjack
GPG Key ID: 7B1134A979775551
2 changed files with 5 additions and 1 deletions

View File

@ -2,7 +2,7 @@ use std::num::NonZeroIsize;
use pollster::block_on;
use raw_window_handle::{RawWindowHandle, Win32WindowHandle};
use wgpu::{Adapter, Device, Gles3MinorVersion, Instance, InstanceDescriptor, Queue, Surface, SurfaceTargetUnsafe};
use wgpu::{Adapter, Device, Instance, InstanceDescriptor, Queue, Surface, SurfaceTargetUnsafe};
/// 定义一个结构体保存所有渲染上下文
#[derive(Debug)]

View File

@ -89,6 +89,10 @@ class Menu(BaseScreen):
main_window.push_handlers(self.enter_ship_editor_button)
main_window.push_handlers(self.magic_rust_test_button)
def on_resize(self, width, height, window: ClientWindow):
if self.hacks is not None:
self.hacks.on_resize(width, height)
def on_draw(self, window: ClientWindow):
self.main_batch.draw()
if self.hacks is not None: