PistonDevelopers / glfw-rs

GLFW3 bindings and idiomatic wrapper for Rust.
Apache License 2.0
644 stars 123 forks source link

Full screen mode failing #102

Closed bvssvni closed 10 years ago

bvssvni commented 10 years ago

I attempted to modify the 'window' example to start up in full screen.

glfw::set_error_callback(~ErrorContext);

glfw::start(proc() {
    let monitor = glfw::Monitor::get_primary().unwrap();
    let window_mode = glfw::FullScreen(monitor);
    let (w, h) = (1024, 768); // monitor.get_physical_size();
    let window = glfw::Window::create(w as u32, h as u32, "Hello this is window", window_mode)
.expect("Failed to create GLFW window.");

    window.set_key_polling(true);
    window.make_context_current();

    while !window.should_close() {
        glfw::poll_events();
        for (_, event) in window.flush_events() {
            handle_window_event(&window, event);
        }
    }
});

The full screen does not cover the entire screen. Sometimes it appears with decoration and sometimes it does not:

With decoration:

http://i.imgur.com/kvOYZH7.png

Without decoration:

http://i.imgur.com/VsuNXw1.png

I consulted #rust-gamedev and somebody told me to clone GLFW (https://github.com/glfw/glfw) and run 'tests/reopen'. In this test it toggles window mode every 5 seconds. In full screen it appears fine without decoration.

'uname -a':

Linux sven-macmini 3.5.0-17-generic #28-Ubuntu SMP Tue Oct 9 19:31:23 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
brendanzab commented 10 years ago

Are you calling glfw::start directly from within:

extern crate native;
extern crate glfw = "glfw-rs";

#[start]
fn start(argc: int, argv: **u8) -> int {
    // Run GLFW on the main thread
    native::start(argc, argv, main)
}

fn main() {
    /// ...

    glfw::start(proc() {})

    /// ...
}
ghost commented 10 years ago

I setup mint 14 with a virtualbox and was not able to reproduce this issue.

gist of it https://gist.github.com/csherratt/9148588

brendanzab commented 10 years ago

I am assuming that this is fixed. Please open a new issue if this is not the case.