Skip to content

Commit

Permalink
Fix examples
Browse files Browse the repository at this point in the history
  • Loading branch information
cwfitzgerald committed Dec 30, 2021
1 parent f36606a commit 0b2aa45
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ wgpu = "0.12"
bytemuck = { version = "1.4", features = ["derive"] }
cgmath = "0.18"
env_logger = "0.9"
image = { version = "0.23", default-features = false, features = ["jpeg"] }
image = { version = "0.23", default-features = false, features = ["png"] }
imgui-winit-support = { version = "0.8", default-features = false, features = ["winit-26"] }
pollster = "0.2"
raw-window-handle = "0.4"
Expand Down
3 changes: 2 additions & 1 deletion examples/cube.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ impl Example {
},
depth_stencil: None,
multisample: wgpu::MultisampleState::default(),
multiview: None,
});

// Done
Expand Down Expand Up @@ -537,7 +538,7 @@ fn main() {
// Only render example to example_texture if thw window is not collapsed
example.setup_camera(&queue, size);
example.render(
&renderer.textures.get(example_texture_id).unwrap().view(),
renderer.textures.get(example_texture_id).unwrap().view(),
&device,
&queue,
);
Expand Down
6 changes: 3 additions & 3 deletions examples/custom-texture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ fn main() {
let mut last_frame = Instant::now();

// Set up Lenna texture
let lenna_bytes = include_bytes!("../resources/Lenna.jpg");
let lenna_bytes = include_bytes!("../resources/checker.png");
let image =
image::load_from_memory_with_format(lenna_bytes, ImageFormat::Jpeg).expect("invalid image");
image::load_from_memory_with_format(lenna_bytes, ImageFormat::Png).expect("invalid image");
let image = image.to_bgra8();
let (width, height) = image.dimensions();
let raw_data = image.into_raw();
Expand Down Expand Up @@ -200,7 +200,7 @@ fn main() {
.size([400.0, 600.0], Condition::FirstUseEver)
.build(&ui, || {
ui.text("Hello textures!");
ui.text("Say hello to Lenna.jpg");
ui.text("Say hello to checker.png");
Image::new(lenna_texture_id, size).build(&ui);
});
}
Expand Down
Binary file removed resources/Lenna.jpg
Binary file not shown.
Binary file added resources/checker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion resources/cube.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ struct VertexOutput {
[[builtin(position)]] position: vec4<f32>;
};

[[block]]
struct Locals {
transform: mat4x4<f32>;
};
Expand Down

0 comments on commit 0b2aa45

Please sign in to comment.