From 4ba29314375337c7c4deca01b06450dbccfc0289 Mon Sep 17 00:00:00 2001 From: Joe Wilm Date: Fri, 9 Dec 2016 21:10:49 -0800 Subject: 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(). --- src/macros.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/macros.rs') 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, + } + } +} -- cgit