use crate::mpd_handler::MPDHandler;
use crate::Opt;
use ggez::event::{self, EventHandler};
-use ggez::graphics::{self, Color, DrawParam, Drawable, Text, TextFragment};
+use ggez::graphics::{self, Color, DrawParam, Drawable, Rect, Text, TextFragment};
use ggez::timer::{check_update_time, fps, yield_now};
use ggez::Context;
use ggez::GameError;
graphics::present(ctx)
}
+
+ fn resize_event(&mut self, ctx: &mut Context, width: f32, height: f32) {
+ graphics::set_screen_coordinates(
+ ctx,
+ Rect {
+ x: 0.0,
+ y: 0.0,
+ w: width,
+ h: height,
+ },
+ )
+ .expect("Failed to handle resizing window");
+ }
}
mod display;
mod mpd_handler;
-use ggez::conf::WindowSetup;
+use ggez::conf::{WindowMode, WindowSetup};
use ggez::event;
use ggez::ContextBuilder;
use std::net::Ipv4Addr;
title: "mpd info screen".into(),
..Default::default()
})
+ .window_mode(WindowMode {
+ resizable: true,
+ ..Default::default()
+ })
.build()
.expect("Failed to create ggez context");