Skip to main content

RaylibShaderMode

Struct RaylibShaderMode 

Source
pub struct RaylibShaderMode<'a, 'b, T: 'a>(/* private fields */);
Expand description

RAII draw handle for custom shader mode — calls EndShaderMode on drop.

While alive, the borrowed Shader is bound as the active fragment / vertex program for subsequent draw calls. Drop runs EndShaderMode, restoring raylib’s default shader. Implements RaylibDraw and RaylibDraw3D via deref, so the guard accepts both 2D and 3D draw calls — the shader applies to whichever the parent surface supports.

§Examples

use raylib::prelude::*;

let (mut rl, thread) = raylib::init().size(800, 600).title("demo").build();
let mut shader = rl.load_shader(&thread, None, Some("grayscale.fs"));
while !rl.window_should_close() {
    let mut d = rl.begin_drawing(&thread);
    d.clear_background(Color::RAYWHITE);
    {
        let mut s = d.begin_shader_mode(&mut shader);
        s.draw_rectangle(10, 10, 100, 50, Color::WHITE);
        // Drop ends shader mode automatically.
    }
}

§See also

Trait Implementations§

Source§

impl<'a, T: 'a> Deref for RaylibShaderMode<'a, '_, T>

Source§

type Target = T

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<'a, T: 'a> DerefMut for RaylibShaderMode<'a, '_, T>

Source§

fn deref_mut(&mut self) -> &mut T

Mutably dereferences the value.
Source§

impl<'a, T: 'a> Drop for RaylibShaderMode<'a, '_, T>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl<'a, T: 'a> RaylibDraw for RaylibShaderMode<'a, '_, T>

Source§

fn clear_background(&mut self, color: impl Into<Color>)

Sets background color (framebuffer clear color.into()).
Source§

fn get_shapes_texture(&self) -> Texture2D

Get texture that is used for shapes drawing
Source§

fn get_shapes_texture_rectangle(&self) -> Rectangle

Get texture source rectangle that is used for shapes drawing
Source§

fn set_shapes_texture( &mut self, texture: impl AsRef<Texture2D>, source: impl Into<Rectangle>, )

Define default texture used to draw shapes
Source§

fn draw_pixel(&mut self, x: i32, y: i32, color: impl Into<Color>)

Draws a pixel.
Source§

fn draw_pixel_v( &mut self, position: impl Into<Vector2>, color: impl Into<Color>, )

Draws a pixel (Vector version).
Source§

fn draw_line( &mut self, start_pos_x: i32, start_pos_y: i32, end_pos_x: i32, end_pos_y: i32, color: impl Into<Color>, )

Draws a line.
Source§

fn draw_line_v( &mut self, start_pos: impl Into<Vector2>, end_pos: impl Into<Vector2>, color: impl Into<Color>, )

Draws a line (Vector version).
Source§

fn draw_line_ex( &mut self, start_pos: impl Into<Vector2>, end_pos: impl Into<Vector2>, thick: f32, color: impl Into<Color>, )

Draws a line with thickness.
Source§

fn draw_line_bezier( &mut self, start_pos: impl Into<Vector2>, end_pos: impl Into<Vector2>, thick: f32, color: impl Into<Color>, )

Draws a line using cubic-bezier curves in-out.
Source§

fn draw_line_dashed( &mut self, start: impl Into<Vector2>, end: impl Into<Vector2>, dash_size: i32, space_size: i32, color: impl Into<Color>, )

Draw a dashed line. Read more
Source§

fn draw_line_strip(&mut self, points: &[Vector2], color: impl Into<Color>)

Draw lines sequence
Source§

fn draw_circle( &mut self, center_x: i32, center_y: i32, radius: f32, color: impl Into<Color>, )

Draws a color-filled circle.
Source§

fn draw_circle_sector( &mut self, center: impl Into<Vector2>, radius: f32, start_angle: f32, end_angle: f32, segments: i32, color: impl Into<Color>, )

Draw a piece of a circle
Source§

