Enum flo_render_canvas::RenderAction
source · pub enum RenderAction {
Show 25 variants
SetTransform(Matrix),
CreateVertex2DBuffer(VertexBufferId, Vec<Vertex2D, Global>),
CreateIndexBuffer(IndexBufferId, Vec<u16, Global>),
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, Global>>),
WriteTexture1D(TextureId, usize, usize, Arc<Vec<u8, Global>>),
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, Global>)
Creates a vertex buffer with the specified 2D vertices in it (replacing any existing buffer)
CreateIndexBuffer(IndexBufferId, Vec<u16, Global>)
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, Global>>)
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, Global>>)
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<RenderAction> for RenderAction
impl PartialEq<RenderAction> for RenderAction
source§fn eq(&self, other: &RenderAction) -> bool
fn eq(&self, other: &RenderAction) -> bool
self
and other
values to be equal, and is used
by ==
.