[][src]Macro vulkayes_core::viewport_scissor_expr

macro_rules! viewport_scissor_expr {
    (
		[
			$(
				dynamic @ [$sc_left: expr, $sc_top: expr, $sc_width: expr, $sc_height: expr]
			),+ $(,)?
		]
	) => { ... };
    (
		[
			$(
				[$width: expr, $height: expr] $(+ [$left: expr, $top: expr])? $(: [$near: expr, $far: expr])? @ dynamic
			),+ $(,)?
		]
	) => { ... };
    (
		dynamic[$count: expr]
	) => { ... };
    (
		[
			$(
				[$width: expr, $height: expr]
					$(+ [$left: expr, $top: expr])?
					$(: [$near: expr, $far: expr])?
					$(@ [$sc_left: expr, $sc_top: expr, $sc_width: expr, $sc_height: expr])?
			),* $(,)?
		]
	) => { ... };
    (
		[$width: expr, $height: expr]
			$(+ [$left: expr, $top: expr])?
			$(: [$near: expr, $far: expr])?
			$(@ [$sc_left: expr, $sc_top: expr, $sc_width: expr, $sc_height: expr])?
	) => { ... };
}

Expands to a tuple of (vk::Viewport, vk::Rect2D) or into a tuple of ([vk::Viewport], [vk::Rect2D], bool, bool).

Syntax: area offset? depth? scissor?

  • area - expression: [$w, $h] specifying width and height of the viewport (in f32)
  • offset? - expression: + [$x, $y] specifying offset of viewport, default: [0.0f32, 0.0f32]
  • depth? - expression: : [$min, $max] specifying minimum and maximum depth, default: [0.0f32, 1.0f32]
  • scissor? - expression: @ [$x, $y, $width, $height] specifying scissor region, default: [0i32, 0i32, i32::MAX as u32, i32::MAX as u32]

Example:

viewport_scissor_expr!(
	[100.0, 200.0] + [10.0, 20.0] : [0.0, 1.0] @ [0, 0, 100, 200]
);