piston_window icon indicating copy to clipboard operation
piston_window copied to clipboard

Panic when running example (in i3-wm)

Open azerupi opened this issue 8 years ago • 6 comments

I get the following panic when trying to run the example:

thread '<main>' panicked at 'Failed to get root window: XError { description: "GLXBadFBConfig", error_code: 181, request_code: 155, minor_code: 34 }', ../src/libcore/result.rs:709
Process didn't exit successfully: `target/debug/piston_test` (exit code: 101)

I have no idea what is causing it but I am running Arch Linux with I3-wm, maybe that is causing some trouble somehow? I don't know. Let me know if I can procure more useful information.

Edit: Just tested on OS X and there it works just fine

azerupi avatar Mar 12 '16 20:03 azerupi

I'm getting this on the hello world example too.

I'm on Debian GNU/Linux 8.4 (jessie) on an i686 rustc --version: rustc 1.8.0 (db2939409 2016-04-11)

gregkatz avatar May 08 '16 14:05 gregkatz

Failed to get root window

You will need to add these lines to hello_piston.rs and try changing the version to 2_1:

fn main() {

    // Change this to OpenGL::V2_1 if not working.
    let opengl = OpenGL::V3_2;                // this line

    let title = "Hello Piston! (press any key to enter inner loop)";
    let mut window: PistonWindow = WindowSettings::new(title, [640, 480])
        .opengl(opengl)                    // and this line
        .exit_on_esc(true)
        .build()
        .unwrap_or_else(|e| { panic!("Failed to build PistonWindow: {}", e) });

Bluebird45 avatar May 08 '16 16:05 Bluebird45

Thank you for the response. Unfortunately that change gives me a different error: thread '<main>' panicked at 'Error after executing command BindProgram(0): InvalidEnum', /home/xxx/.cargo/registry/src/github.com-48ad6e4054423464/gfx_device_gl-0.9.0/src/lib.rs:283 Seems like someone else had the same issue but it magically disappeared for that person:

http://stackoverflow.com/questions/36810775/invalidenum-error-in-piston

gregkatz avatar May 08 '16 17:05 gregkatz

Yes, that was me, and I think what you might try now is to "cargo update" and then re-compile.

Bluebird45 avatar May 08 '16 17:05 Bluebird45

Hmm, I did a cargo clean and cargo update, but no change on that error. Unfortunately I can't put any more time into it.

gregkatz avatar May 08 '16 18:05 gregkatz

Hi, I've experienced the same error on Windows (BindProgram(0): InvalidEnum). However, I changed the piston_window version from 0.61 to 0.59 and now it works. Something done not so long ago has made this error.

aarroyoc avatar Jan 17 '17 00:01 aarroyoc