pub struct RenderTexture { /* private fields */ }
Expand description

Target for off-screen 2D rendering into a texture

Implementations

Construct a new render texture

Arguments
  • width - Width of the render texture
  • height - Height of the render texture

Returns None if creation fails.

Create a RenderTexture with the given ContextSettings.

Useful if you want to enable multi-sampling or use the render-texture for OpenGL rendering that requires a depth or stencil buffer. Otherwise it is unnecessary, and you should call RenderTexture::new.

Parameters
  • width - Width of the render-texture
  • height - Height of the render-texture
  • settings - Additional settings for the underlying OpenGL texture and context

Returns None if creation fails.

Update the contents of the target texture

Activate or deactivate a render texture as the current target for rendering

Arguments
  • active - true to activate, false to deactivate

Get the target texture of a render texture

Return the target texture

Enable or disable the smooth filter on a render texture

Arguments
  • smooth - true to enable smoothing, false to disable it

Tell whether the smooth filter is enabled or not for a render texture

Return true if smoothing is enabled, false if it is disabled

Enable or disable texture repeating.

This function is similar to Texture::setRepeated. This parameter is disabled by default.

Tell whether the texture is repeated or not.

Generate a mipmap using the current texture data.

This function is similar to Texture::generate_mipmap and operates on the texture used as the target for drawing.

Safety

Be aware that any draw operation may modify the base level image data. For this reason, calling this function only makes sense after all drawing is completed and display has been called. Not calling display after subsequent drawing will lead to undefined behavior if a mipmap had been previously generated.

Get the maximum anti-aliasing level supported by the system.

Trait Implementations

Formats the value using the given formatter. Read more
Executes the destructor for this type. Read more
Get the size of the rendering region of a window Read more
clear the screen
set a new view to the target
return the current view
get the default view for the render target
get the viewport of the render target
Convert a point from window coordinates to world coordinates Read more
Convert a point from window coordinates to world coordinates Read more
Convert a point from world coordinates to window coordinates Read more
Convert a point from window coordinates to world coordinates Read more
Draw a drawable object to the render target Read more
Draw a drawable object to the render-target with a RenderStates Read more
Draw Text
Draw Shape
Draw Sprite
Draw CircleShape
Draw RectangleShape
Draw ConvexShape
Draw VertexBuffer
draw primitives
Save the current OpenGL render states and matrices Read more
Restore the previously saved OpenGL render states and matrices
Reset the internal OpenGL states so that the target is ready for drawing Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.