fn draw_circle_sector_lines( &mut self, center: impl Into<Vector2>, radius: f32, start_angle: f32, end_angle: f32, segments: i32, color: impl Into<Color>, )

Draw circle sector outline
Source§

fn draw_circle_gradient( &mut self, center_x: i32, center_y: i32, radius: f32, inner: impl Into<Color>, outer: impl Into<Color>, )

Draws a gradient-filled circle.
Source§

fn draw_circle_v( &mut self, center: impl Into<Vector2>, radius: f32, color: impl Into<Color>, )

Draws a color-filled circle (Vector version).
Source§

fn draw_circle_lines( &mut self, center_x: i32, center_y: i32, radius: f32, color: impl Into<Color>, )

Draws circle outline.
Source§

fn draw_circle_lines_v( &mut self, center: impl Into<Vector2>, radius: f32, color: impl Into<Color>, )

Draws circle outline. (Vector Version)
Source§

fn draw_ellipse( &mut self, center_x: i32, center_y: i32, radius_h: f32, radius_v: f32, color: impl Into<Color>, )

Draws ellipse.
Source§

fn draw_ellipse_v( &mut self, center: impl Into<Vector2>, radius_h: f32, radius_v: f32, color: impl Into<Color>, )

Draws ellipse using a Vector2 center.
Source§

fn draw_ellipse_lines( &mut self, center_x: i32, center_y: i32, radius_h: f32, radius_v: f32, color: impl Into<Color>, )

Draws ellipse.
Source§

fn draw_ellipse_lines_v( &mut self, center: impl Into<Vector2>, radius_h: f32, radius_v: f32, color: impl Into<Color>, )

Draws ellipse outline using a Vector2 center.
Source§

fn draw_ring( &mut self, center: impl Into<Vector2>, inner_radius: f32, outer_radius: f32, start_angle: f32, end_angle: f32, segments: i32, color: impl Into<Color>, )

Draw ring
Source§

fn draw_ring_lines( &mut self, center: impl Into<Vector2>, inner_radius: f32, outer_radius: f32, start_angle: f32, end_angle: f32, segments: i32, color: impl Into<Color>, )

Draw ring lines
Source§

fn draw_rectangle( &mut self, x: i32, y: i32, width: i32, height: i32, color: impl Into<Color>, )

Draws a color-filled rectangle.
Source§

fn draw_rectangle_v( &mut self, position: impl Into<Vector2>, size: impl Into<Vector2>, color: impl Into<Color>, )

Draws a color-filled rectangle (Vector version).
Source§

fn draw_rectangle_rec( &mut self, rec: impl Into<Rectangle>, color: impl Into<Color>, )

Draws a color-filled rectangle from rec.
Source§

fn draw_rectangle_pro( &mut self, rec: impl Into<Rectangle>, origin: impl Into<Vector2>, rotation: f32, color: impl Into<Color>, )

Draws a color-filled rectangle with pro parameters.
Source§

fn draw_rectangle_gradient_v( &mut self, x: i32, y: i32, width: i32, height: i32, color1: impl Into<Color>, color2: impl Into<Color>, )

Draws a vertical-gradient-filled rectangle. Read more
Source§

fn draw_rectangle_gradient_h( &mut self, x: i32, y: i32, width: i32, height: i32, color1: impl Into<Color>, color2: impl Into<Color>, )

Draws a horizontal-gradient-filled rectangle. Read more
Source§

fn draw_rectangle_gradient_ex( &mut self, rec: impl Into<Rectangle>, col1: impl Into<Color>, col2: impl Into<Color>, col3: impl Into<Color>, col4: impl Into<Color>, )

Draws a gradient-filled rectangle with custom vertex colors. Read more
Source§

fn draw_rectangle_lines( &mut self, x: i32, y: i32, width: i32, height: i32, color: impl Into<Color>, )

Draws rectangle outline.
Source§

fn draw_rectangle_lines_ex( &mut self, rec: impl Into<Rectangle>, line_thick: f32, color: impl Into<Color>, )

Draws rectangle outline with extended parameters.
Source§

