glium::assert_no_gl_error! [] [src]

macro_rules! assert_no_gl_error {
    ($display: expr) => {
        {
            let message = format!("{}:{}", file!(), line!());
            $display.assert_no_error(Some(&message[..]));
        }
    };
    ($display: expr, $msg: expr) => {
        {
            let message = format!("{}:{}  {}", file!(), line!(), $msg);
            $display.assert_no_error(Some(&message[..]));
        }
    };
    ($display: expr, $fmt: expr, $($arg:tt)+) => {
        {
            let message = format!(concat!("{}:{} ", $fmt), file!(), line!(), $($arg)+);
            $display.assert_no_error(Some(&message[..]));
        }
    }
}

Calls the assert_no_error method on a glium::Display instance with file and line number information.

Aside from the first argument which must be the display, the arguments of this macro match the println! macro.

Example

assert_no_gl_error!(my_display);
assert_no_gl_error!(my_display, "custom message");
assert_no_gl_error!(my_display, "custom format {}", 5);