1
0
Fork 0

Remove Opened message. Add RenderExpose message.

This commit is contained in:
Billy Messenger 2020-09-03 10:58:24 -05:00
parent b0c3792c74
commit ab8cb1c223
3 changed files with 3 additions and 6 deletions

View file

@ -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");
}

View file

@ -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,
}

View file

@ -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) };