fn draw_rectangle_rounded( &mut self, rec: impl Into<Rectangle>, roundness: f32, segments: i32, color: impl Into<Color>, )

Draws rectangle with rounded edges.
Source§

fn draw_rectangle_rounded_lines( &mut self, rec: impl Into<Rectangle>, roundness: f32, segments: i32, color: impl Into<Color>, )

Draws rectangle outline with rounded edges included.
Source§

fn draw_rectangle_rounded_lines_ex( &mut self, rec: impl Into<Rectangle>, roundness: f32, segments: i32, line_thickness: f32, color: impl Into<Color>, )

Draw rectangle with rounded edges outline
Source§

fn draw_triangle( &mut self, v1: impl Into<Vector2>, v2: impl Into<Vector2>, v3: impl Into<Vector2>, color: impl Into<Color>, )

Draws a triangle.
Source§

fn draw_triangle_lines( &mut self, v1: impl Into<Vector2>, v2: impl Into<Vector2>, v3: impl Into<Vector2>, color: impl Into<Color>, )

Draws a triangle using lines.
Source§

fn draw_triangle_fan(&mut self, points: &[Vector2], color: impl Into<Color>)

Draw a triangle fan defined by points.
Source§

fn draw_triangle_strip(&mut self, points: &[Vector2], color: impl Into<Color>)

Draw a triangle strip defined by points
Source§

fn draw_poly( &mut self, center: impl Into<Vector2>, sides: i32, radius: f32, rotation: f32, color: impl Into<Color>, )

Draws a regular polygon of n sides (Vector version).
Source§

fn draw_poly_lines( &mut self, center: impl Into<Vector2>, sides: i32, radius: f32, rotation: f32, color: impl Into<Color>, )

Draws a regular polygon of n sides (Vector version).
Source§

fn draw_texture( &mut self, texture: impl AsRef<Texture2D>, x: i32, y: i32, tint: impl Into<Color>, )

Draws a texture using specified position and tint color.
Source§

fn draw_texture_v( &mut self, texture: impl AsRef<Texture2D>, position: impl Into<Vector2>, tint: impl Into<Color>, )

Draws a texture using specified position vector and tint color.
Source§

fn draw_texture_ex( &mut self, texture: impl AsRef<Texture2D>, position: impl Into<Vector2>, rotation: f32, scale: f32, tint: impl Into<Color>, )

Draws a texture with extended parameters.
Source§

fn draw_texture_rec( &mut self, texture: impl AsRef<Texture2D>, source_rec: impl Into<Rectangle>, position: impl Into<Vector2>, tint: impl Into<Color>, )

Draws from a region of texture defined by the source_rec rectangle.
Source§

fn draw_texture_pro( &mut self, texture: impl AsRef<Texture2D>, source_rec: impl Into<Rectangle>, dest_rec: impl Into<Rectangle>, origin: impl Into<Vector2>, rotation: f32, tint: impl Into<Color>, )

Draw from a region of texture defined by the source_rec rectangle with pro parameters.
Source§

fn draw_texture_n_patch( &mut self, texture: impl AsRef<Texture2D>, n_patch_info: impl Into<NPatchInfo>, dest_rec: impl Into<Rectangle>, origin: impl Into<Vector2>, rotation: f32, tint: impl Into<Color>, )

Draws a texture (or part of it) that stretches or shrinks nicely
Source§

fn draw_fps(&mut self, x: i32, y: i32)

Shows current FPS.
Source§

fn draw_text( &mut self, text: &str, x: i32, y: i32, font_size: i32, color: impl Into<Color>, )

Draws text (using default font). This does not support UTF-8. Use [RaylibDrawHandle::draw_text_codepoints] for that.
Source§

fn draw_text_codepoints( &mut self, font: impl AsRef<Font>, text: &str, position: impl Into<Vector2>, font_size: f32, spacing: f32, tint: impl Into<Color>, )

Draws text (using default font) with support for UTF-8. If you do not need UTF-8, use [RaylibDrawHandle::draw_text].
Source§

fn draw_text_ex( &mut self, font: impl AsRef<Font>, text: &str, position: impl Into<Vector2>, font_size: f32, spacing: f32, tint: impl Into<Color>, )

Draws text using font and additional parameters.
Source§

fn draw_text_pro( &mut self, font: impl AsRef<Font>, text: &str, position: impl Into<Vector2>, origin: impl Into<Vector2>, rotation: f32, font_size: f32, spacing: f32, tint: impl Into<Color>, )

Draw text using Font and pro parameters (rotation)
Source§

fn draw_text_codepoint( &mut self, font: impl AsRef<Font>, codepoint: i32, position: impl Into<Vector2>, scale: f32, tint: impl Into<Color>, )

Draw one character (codepoint)
Source§

fn enable_event_waiting(&self)

Enable waiting for events when the handle is dropped, no automatic event polling
Source§

fn disable_event_waiting(&self)

Disable waiting for events when the handle is dropped, no automatic event polling
Source§

fn draw_poly_lines_ex( &mut self, center: impl Into<Vector2>, sides: i32, radius: f32, rotation: f32, line_thick: f32, color: impl Into<Color>, )

Draw a polygon outline of n sides with extended parameters
Source§

fn draw_spline_linear( &mut self, points: &[Vector2], thick: f32, color: impl Into<Color>, )

Draw spline: Linear, minimum 2 points
Source§

fn draw_spline_basis( &mut self, points: &[Vector2], thick: f32, color: impl Into<Color>, )

Draw spline: B-Spline, minimum 4 points
Source§

fn draw_spline_catmull_rom( &mut self, points: &[Vector2], thick: f32, color: impl Into<Color>, )

Draw spline: Catmull-Rom, minimum 4 points
Source§

fn draw_spline_bezier_quadratic( &mut self, points: &[Vector2], thick: f32, color: impl Into<Color>, )

Draw spline: Quadratic Bezier, minimum 3 points (1 control point): [p1, c2, p3, c4…]
Source§

fn draw_spline_bezier_cubic( &mut self, points: &[Vector2], thick: f32, color: impl Into<Color>, )

Draw spline: Cubic Bezier, minimum 4 points (2 control points): [p1, c2, c3, p4, c5, c6…]
Source§

fn draw_spline_segment_linear( &mut self, p1: impl Into<Vector2>, p2: impl Into<Vector2>, thick: f32, color: impl Into<Color>, )

Draw spline segment: Linear, 2 points
Source§

fn draw_spline_segment_basis( &mut self, p1: impl Into<Vector2>, p2: impl Into<Vector2>, p3: impl Into<Vector2>, p4: impl Into<Vector2>, thick: f32, color: impl Into<Color>, )

Draw spline segment: B-Spline, 4 points
Source§

fn draw_spline_segment_catmull_rom( &mut self, p1: impl Into<Vector2>, p2: impl Into<Vector2>, p3: impl Into<Vector2>, p4: impl Into<Vector2>, thick: f32, color: impl Into<Color>, )

Draw spline segment: Catmull-Rom, 4 points
Source§

fn draw_spline_segment_bezier_quadratic( &mut self, p1: impl Into<Vector2>, c2: impl Into<Vector2>, p3: impl Into<Vector2>, thick: f32, color: impl Into<Color>, )

Draw spline segment: Quadratic Bezier, 2 points, 1 control point
Source§

fn draw_spline_segment_bezier_cubic( &mut self, p1: impl Into<Vector2>, c2: impl Into<Vector2>, c3: impl Into<Vector2>, p4: impl Into<Vector2>, thick: f32, color: impl Into<Color>, )

Draw spline segment: Cubic Bezier, 2 points, 2 control points
Source§

fn get_spline_point_linear( &mut self, start_pos: impl Into<Vector2>, end_pos: impl Into<Vector2>, t: f32, ) -> Vector2

Get (evaluate) spline point: Linear
Source§

fn get_spline_point_basis( &mut self, p1: impl Into<Vector2>, p2: impl Into<Vector2>, p3: impl Into<Vector2>, p4: impl Into<Vector2>, t: f32, ) -> Vector2

