Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix examples by resizing the surface #247

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion examples/animation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,14 @@ fn main() {
let window = winit_app::make_window(event_loop, |w| w);

let context = softbuffer::Context::new(window.clone()).unwrap();
let surface = softbuffer::Surface::new(&context, window.clone()).unwrap();
let mut surface = softbuffer::Surface::new(&context, window.clone()).unwrap();

surface
.resize(
NonZeroU32::new(window.inner_size().width).unwrap(),
NonZeroU32::new(window.inner_size().height).unwrap(),
)
.unwrap();

let old_size = (0, 0);
let frames = pre_render_frames(0, 0);
Expand Down
9 changes: 8 additions & 1 deletion examples/rectangle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,14 @@ fn main() {
});

let context = softbuffer::Context::new(window.clone()).unwrap();
let surface = softbuffer::Surface::new(&context, window.clone()).unwrap();
let mut surface = softbuffer::Surface::new(&context, window.clone()).unwrap();

surface
.resize(
NonZeroU32::new(window.inner_size().width).unwrap(),
NonZeroU32::new(window.inner_size().height).unwrap(),
)
.unwrap();

let flag = false;

Expand Down
9 changes: 8 additions & 1 deletion examples/winit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,14 @@ fn main() {
let window = winit_app::make_window(elwt, |w| w);

let context = softbuffer::Context::new(window.clone()).unwrap();
let surface = softbuffer::Surface::new(&context, window.clone()).unwrap();
let mut surface = softbuffer::Surface::new(&context, window.clone()).unwrap();

surface
.resize(
NonZeroU32::new(window.inner_size().width).unwrap(),
NonZeroU32::new(window.inner_size().height).unwrap(),
)
.unwrap();

(window, surface)
})
Expand Down
Loading