aboutsummaryrefslogtreecommitdiff
path: root/games/rstnode/rst-client/src/graphics/mod.rs
diff options
context:
space:
mode:
authorKatharina Fey <kookie@spacekookie.de>2021-02-07 22:48:48 +0100
committerKatharina Fey <kookie@spacekookie.de>2021-02-07 22:48:48 +0100
commitb53b19ee469801b2aaa02dc7ee244892269550c4 (patch)
treee861a548525fff058070796df83ebfcb16f56041 /games/rstnode/rst-client/src/graphics/mod.rs
parentf9d4d7ec0198f192f53e583c259e35350fe9fb62 (diff)
rstnode: implement viewport shifting
A bit of a rant: it's fucking ridiculous how much work it is to subtract two points from each other with mint + nalgebra. I ended up adding a complete `Vector2` implementation in this commit because I got fed up with it. Consider this the unofficial start of librgx (rust graphics x), which will basically become a libgdx in Rust, and the basis for the little game engine. Not to mention that ggez probably won't be maintained past version 0.6.0 unless some other maintainer takes over (I guess that could always happen). Anyway, I'm annoyed!
Diffstat (limited to 'games/rstnode/rst-client/src/graphics/mod.rs')
-rw-r--r--games/rstnode/rst-client/src/graphics/mod.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/games/rstnode/rst-client/src/graphics/mod.rs b/games/rstnode/rst-client/src/graphics/mod.rs
index 095e66f1ad1f..a7ba676ecc6b 100644
--- a/games/rstnode/rst-client/src/graphics/mod.rs
+++ b/games/rstnode/rst-client/src/graphics/mod.rs
@@ -8,8 +8,12 @@
pub mod entities;
pub mod ui;
+mod vector2;
+pub use vector2::*;
+
use crate::state::ClientState;
use ggez::{Context, GameResult};
+use std::ops::{Add, Mul, Sub};
/// A utility module to include everything required to implement a
/// graphics entity