-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: fixed scissor bounds bug, added examples
- Loading branch information
1 parent
0861f95
commit 9a89185
Showing
6 changed files
with
88 additions
and
10 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "blue_engine" | ||
version = "0.5.4" | ||
version = "0.5.5" | ||
authors = ["Elham Aryanpur <[email protected]>"] | ||
edition = "2021" | ||
description = "General-Purpose, Easy-to-use, Fast, and Portable graphics engine" | ||
|
@@ -84,6 +84,14 @@ path = "examples/utils/instancing.rs" | |
name = "render_order" | ||
path = "examples/utils/render_order.rs" | ||
|
||
[[example]] | ||
name = "wireframe" | ||
path = "examples/utils/wireframe.rs" | ||
|
||
[[example]] | ||
name = "scissor" | ||
path = "examples/utils/scissor.rs" | ||
|
||
# Development ONLY | ||
[[example]] | ||
name = "dev" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* Blue Engine by Elham Aryanpur | ||
* | ||
* Triangle example using pre-defined shapes | ||
* | ||
* The license is same as the one on the root. | ||
*/ | ||
|
||
use blue_engine::{primitive_shapes::triangle, Engine, ObjectSettings}; | ||
|
||
pub fn main() { | ||
let mut engine = Engine::new().expect("win"); | ||
|
||
triangle( | ||
"Triangle", | ||
ObjectSettings::default(), | ||
&mut engine.renderer, | ||
&mut engine.objects, | ||
) | ||
.unwrap(); | ||
|
||
// set scissor rect | ||
engine.renderer.scissor_rect = Some((0, 0, 450, 350)); | ||
|
||
engine | ||
.update_loop(move |_, _, _, _, _, _| {}) | ||
.expect("Error during update loop"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Blue Engine by Elham Aryanpur | ||
* | ||
* Triangle example using pre-defined shapes | ||
* | ||
* The license is same as the one on the root. | ||
*/ | ||
|
||
use blue_engine::{primitive_shapes::triangle, Engine, ObjectSettings, ShaderSettings}; | ||
|
||
pub fn main() { | ||
let mut engine = Engine::new().expect("win"); | ||
|
||
triangle( | ||
"Triangle", | ||
ObjectSettings { | ||
shader_settings: ShaderSettings { | ||
polygon_mode: wgpu::PolygonMode::Line, | ||
..Default::default() | ||
}, | ||
..Default::default() | ||
}, | ||
&mut engine.renderer, | ||
&mut engine.objects, | ||
) | ||
.unwrap(); | ||
|
||
engine | ||
.update_loop(move |_, _, _, _, _, _| {}) | ||
.expect("Error during update loop"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters