Skip to content

Commit

Permalink
add default_viewport
Browse files Browse the repository at this point in the history
  • Loading branch information
redthing1 committed Jul 16, 2024
1 parent bef5421 commit fb96de7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions source/re/ng/scene2d.d
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ abstract class Scene2D : Scene {
add_viewport(cam, Core.window.screen_bounds, resolution);
}

Viewport2D default_viewport() {
return cast(Viewport2D) viewports[0];
}

Viewport2D add_viewport(SceneCamera2D cam, Rectangle output_bounds, Vector2 resolution) {
auto vp = new Viewport2D();
vp.cam = cam;
Expand Down
4 changes: 4 additions & 0 deletions source/re/ng/scene3d.d
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ abstract class Scene3D : Scene {
add_viewport(cam, Core.window.screen_bounds, resolution);
}

Viewport3D default_viewport() {
return cast(Viewport3D) viewports[0];
}

Viewport3D add_viewport(SceneCamera3D cam, Rectangle output_bounds, Vector2 resolution) {
auto vp = new Viewport3D();
vp.cam = cam;
Expand Down

0 comments on commit fb96de7

Please sign in to comment.