Get (evaluate) spline point: B-Spline
Source§

fn get_spline_point_catmull_rom( &mut self, p1: impl Into<Vector2>, p2: impl Into<Vector2>, p3: impl Into<Vector2>, p4: impl Into<Vector2>, t: f32, ) -> Vector2

Get (evaluate) spline point: Catmull-Rom
Source§

fn get_spline_point_bezier_quad( &mut self, p1: impl Into<Vector2>, c2: impl Into<Vector2>, p3: impl Into<Vector2>, t: f32, ) -> Vector2

Get (evaluate) spline point: Quadratic Bezier
Source§

fn get_spline_point_bezier_cubic( &mut self, p1: impl Into<Vector2>, c2: impl Into<Vector2>, c3: impl Into<Vector2>, p4: impl Into<Vector2>, t: f32, ) -> Vector2

Get (evaluate) spline point: Cubic Bezier
Source§

impl<'a, T: 'a> RaylibDraw3D for RaylibShaderMode<'a, '_, T>

Source§

fn draw_point3D( &mut self, position: impl Into<Vector3>, color: impl Into<Color>, )

Draw a point in 3D space, actually a small line
Source§

fn draw_triangle3D( &mut self, v1: impl Into<Vector3>, v2: impl Into<Vector3>, v3: impl Into<Vector3>, color: impl Into<Color>, )

Draw a color-filled triangle (vertex in counter-clockwise order!)
Source§

fn draw_triangle_strip3D(&mut self, points: &[Vector3], color: impl Into<Color>)

Draw a triangle strip defined by points
Source§

fn draw_line3D( &mut self, start_pos: impl Into<Vector3>, end_pos: impl Into<Vector3>, color: impl Into<Color>, )

Draws a line in 3D world space.
Source§

fn draw_circle3D( &mut self, center: impl Into<Vector3>, radius: f32, rotation_axis: impl Into<Vector3>, rotation_angle: f32, color: impl Into<Color>, )

Draws a circle in 3D world space.
Source§

fn draw_cube( &mut self, position: impl Into<Vector3>, width: f32, height: f32, length: f32, color: impl Into<Color>, )

Draws a cube.
Source§

fn draw_cube_v( &mut self, position: impl Into<Vector3>, size: impl Into<Vector3>, color: impl Into<Color>, )

Draws a cube (Vector version).
Source§

fn draw_cube_wires( &mut self, position: impl Into<Vector3>, width: f32, height: f32, length: f32, color: impl Into<Color>, )

Draws a cube in wireframe.
Source§

fn draw_cube_wires_v( &mut self, position: impl Into<Vector3>, size: impl Into<Vector3>, color: impl Into<Color>, )

Draws a cube in wireframe. (Vector Version)
Source§

fn draw_mesh( &mut self, mesh: impl AsRef<Mesh>, material: WeakMaterial, transform: impl Into<Matrix>, )

Draw a 3d mesh with material and transform
Source§

fn draw_mesh_instanced( &mut self, mesh: impl AsRef<Mesh>, material: WeakMaterial, transforms: &[Matrix], )

Draw multiple mesh instances with material and different transforms
Source§

fn draw_sphere( &mut self, center_pos: impl Into<Vector3>, radius: f32, color: impl Into<Color>, )

Draws a sphere.
Source§

fn draw_sphere_ex( &mut self, center_pos: impl Into<Vector3>, radius: f32, rings: i32, slices: i32, color: impl Into<Color>, )

Draws a sphere with extended parameters.
Source§

fn draw_sphere_wires( &mut self, center_pos: impl Into<Vector3>, radius: f32, rings: i32, slices: i32, color: impl Into<Color>, )

Draws a sphere in wireframe.
Source§

fn draw_cylinder( &mut self, position: impl Into<Vector3>, radius_top: f32, radius_bottom: f32, height: f32, slices: i32, color: impl Into<Color>, )

Draws a cylinder.
Source§

