[][src]Module tetra::graphics

Functions and types used for rendering to the screen.

This module implements a (hopefully!) efficent quad renderer, which will queue up drawing operations until it is absolutely necessary to send them to the graphics hardware. This allows us to minimize the number of draw calls made, speeding up rendering.

Re-exports

pub use self::animation::Animation;
pub use self::color::Color;
pub use self::scaling::ScreenScaling;
pub use self::shader::Shader;
pub use self::text::Font;
pub use self::text::Text;
pub use self::texture::Texture;
pub use self::ui::NineSlice;

Modules

animation

Functions and types relating to animations.

color

Functions and types relating to color.

scaling

Functions and types relating to screen scaling.

shader

Functions and types relating to shader programs.

text

Functions and types relating to text rendering.

texture

Functions and types relating to textures.

ui

Functions and types relating to user interfaces.

Structs

DrawParams

Struct representing the parameters that can be used when drawing.

Rectangle

A rectangle of f32s.

Traits

Drawable

Represents a type that can be drawn to the screen/render target.

Functions

clear

Clears the currently enabled render target to the specified color.

draw

Draws an object to the currently enabled render target.

flush

Sends queued data to the graphics hardware.

get_internal_height

Gets the internal height of the screen.

get_internal_size

Gets the internal size of the screen.

get_internal_width

Gets the internal width of the screen.

get_scaling

Gets the current scaling mode.

present

Draws the currently enabled render target to the screen, scaling/letterboxing it if necessary.

reset_shader

Sets the renderer back to using the default shader.

set_internal_height

Sets the internal height of the screen.

set_internal_size

Sets the internal size of the screen.

set_internal_width

Sets the internal width of the screen.

set_scaling

Sets the current scaling mode.

set_shader

Sets the shader that is currently being used for rendering.

set_texture

Sets the texture that is currently being used for rendering.

Type Definitions

Vec2

A 2D vector with f32 components.