Allow resolution to be configured on command line. Default to 1280x1024.

This commit is contained in:
Glenn Watson 2014-09-18 08:43:03 +10:00
parent 178843456f
commit c33f18b7df
7 changed files with 31 additions and 9 deletions

View file

@ -63,9 +63,10 @@ pub struct Window {
impl WindowMethods<Application> for Window {
/// Creates a new window.
fn new(_: &Application, _: bool) -> Rc<Window> {
fn new(_: &Application, _: bool, size: TypedSize2D<DevicePixel, uint>) -> Rc<Window> {
// Create the GLUT window.
glut::init_window_size(800, 600);
let window_size = size.to_untyped();
glut::init_window_size(window_size.width, window_size.height);
let glut_window = glut::create_window("Servo".to_string());
// Create our window object.