Remove Opened message. Add RenderExpose message.
This commit is contained in:
parent
b0c3792c74
commit
ab8cb1c223
|
@ -24,6 +24,7 @@ impl baseview::Receiver for MyProgram {
|
|||
|
||||
fn on_message(&mut self, message: Message) {
|
||||
match message {
|
||||
Message::RenderExpose => {}
|
||||
Message::CursorMotion(x, y) => {
|
||||
println!("Cursor moved, x: {}, y: {}", x, y);
|
||||
}
|
||||
|
@ -57,9 +58,6 @@ impl baseview::Receiver for MyProgram {
|
|||
Message::WindowUnfocus => {
|
||||
println!("Window unfocused");
|
||||
}
|
||||
Message::Opened(window_info) => {
|
||||
println!("Window opened, {:?}", window_info);
|
||||
}
|
||||
Message::WillClose => {
|
||||
println!("Window will close");
|
||||
}
|
||||
|
|
|
@ -38,6 +38,7 @@ pub struct WindowInfo {
|
|||
|
||||
#[derive(Debug)]
|
||||
pub enum Message {
|
||||
RenderExpose,
|
||||
CursorMotion(i32, i32), // new (x, y) relative to window
|
||||
MouseDown(MouseButtonID),
|
||||
MouseUp(MouseButtonID),
|
||||
|
@ -49,6 +50,5 @@ pub enum Message {
|
|||
WindowResized(WindowInfo), // new (width, height)
|
||||
WindowFocus,
|
||||
WindowUnfocus,
|
||||
Opened(WindowInfo),
|
||||
WillClose,
|
||||
}
|
||||
|
|
|
@ -179,8 +179,7 @@ impl<R: Receiver> Window<R> {
|
|||
|
||||
match event_type {
|
||||
xcb::EXPOSE => {
|
||||
#[cfg(all(feature = "gl_renderer", not(feature = "wgpu_renderer")))]
|
||||
opengl_util::xcb_expose(window_id, raw_display, self.ctx);
|
||||
self.receiver.on_message(Message::RenderExpose);
|
||||
}
|
||||
xcb::MOTION_NOTIFY => {
|
||||
let event = unsafe { xcb::cast_event::<xcb::MotionNotifyEvent>(&event) };
|
||||
|
|
Loading…
Reference in a new issue