randomPoison / gunship-rs

An experimental game engine written in Rust.
MIT License
27 stars 3 forks source link

Dragging window back and forth between multiple screens causes crash in OpenGL renderer #80

Open randomPoison opened 7 years ago

randomPoison commented 7 years ago

I have a 2 screen setup on my computer, and if I drag a game window back and forth between the two screens the game will eventually crash.

Repro steps

  1. Setup 2 or more monitors for you computer.
  2. Run one of the gunship examples, e.g. cargo run --example lots_of_cubes.
  3. Drag the game window back and forth between the monitors.

System Information

Windows 10 64 bit. 2 Monitors, one is the screen attached to the laptop, the other is attached through the VGA out port. Using the OpenGL renderer.

Stack Trace

thread 'main' panicked at 'Failed to make context current, dc: 0x570111f5, context: 0x10000 last error: 0x:7D4, actual dc and context: 0x0 and 0x0, hwnd: 0x0', lib\bootstrap-gl\src\windows\mod.rs:68
stack backtrace:
   0:   0xc3d138 - std::panicking::default_hook
                at C:\bot\slave\nightly-dist-rustc-win-msvc-32\build\src\libstd\panicking.rs:263
   1:   0xc3d9ca - std::panicking::rust_panic_with_hook
                at C:\bot\slave\nightly-dist-rustc-win-msvc-32\build\src\libstd\panicking.rs:451
   2:   0xc3d867 - std::panicking::begin_panic<collections::string::String>
                at C:\bot\slave\nightly-dist-rustc-win-msvc-32\build\src\libstd\panicking.rs:413
   3:   0xc3d7a6 - std::panicking::begin_panic_fmt
                at C:\bot\slave\nightly-dist-rustc-win-msvc-32\build\src\libstd\panicking.rs:397
   4:   0xc22e9d - bootstrap_gl::platform::make_current
                at C:\Users\David LeGare\gunship-fps\gunship-rs\lib\bootstrap-gl\src\windows\mod.rs:68
   5:   0xb98659 - gl_util::context::ContextGuard::new
                at C:\Users\David LeGare\gunship-fps\gunship-rs\lib\gl-util\src\context.rs:260
   6:   0xb990f7 - gl_util::shader::Program::get_uniform_location
                at C:\Users\David LeGare\gunship-fps\gunship-rs\lib\gl-util\src\shader.rs:195
   7:   0xb6aa7b - gl_util::DrawBuilder::uniform<gl_util::GlMatrix>
                at C:\Users\David LeGare\gunship-fps\gunship-rs\lib\gl-util\src\lib.rs:428
   8:   0xb751e9 - polygon::gl::{{impl}}::draw
                at C:\Users\David LeGare\gunship-fps\gunship-rs\lib\polygon_rs\src\gl\mod.rs:204
   9:   0xb16be4 - gunship::engine::main_loop
                at C:\Users\David LeGare\gunship-fps\gunship-rs\src\engine.rs:398
  10:   0xacb9d2 - gunship::engine::{{impl}}::build::{{closure}}<closure>
                at C:\Users\David LeGare\gunship-fps\gunship-rs\src\engine.rs:125
  11:   0xacb6be - gunship::scheduler::start::{{closure}}<closure,()>
                at C:\Users\David LeGare\gunship-fps\gunship-rs\src\scheduler.rs:157
  12:   0xab7f66 - alloc::boxed::{{impl}}::call_box<(),closure>
                at C:\bot\slave\nightly-dist-rustc-win-msvc-32\build\src\liballoc\boxed.rs:595
  13:   0xad2757 - core::ops::impls::{{impl}}::call_once<(),FnMut<()>>
                at C:\bot\slave\nightly-dist-rustc-win-msvc-32\build\src\liballoc\boxed.rs:605
  14:   0xb1a3d9 - gunship::scheduler::fiber_routine
                at C:\Users\David LeGare\gunship-fps\gunship-rs\src\scheduler.rs:192
  15:   0xb1bc31 - gunship::scheduler::{{impl}}::next_fiber::{{closure}}::fiber_proc
                at C:\Users\David LeGare\gunship-fps\gunship-rs\src\scheduler.rs:391
  16:   0xb9043c - fiber::platform::fiber_proc
                at C:\Users\David LeGare\gunship-fps\gunship-rs\lib\fiber\src\platform\windows.rs:49
  17: 0x778b58d7 - GetCPHashNode
error: process didn't exit successfully: `target\debug\examples\lots_of_cubes.exe` (exit code: 3221225501)