You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The example on the README.md file (Here) seems to contain structs(?) like softbuffer::Context and softbuffer::Surface which aren't in the documentation. (nor seem to exist at all?)
There's an extremely similar example used in the docs.rs softbuffer home-page (Here) which does compile.
What's strange is that I can't seem to find any mention of softbuffer::Context and softbuffer::Surface in any of the older versions' documentation.
The text was updated successfully, but these errors were encountered:
let mut graphics_context = unsafe { GraphicsContext::new(&window, &window) }.unwrap();
Event::RedrawRequested(window_id) => {
if window_id == window.id() {
let (width, height) = {
let size = window.inner_size();
(size.width, size.height)
};
let buffer = (0..((width * height) as usize))
.map(|index| {
let y = index / (width as usize);
let x = index % (width as usize);
let red = x % 255;
let green = y % 255;
let blue = (x * y) % 255;
let color = blue | (green << 8) | (red << 16);
color as u32
})
.collect::<Vec<_>>();
graphics_context.set_buffer(&buffer, width as u16, height as u16);
}
}
Alternatively, modify the entry in Cargo.toml and use what is was in the README.
The example on the README.md file (Here) seems to contain structs(?) like
softbuffer::Context
andsoftbuffer::Surface
which aren't in the documentation. (nor seem to exist at all?)There's an extremely similar example used in the docs.rs softbuffer home-page (Here) which does compile.
What's strange is that I can't seem to find any mention of
softbuffer::Context
andsoftbuffer::Surface
in any of the older versions' documentation.The text was updated successfully, but these errors were encountered: