We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3213bc2 commit ebc2307Copy full SHA for ebc2307
examples/minifb-demo/src/main.rs
@@ -1,7 +1,7 @@
1
use minifb::{Key, KeyRepeat, Window, WindowOptions};
2
+use plotters::prelude::*;
3
use plotters_bitmap::bitmap_pixel::BGRXPixel;
4
use plotters_bitmap::BitMapBackend;
-use plotters::prelude::*;
5
use std::collections::VecDeque;
6
use std::error::Error;
7
use std::time::SystemTime;
@@ -134,7 +134,8 @@ fn main() -> Result<(), Box<dyn Error>> {
134
break;
135
}
136
137
- window.update_with_buffer(unsafe { std::mem::transmute(&buf[..]) })?;
+ let buf = unsafe { std::slice::from_raw_parts(&buf[0] as *const _ as *const _, H * W) };
138
+ window.update_with_buffer(buf)?;
139
last_flushed = epoch;
140
141
0 commit comments