Skip to content

Commit

Permalink
Fix minimal-fltk exmaple
Browse files Browse the repository at this point in the history
  • Loading branch information
mkrasnitski authored and parasyte committed Sep 22, 2024
1 parent 18e53dc commit 738409c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion examples/minimal-fltk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ default = ["optimize"]

[dependencies]
error-iter = "0.4"
fltk = { version = "1", features = ["rwh05", "no-images", "no-pango"] }
fltk = { version = "1", features = ["rwh06", "no-images", "no-pango"] }
env_logger = "0.10"
log = "0.4"
pixels = { path = "../.." }
16 changes: 8 additions & 8 deletions examples/minimal-fltk/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,6 @@ fn main() -> Result<(), Error> {
win.end();
win.show();

let mut pixels = {
let pixel_width = win.pixel_w() as u32;
let pixel_height = win.pixel_h() as u32;
let surface_texture = SurfaceTexture::new(pixel_width, pixel_height, &win);

Pixels::new(WIDTH, HEIGHT, surface_texture)?
};

let mut world = World::new();

// Handle resize events
Expand All @@ -53,6 +45,14 @@ fn main() -> Result<(), Error> {
surface_resize.borrow_mut().replace((width, height));
});

let mut pixels = {
let pixel_width = win.pixel_w() as u32;
let pixel_height = win.pixel_h() as u32;
let surface_texture = SurfaceTexture::new(pixel_width, pixel_height, &win);

Pixels::new(WIDTH, HEIGHT, surface_texture)?
};

while app.wait() {
// Update internal state
world.update();
Expand Down

0 comments on commit 738409c

Please sign in to comment.