[][src]Macro glium::program

macro_rules! program {
    ($facade:expr,) => { ... };
    ($facade:expr,,$($rest:tt)*) => { ... };
    ($facade:expr, $num:tt => $($rest:tt)*) => { ... };
    ($facade:expr, $num:tt es => $($rest:tt)*) => { ... };
    (_inner, $context:ident, $vers:ident, {$($ty:ident:$src:expr),+}$($rest:tt)*) => { ... };
    (_inner, $context:ident, $vers:ident, {$($ty:ident:$src:expr),+,}$($rest:tt)*) => { ... };
    (_program_ty vertex, $src:expr, $vs:ident, $tcs:ident, $tes:ident, $gs:ident, $fs:ident, $srgb:ident, $ps:ident) => { ... };
    (_program_ty tessellation_control, $src:expr, $vs:ident, $tcs:ident, $tes:ident, $gs:ident, $fs:ident, $srgb:ident, $ps:ident) => { ... };
    (_program_ty tessellation_evaluation, $src:expr, $vs:ident, $tcs:ident, $tes:ident, $gs:ident, $fs:ident, $srgb:ident, $ps:ident) => { ... };
    (_program_ty geometry, $src:expr, $vs:ident, $tcs:ident, $tes:ident, $gs:ident, $fs:ident, $srgb:ident, $ps:ident) => { ... };
    (_program_ty fragment, $src:expr, $vs:ident, $tcs:ident, $tes:ident, $gs:ident, $fs:ident, $srgb:ident, $ps:ident) => { ... };
    (_program_ty point_size, $src:expr, $vs:ident, $tcs:ident, $tes:ident, $gs:ident, $fs:ident, $srgb:ident, $ps:ident) => { ... };
    (_program_ty outputs_srgb, $src:expr, $vs:ident, $tcs:ident, $tes:ident, $gs:ident, $fs:ident, $srgb:ident, $ps:ident) => { ... };
    (_parse_num_gl $num:expr) => { ... };
    (_parse_num_gles $num:expr) => { ... };
}

Builds a program depending on the GLSL version supported by the backend.

This is implemented with successive calls to is_glsl_version_supported().

Returns a glium::program::ProgramChooserCreationError.

Example

# #[macro_use]
# extern crate glium;
# fn main() {
# let display: glium::Display = unsafe { std::mem::MaybeUninit::uninit().assume_init() };
let program = program!(&display,
    300 => {
        vertex: r#"
            #version 300

            fn main() {
                gl_Position = vec4(0.0, 0.0, 0.0, 1.0);
            }
        "#,
        fragment: r#"
            #version 300

            out vec4 color;
            fn main() {
                color = vec4(1.0, 1.0, 0.0, 1.0);
            }
        "#,
    },
    110 => {
        vertex: r#"
            #version 110

            fn main() {
                gl_Position = vec4(0.0, 0.0, 0.0, 1.0);
            }
        "#,
        fragment: r#"
            #version 110

            fn main() {
                gl_FragColor = vec4(1.0, 1.0, 0.0, 1.0);
            }
        "#,
    },
    300 es => {
        vertex: r#"
            #version 110

            fn main() {
                gl_Position = vec4(0.0, 0.0, 0.0, 1.0);
            }
        "#,
        fragment: r#"
            #version 110

            fn main() {
                gl_FragColor = vec4(1.0, 1.0, 0.0, 1.0);
            }
        "#,
    },
);
# }