Skip to content

Commit 78bdb32

Browse files
authored
Update Rust examples (#232)
1 parent fae618d commit 78bdb32

40 files changed

Lines changed: 80 additions & 80 deletions

examples/animated_mesh.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ fn main() {
1919
}
2020

2121
fn sketch() -> error::Result<()> {
22-
let mut glfw_ctx = GlfwContext::new(600, 600)?;
22+
let mut glfw_ctx = GlfwContext::new(600, 600, false)?;
2323
init(Config::default())?;
2424

2525
let width = 600;
2626
let height = 600;
27-
let surface = glfw_ctx.create_surface(width, height)?;
27+
let surface = glfw_ctx.create_surface(width, height, false)?;
2828
let graphics = graphics_create(surface, width, height, TextureFormat::Rgba16Float)?;
2929

3030
let grid_size = 20;

examples/background_image.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ fn main() {
1717
}
1818

1919
fn sketch() -> error::Result<()> {
20-
let mut glfw_ctx = GlfwContext::new(400, 400)?;
20+
let mut glfw_ctx = GlfwContext::new(400, 400, false)?;
2121
init(Config::default())?;
2222

2323
let width = 400;
2424
let height = 400;
25-
let surface = glfw_ctx.create_surface(width, height)?;
25+
let surface = glfw_ctx.create_surface(width, height, false)?;
2626
let graphics = graphics_create(surface, width, height, TextureFormat::Rgba16Float)?;
2727
let image = image_load("images/logo.png")?;
2828

examples/blend_modes.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ fn main() {
2828
fn sketch() -> error::Result<()> {
2929
let width = 500;
3030
let height = 500;
31-
let mut glfw_ctx = GlfwContext::new(width, height)?;
31+
let mut glfw_ctx = GlfwContext::new(width, height, false)?;
3232
init(Config::default())?;
3333

34-
let surface = glfw_ctx.create_surface(width, height)?;
34+
let surface = glfw_ctx.create_surface(width, height, false)?;
3535
let graphics = graphics_create(surface, width, height, TextureFormat::Rgba16Float)?;
3636

3737
let mut index: usize = 0;

examples/box.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ fn main() {
1818
}
1919

2020
fn sketch() -> error::Result<()> {
21-
let mut glfw_ctx = GlfwContext::new(400, 400)?;
21+
let mut glfw_ctx = GlfwContext::new(400, 400, false)?;
2222
init(Config::default())?;
2323

2424
let width = 400;
2525
let height = 400;
26-
let surface = glfw_ctx.create_surface(width, height)?;
26+
let surface = glfw_ctx.create_surface(width, height, false)?;
2727
let graphics = graphics_create(surface, width, height, TextureFormat::Rgba16Float)?;
2828
let box_geo = geometry_box(100.0, 100.0, 100.0)?;
2929

examples/camera_controllers.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ fn main() {
2020
fn sketch() -> error::Result<()> {
2121
let width = 800;
2222
let height = 600;
23-
let mut glfw_ctx = GlfwContext::new(width, height)?;
23+
let mut glfw_ctx = GlfwContext::new(width, height, false)?;
2424
init(Config::default())?;
2525

26-
let surface = glfw_ctx.create_surface(width, height)?;
26+
let surface = glfw_ctx.create_surface(width, height, false)?;
2727
let graphics = graphics_create(surface, width, height, TextureFormat::Rgba16Float)?;
2828
let box_geo = geometry_box(100.0, 100.0, 100.0)?;
2929

examples/curves.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ fn main() {
99
}
1010

1111
fn sketch() -> error::Result<()> {
12-
let mut glfw_ctx = GlfwContext::new(800, 400)?;
12+
let mut glfw_ctx = GlfwContext::new(800, 400, false)?;
1313
init(Config::default())?;
1414

15-
let surface = glfw_ctx.create_surface(800, 400)?;
15+
let surface = glfw_ctx.create_surface(800, 400, false)?;
1616
let graphics = graphics_create(surface, 800, 400, TextureFormat::Rgba16Float)?;
1717

1818
let mut t: f32 = 0.0;

examples/custom_attribute.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ fn main() {
1919
}
2020

2121
fn sketch() -> error::Result<()> {
22-
let mut glfw_ctx = GlfwContext::new(600, 600)?;
22+
let mut glfw_ctx = GlfwContext::new(600, 600, false)?;
2323
init(Config::default())?;
2424

2525
let width = 600;
2626
let height = 600;
27-
let surface = glfw_ctx.create_surface(width, height)?;
27+
let surface = glfw_ctx.create_surface(width, height, false)?;
2828
let graphics = graphics_create(surface, width, height, TextureFormat::Rgba16Float)?;
2929

3030
let custom_attr = geometry_attribute_create("Custom", AttributeFormat::Float)?;

examples/custom_material.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ fn main() {
2020
fn sketch() -> error::Result<()> {
2121
let width = 400;
2222
let height = 400;
23-
let mut glfw_ctx = GlfwContext::new(width, height)?;
23+
let mut glfw_ctx = GlfwContext::new(width, height, false)?;
2424
init(Config::default())?;
2525

26-
let surface = glfw_ctx.create_surface(width, height)?;
26+
let surface = glfw_ctx.create_surface(width, height, false)?;
2727
let graphics = graphics_create(surface, width, height, TextureFormat::Rgba16Float)?;
2828
let box_geo = geometry_box(100.0, 100.0, 100.0)?;
2929

examples/filter.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ fn main() {
1919
}
2020

2121
fn sketch() -> error::Result<()> {
22-
let mut glfw_ctx = GlfwContext::new(400, 400)?;
22+
let mut glfw_ctx = GlfwContext::new(400, 400, false)?;
2323
init(Config::default())?;
2424

25-
let surface = glfw_ctx.create_surface(400, 400)?;
25+
let surface = glfw_ctx.create_surface(400, 400, false)?;
2626
let graphics = graphics_create(surface, 400, 400, TextureFormat::Rgba16Float)?;
2727

2828
let palette = [

examples/gltf_load.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ fn main() {
2121
fn sketch() -> error::Result<()> {
2222
let width = 800;
2323
let height = 600;
24-
let mut glfw_ctx = GlfwContext::new(width, height)?;
24+
let mut glfw_ctx = GlfwContext::new(width, height, false)?;
2525
init(Config::default())?;
2626

27-
let surface = glfw_ctx.create_surface(width, height)?;
27+
let surface = glfw_ctx.create_surface(width, height, false)?;
2828
let graphics = graphics_create(surface, width, height, TextureFormat::Rgba16Float)?;
2929

3030
let gltf = gltf_load(graphics, "gltf/Duck.glb")?;

0 commit comments

Comments
 (0)