ggez: Panic on unwrap? -- support different OpenGL versions
When compiling and running the example code from the website with the following: cargo run --target=i686-pc-windows-msvc
Rust spits out a very nice error for me:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: WindowError(SdlError("Could not create GL context: The operation completed successfully.\r\n"))', src\libcore\result.rs:860:4
Doing a quick google search doesn’t give me anything… I have a feeling that this is a problem with SDL2 though. Hopefully it should be resolved quickly 👍 .
Here’s the full error with backtrace enabled:
Finished dev [unoptimized + debuginfo] target(s) in 0.15 secs
Running `target\i686-pc-windows-msvc\debug\ggezgame.exe`
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: WindowError(SdlError("Could not create GL context: The operation completed successfully.\r\n"))', src\libcore\result.rs:860:4
stack backtrace:
0: std::panicking::default_hook::{{closure}}
at C:\projects\rust\src\libstd\panicking.rs:379
1: std::panicking::default_hook
at C:\projects\rust\src\libstd\panicking.rs:396
2: std::panicking::rust_panic_with_hook
at C:\projects\rust\src\libstd\panicking.rs:611
3: std::panicking::begin_panic_new<alloc::string::String>
at C:\projects\rust\src\libstd\panicking.rs:553
4: std::panicking::begin_panic_fmt
at C:\projects\rust\src\libstd\panicking.rs:521
5: std::panicking::rust_begin_panic
at C:\projects\rust\src\libstd\panicking.rs:497
6: core::panicking::panic_fmt
at C:\projects\rust\src\libcore\panicking.rs:92
7: core::result::unwrap_failed<ggez::error::GameError>
at C:\projects\rust\src\libcore\macros.rs:41
8: core::result::Result<ggez::context::Context, ggez::error::GameError>::unwrap<ggez::context::Context,ggez::error::GameError>
at C:\projects\rust\src\libcore\result.rs:738
9: ggezgame::main
at .\src\main.rs:36
10: panic_unwind::__rust_maybe_catch_panic
at C:\projects\rust\src\libpanic_unwind\lib.rs:98
11: std::rt::lang_start
at C:\projects\rust\src\libstd\rt.rs:52
12: main
13: __scrt_common_main_seh
at f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:253
14: BaseThreadInitThunk
15: RtlGetAppContainerNamedObjectPath
error: process didn't exit successfully: `target\i686-pc-windows-msvc\debug\ggezgame.exe` (exit code: 101)
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 18 (9 by maintainers)
If the intention is to keep ggez focused on casual-ish 2D things then GL2.1 is a reasonable option. The main downsides are lack of some more recent batching features like instancing and indirect drawing as well as having to use the old GLSL syntax.