fn draw_cylinder_ex( &mut self, start_position: impl Into<Vector3>, end_position: impl Into<Vector3>, radius_start: f32, radius_end: f32, slices: i32, color: impl Into<Color>, )

Draws a cylinder with extended parameters.
Source§

fn draw_cylinder_wires( &mut self, position: impl Into<Vector3>, radius_top: f32, radius_bottom: f32, height: f32, slices: i32, color: impl Into<Color>, )

Draws a cylinder in wireframe.
Source§

fn draw_cylinder_wires_ex( &mut self, start_position: impl Into<Vector3>, end_position: impl Into<Vector3>, radius_start: f32, radius_end: f32, slices: i32, color: impl Into<Color>, )

Draws a cylinder in wireframe with extended parameters.
Source§

fn draw_capsule( &mut self, start_pos: impl Into<Vector3>, end_pos: impl Into<Vector3>, radius: f32, slices: i32, rings: i32, color: impl Into<Color>, )

Draw capsule with the center of its sphere caps at startPos and endPos
Source§

fn draw_capsule_wires( &mut self, start_pos: impl Into<Vector3>, end_pos: impl Into<Vector3>, radius: f32, slices: i32, rings: i32, color: impl Into<Color>, )

Draw capsule wireframe with the center of its sphere caps at startPos and endPos
Source§

fn draw_plane( &mut self, center_pos: impl Into<Vector3>, size: impl Into<Vector2>, color: impl Into<Color>, )

Draws an X/Z plane.
Source§

fn draw_ray(&mut self, ray: impl Into<Ray>, color: impl Into<Color>)

Draws a ray line.
Source§

fn draw_grid(&mut self, slices: i32, spacing: f32)

Draws a grid (centered at (0, 0, 0)).
Source§

fn draw_model( &mut self, model: impl AsRef<Model>, position: impl Into<Vector3>, scale: f32, tint: impl Into<Color>, )

Draws a model (with texture if set).
Source§

fn draw_model_ex( &mut self, model: impl AsRef<Model>, position: impl Into<Vector3>, rotation_axis: impl Into<Vector3>, rotation_angle: f32, scale: impl Into<Vector3>, tint: impl Into<Color>, )

Draws a model with extended parameters.
Source§

fn draw_model_wires( &mut self, model: impl AsRef<Model>, position: impl Into<Vector3>, scale: f32, tint: impl Into<Color>, )

Draws a model with wires (with texture if set).
Source§

fn draw_model_wires_ex( &mut self, model: impl AsRef<Model>, position: impl Into<Vector3>, rotation_axis: impl Into<Vector3>, rotation_angle: f32, scale: impl Into<Vector3>, tint: impl Into<Color>, )

Draws a model with wires.
Source§

fn draw_bounding_box( &mut self, bbox: impl Into<BoundingBox>, color: impl Into<Color>, )

Draws a bounding box (wires).
Source§

fn draw_billboard( &mut self, camera: impl Into<Camera3D>, texture: &Texture2D, center: impl Into<Vector3>, size: f32, tint: impl Into<Color>, )

Draws a billboard texture.
Source§

fn draw_billboard_rec( &mut self, camera: impl Into<Camera3D>, texture: &Texture2D, source_rec: impl Into<Rectangle>, center: impl Into<Vector3>, size: impl Into<Vector2>, tint: impl Into<Color>, )

Draws a billboard texture defined by source_rec.
Source§

fn draw_billboard_pro( &mut self, camera: impl Into<Camera>, texture: impl Into<Texture2D>, source: impl Into<Rectangle>, position: impl Into<Vector3>, up: impl Into<Vector3>, size: impl Into<Vector2>, origin: impl Into<Vector2>, rotation: f32, tint: impl Into<Color>, )

Draw a billboard texture defined by source and rotation

Auto Trait Implementations§

§

impl<'a, 'b, T> !Send for RaylibShaderMode<'a, 'b, T>

§

impl<'a, 'b, T> !Sync for RaylibShaderMode<'a, 'b, T>

§

impl<'a, 'b, T> !UnwindSafe for RaylibShaderMode<'a, 'b, T>

§

impl<'a, 'b, T> Freeze for RaylibShaderMode<'a, 'b, T>

§

impl<'a, 'b, T> RefUnwindSafe for RaylibShaderMode<'a, 'b, T>
where T: RefUnwindSafe,

§

impl<'a, 'b, T> Unpin for RaylibShaderMode<'a, 'b, T>

§

impl<'a, 'b, T> UnsafeUnpin for RaylibShaderMode<'a, 'b, T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<D> RaylibBlendModeExt for D
where D: RaylibDraw,

Source§

fn begin_blend_mode( &mut self, blend_mode: BlendMode, ) -> RaylibBlendMode<'_, Self>

Begin blending mode (alpha, additive, multiplied, subtract, custom). Prefer using the closure version, RaylibBlendModeExt::draw_blend_mode. This version returns a handle that calls raylib_sys::EndBlendMode at the end of the scope and is provided as a fallback incase you run into issues with closures(such as lifetime or performance reasons)
Source§

fn draw_blend_mode<'a>( &'a mut self, blend_mode: BlendMode, func: impl FnOnce(RaylibBlendMode<'a, Self>), )

Begin blending mode (alpha, additive, multiplied, subtract, custom).
Source§

impl<D> RaylibMode2DExt for D
where D: RaylibDraw,

Source§

fn begin_mode2D( &mut self, camera: impl Into<Camera2D>, ) -> RaylibMode2D<'_, Self>

Begin 2D mode with custom camera (2D). Prefer using the closure version, RaylibMode2DExt::draw_mode2D. This version returns a handle that calls raylib_sys::EndMode2D at the end of the scope and is provided as a fallback incase you run into issues with closures(such as lifetime or performance reasons)
Source§

fn draw_mode2D<'a>( &'a mut self, camera: impl Into<Camera2D>, func: impl FnOnce(RaylibMode2D<'a, Self>), )

Begin 2D mode with custom camera (2D).
Source§

impl<D> RaylibMode3DExt for D
where D: RaylibDraw,

Source§

fn begin_mode3D( &mut self, camera: impl Into<Camera3D>, ) -> RaylibMode3D<'_, Self>

Begin 3D mode with custom camera (3D). Prefer using the closure version, RaylibMode3DExt::draw_mode3D. This version returns a handle that calls raylib_sys::EndMode3D at the end of the scope and is provided as a fallback incase you run into issues with closures(such as lifetime or performance reasons)
Source§

fn draw_mode3D<'a>( &'a mut self, camera: impl Into<Camera3D>, func: impl FnOnce(RaylibMode3D<'a, Self>), )

Begin 3D mode with custom camera (3D).
Source§

impl<D> RaylibRlgl for D
where D: RaylibDraw,

Source§

fn rl_push_matrix(&mut self) -> RlMatrix<'_, Self>

Push the current matrix onto the stack; the returned guard pops it on drop. Apply transforms (rl_translatef/rl_rotatef/rl_scalef) through the guard.
Source§

fn rl_load_identity(&mut self)

Reset the current matrix to identity.
Source§

fn rl_translatef(&mut self, x: f32, y: f32, z: f32)

Multiply the current matrix by a translation.
Source§

fn rl_rotatef(&mut self, angle: f32, x: f32, y: f32, z: f32)

Multiply the current matrix by a rotation of angle degrees about (x,y,z).
Source§

fn rl_scalef(&mut self, x: f32, y: f32, z: f32)

Multiply the current matrix by a scale.
Source§

fn rl_mult_matrixf(&mut self, mat: Matrix)

Multiply the current matrix by mat.
Source§

fn rl_matrix_mode(&mut self, mode: MatrixMode)

Choose which matrix subsequent operations affect.
Source§

fn rl_ortho( &mut self, left: f64, right: f64, bottom: f64, top: f64, near: f64, far: f64, )

Multiply the current matrix by an orthographic projection.
Source§

fn rl_set_matrix_projection(&mut self, proj: Matrix)

Set the projection matrix directly.
Source§

fn rl_set_matrix_modelview(&mut self, view: Matrix)

Set the model-view matrix directly.
Source§

fn rl_begin(&mut self, mode: DrawMode) -> RlImmediate<'_, Self>

Begin an immediate-mode vertex stream; the returned guard ends it on drop. Emit vertices/colors through the guard. Prefer rl_draw.
Source§

fn rl_draw( &mut self, mode: DrawMode, body: impl FnOnce(&mut RlImmediate<'_, Self>), )

Run body inside an immediate-mode block, ending it afterwards (closure form). Read more
Source§

fn rl_enable_depth_test(&mut self)

Enable depth testing.
Source§

fn rl_disable_depth_test(&mut self)

Disable depth testing.
Source§

fn rl_enable_backface_culling(&mut self)

Enable back-face culling.
Source§

fn rl_disable_backface_culling(&mut self)

Disable back-face culling.
Source§

fn rl_set_texture(&mut self, texture: &Texture2D)

Set the active texture for subsequent immediate-mode drawing. Read more
Source§

fn rl_enable_texture(&mut self, texture: &Texture2D)

Enable a texture (by binding the safe handle’s GL id).
Source§

fn rl_disable_texture(&mut self)

Disable the active texture.
Source§

fn rl_active_texture_slot(&mut self, slot: i32)

Select the active multitexture slot.
Source§

fn rl_enable_shader(&mut self, shader: &Shader)

Enable a shader program (by binding the safe handle’s GL id).
Source§

fn rl_set_shader(&mut self, shader: &Shader)

Set the active shader and its uniform locations (from the safe handle).
Source§

impl<D> RaylibScissorModeExt for D
where D: RaylibDraw,

Source§

fn begin_scissor_mode( &mut self, x: i32, y: i32, width: i32, height: i32, ) -> RaylibScissorMode<'_, Self>

Begin scissor mode (define screen area for following drawing). Prefer using the closure version, RaylibScissorModeExt::draw_scissor_mode. This version returns a handle that calls raylib_sys::EndScissorMode at the end of the scope and is provided as a fallback incase you run into issues with closures(such as lifetime or performance reasons)
Source§

fn draw_scissor_mode<'a>( &'a mut self, x: i32, y: i32, width: i32, height: i32, func: impl FnOnce(RaylibScissorMode<'a, Self>), )

Begin scissor mode (define screen area for following drawing).
Source§

impl<D> RaylibShaderModeExt for D
where D: RaylibDraw,

Source§

fn begin_shader_mode<'a, 'b>( &'a mut self, shader: &'b mut Shader, ) -> RaylibShaderMode<'a, 'b, Self>

Begin custom shader drawing. Prefer using the closure version, RaylibShaderModeExt::draw_shader_mode. This version returns a handle that calls raylib_sys::EndShaderMode at the end of the scope and is provided as a fallback incase you run into issues with closures(such as lifetime or performance reasons)
Source§

fn draw_shader_mode<'a, 'b>( &'a mut self, shader: &'b mut Shader, func: impl FnOnce(RaylibShaderMode<'a, 'b, Self>), )

Begin custom shader drawing.
Source§

impl<D> RaylibVRModeExt for D
where D: RaylibDraw,

Source§

fn begin_vr_stereo_mode<'a, 'b>( &'a mut self, _: &RaylibThread, vr_config: &'b mut VrStereoConfig, ) -> RaylibVRMode<'a, 'b, Self>

Begin stereo rendering (requires VR simulator). Prefer using the closure version, RaylibVRModeExt::draw_vr_stereo_mode . This version returns a handle that calls raylib_sys::EndVrStereoMode at the end of the scope and is provided as a fallback incase you run into issues with closures(such as lifetime or performance reasons)
Source§

fn draw_vr_stereo_mode<'a, 'b>( &'a mut self, vr_config: &'b mut VrStereoConfig, func: impl FnOnce(RaylibVRMode<'a, 'b, Self>), )

Begin stereo rendering (requires VR simulator).
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.