summaryrefslogtreecommitdiffstats
path: root/src/macros.rs
diff options
context:
space:
mode:
authorJoe Wilm <joe@jwilm.com>2016-12-09 21:10:49 -0800
committerJoe Wilm <joe@jwilm.com>2016-12-11 20:23:41 -0800
commit4ba29314375337c7c4deca01b06450dbccfc0289 (patch)
tree373cdc4c82270164934e00427f19b0d2ff963cce /src/macros.rs
parent093ac43f806d4321674888a7cd48d4c2ecdfa7bf (diff)
Cleaning up main; Added window module
Adds a wrapper for the glutin::Window which provides strongly typed APIs and more convenient interfaces. Moves some gl calls into the opengl-based renderer. The point of most of the changes here is to clean up main().
Diffstat (limited to 'src/macros.rs')
-rw-r--r--src/macros.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/macros.rs b/src/macros.rs
index eb37d4db..740e5ed9 100644
--- a/src/macros.rs
+++ b/src/macros.rs
@@ -48,3 +48,12 @@ macro_rules! debug_print {
}
}
+#[macro_export]
+macro_rules! maybe {
+ ($option:expr) => {
+ match $option {
+ Some(value) => value,
+ None => return None,
+ }
+ }
+}