pub enum RenderAction {
Show 25 variants
SetTransform(Matrix),
CreateVertex2DBuffer(VertexBufferId, Vec<Vertex2D>),
CreateIndexBuffer(IndexBufferId, Vec<u16>),
FreeVertexBuffer(VertexBufferId),
FreeIndexBuffer(IndexBufferId),
BlendMode(BlendMode),
CreateRenderTarget(RenderTargetId, TextureId, usize, usize, RenderTargetType),
FreeRenderTarget(RenderTargetId),
SelectRenderTarget(RenderTargetId),
RenderToFrameBuffer,
ShowFrameBuffer,
DrawFrameBuffer(RenderTargetId, i32, i32),
CreateTextureBgra(TextureId, usize, usize),
CreateTextureMono(TextureId, usize, usize),
Create1DTextureBgra(TextureId, usize),
Create1DTextureMono(TextureId, usize),
WriteTextureData(TextureId, (usize, usize), (usize, usize), Arc<Vec<u8>>),
WriteTexture1D(TextureId, usize, usize, Arc<Vec<u8>>),
CreateMipMaps(TextureId),
CopyTexture(TextureId, TextureId),
FreeTexture(TextureId),
Clear(Rgba8),
UseShader(ShaderType),
DrawTriangles(VertexBufferId, Range<usize>),
DrawIndexedTriangles(VertexBufferId, IndexBufferId, usize),
}Expand description
Represents an action for a render target
Variants§
SetTransform(Matrix)
Sets the transformation matrix to use for future renderings
CreateVertex2DBuffer(VertexBufferId, Vec<Vertex2D>)
Creates a vertex buffer with the specified 2D vertices in it (replacing any existing buffer)
CreateIndexBuffer(IndexBufferId, Vec<u16>)
Creates an index buffer with the specified 2D vertices in it (replacing any existing buffer)
FreeVertexBuffer(VertexBufferId)
Frees an existing vertex buffer
FreeIndexBuffer(IndexBufferId)
Frees an existing index buffer
BlendMode(BlendMode)
Sets the blend mode for future drawing operations (SourceOver is the default)
CreateRenderTarget(RenderTargetId, TextureId, usize, usize, RenderTargetType)
Creates a new render target of the specified size, as the specified texture
FreeRenderTarget(RenderTargetId)
Frees up an existing render target
SelectRenderTarget(RenderTargetId)
Send future rendering instructions to the specified render target
RenderToFrameBuffer
Send future rendering instructions to the main frame buffer
ShowFrameBuffer
Display the current frame buffer on-screen
DrawFrameBuffer(RenderTargetId, i32, i32)
Renders the specified framebuffer to the current framebuffer
CreateTextureBgra(TextureId, usize, usize)
Creates an 8-bit BGRA 2D texture of the specified size
CreateTextureMono(TextureId, usize, usize)
Creates an 8-bit monochrome 2D texture of the specified size
Create1DTextureBgra(TextureId, usize)
Creates a 1 dimensional 8-bit BGRA texture of the specified size
Create1DTextureMono(TextureId, usize)
Creates a 1 dimensional 8-bit monochrome texture of the specified size
WriteTextureData(TextureId, (usize, usize), (usize, usize), Arc<Vec<u8>>)
Given a region in a 2D texture and a set of bytes to write, updates the texture with those bytes
WriteTexture1D(TextureId, usize, usize, Arc<Vec<u8>>)
Given a region in a 1D texture and a set of bytes to write, updates the texture with those bytes
CreateMipMaps(TextureId)
Generates mip-maps for the specified texture ID
CopyTexture(TextureId, TextureId)
Copies a texture from a source ID to a target ID (replacing any existing texture at that ID)
Mipmap levels are not copied by this operation, so would need to be regenerated
FreeTexture(TextureId)
Frees up an existing texture
Clear(Rgba8)
Clears the current render target to the specified colour
UseShader(ShaderType)
Uses the specified shader
DrawTriangles(VertexBufferId, Range<usize>)
Renders triangles from a vertex buffer (with no texture)
Parameters are the range of vertices to use
DrawIndexedTriangles(VertexBufferId, IndexBufferId, usize)
Renders triangles using an index buffer
Trait Implementations§
Source§impl Clone for RenderAction
impl Clone for RenderAction
Source§fn clone(&self) -> RenderAction
fn clone(&self) -> RenderAction
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RenderAction
impl Debug for RenderAction
Source§impl PartialEq for RenderAction
impl PartialEq for RenderAction
impl StructuralPartialEq for RenderAction
Auto Trait Implementations§
impl Freeze for RenderAction
impl RefUnwindSafe for RenderAction
impl Send for RenderAction
impl Sync for RenderAction
impl Unpin for RenderAction
impl UnwindSafe for RenderAction
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more