Fix warnings in examples (#180)
This commit is contained in:
parent
f7d83a561e
commit
e8b1236fda
|
@ -5,12 +5,12 @@ use baseview::{
|
||||||
use std::num::NonZeroU32;
|
use std::num::NonZeroU32;
|
||||||
|
|
||||||
struct ParentWindowHandler {
|
struct ParentWindowHandler {
|
||||||
ctx: softbuffer::Context,
|
_ctx: softbuffer::Context,
|
||||||
surface: softbuffer::Surface,
|
surface: softbuffer::Surface,
|
||||||
current_size: PhySize,
|
current_size: PhySize,
|
||||||
damaged: bool,
|
damaged: bool,
|
||||||
|
|
||||||
child_window: Option<WindowHandle>,
|
_child_window: Option<WindowHandle>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ParentWindowHandler {
|
impl ParentWindowHandler {
|
||||||
|
@ -33,11 +33,11 @@ impl ParentWindowHandler {
|
||||||
|
|
||||||
// TODO: no way to query physical size initially?
|
// TODO: no way to query physical size initially?
|
||||||
Self {
|
Self {
|
||||||
ctx,
|
_ctx: ctx,
|
||||||
surface,
|
surface,
|
||||||
current_size: PhySize::new(512, 512),
|
current_size: PhySize::new(512, 512),
|
||||||
damaged: true,
|
damaged: true,
|
||||||
child_window: Some(child_window),
|
_child_window: Some(child_window),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,7 @@ impl WindowHandler for ParentWindowHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
struct ChildWindowHandler {
|
struct ChildWindowHandler {
|
||||||
ctx: softbuffer::Context,
|
_ctx: softbuffer::Context,
|
||||||
surface: softbuffer::Surface,
|
surface: softbuffer::Surface,
|
||||||
current_size: PhySize,
|
current_size: PhySize,
|
||||||
damaged: bool,
|
damaged: bool,
|
||||||
|
@ -89,7 +89,7 @@ impl ChildWindowHandler {
|
||||||
surface.resize(NonZeroU32::new(512).unwrap(), NonZeroU32::new(512).unwrap()).unwrap();
|
surface.resize(NonZeroU32::new(512).unwrap(), NonZeroU32::new(512).unwrap()).unwrap();
|
||||||
|
|
||||||
// TODO: no way to query physical size initially?
|
// TODO: no way to query physical size initially?
|
||||||
Self { ctx, surface, current_size: PhySize::new(256, 256), damaged: true }
|
Self { _ctx: ctx, surface, current_size: PhySize::new(256, 256), damaged: true }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,9 +4,9 @@ use std::time::Duration;
|
||||||
use rtrb::{Consumer, RingBuffer};
|
use rtrb::{Consumer, RingBuffer};
|
||||||
|
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
use baseview::copy_to_clipboard;
|
use baseview::{copy_to_clipboard, MouseEvent};
|
||||||
use baseview::{
|
use baseview::{
|
||||||
Event, EventStatus, MouseEvent, PhySize, Window, WindowEvent, WindowHandler, WindowScalePolicy,
|
Event, EventStatus, PhySize, Window, WindowEvent, WindowHandler, WindowScalePolicy,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
|
@ -17,7 +17,7 @@ enum Message {
|
||||||
struct OpenWindowExample {
|
struct OpenWindowExample {
|
||||||
rx: Consumer<Message>,
|
rx: Consumer<Message>,
|
||||||
|
|
||||||
ctx: softbuffer::Context,
|
_ctx: softbuffer::Context,
|
||||||
surface: softbuffer::Surface,
|
surface: softbuffer::Surface,
|
||||||
current_size: PhySize,
|
current_size: PhySize,
|
||||||
damaged: bool,
|
damaged: bool,
|
||||||
|
@ -88,7 +88,13 @@ fn main() {
|
||||||
let mut surface = unsafe { softbuffer::Surface::new(&ctx, window) }.unwrap();
|
let mut surface = unsafe { softbuffer::Surface::new(&ctx, window) }.unwrap();
|
||||||
surface.resize(NonZeroU32::new(512).unwrap(), NonZeroU32::new(512).unwrap()).unwrap();
|
surface.resize(NonZeroU32::new(512).unwrap(), NonZeroU32::new(512).unwrap()).unwrap();
|
||||||
|
|
||||||
OpenWindowExample { ctx, surface, rx, current_size: PhySize::new(512, 512), damaged: true }
|
OpenWindowExample {
|
||||||
|
_ctx: ctx,
|
||||||
|
surface,
|
||||||
|
rx,
|
||||||
|
current_size: PhySize::new(512, 512),
|
||||||
|
damaged: true,
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue