mirror of
https://github.com/encounter/rust-sdl2.git
synced 2026-07-10 21:18:41 -07:00
Merge pull request #514 from Cobrand/master
Fixed renderer.info() crash on some machines
This commit is contained in:
+1
-1
@@ -110,7 +110,7 @@ impl RendererInfo {
|
||||
let texture_formats: Vec<pixels::PixelFormatEnum> =
|
||||
info.texture_formats[0..(info.num_texture_formats as usize)]
|
||||
.iter().map(|&format| {
|
||||
FromPrimitive::from_i64(format as i64).unwrap()
|
||||
PixelFormatEnum::from_i64(format as i64).unwrap_or(PixelFormatEnum::Unknown)
|
||||
}).collect();
|
||||
|
||||
// The driver name is always a static string, compiled into SDL2.
|
||||
|
||||
Reference in New Issue
Block a user