Struct cuivre::graphics::GraphicsManager [−][src]
pub struct GraphicsManager { /* fields omitted */ }
Manages everything related to graphics and rendering.
Methods
impl GraphicsManager
[src]
impl GraphicsManager
pub fn new(
sdl: &Sdl,
window_settings: WindowSettings
) -> Result<Self, DrawingError>
[src]
pub fn new(
sdl: &Sdl,
window_settings: WindowSettings
) -> Result<Self, DrawingError>
Initializes graphics from SDL object, resource loader, default shader paths and window settings
pub fn window_size(&self) -> Vector2u
[src]
pub fn window_size(&self) -> Vector2u
Get the current window's size.
pub fn resize(&mut self, width: i32, height: i32)
[src]
pub fn resize(&mut self, width: i32, height: i32)
Sets the OpenGL viewport. Call when the window is resized.
pub fn draw_sprite(
&mut self,
sprite: &Sprite,
transform: &Transform,
camera: &Camera
)
[src]
pub fn draw_sprite(
&mut self,
sprite: &Sprite,
transform: &Transform,
camera: &Camera
)
Draws a Sprite
on a textured quad mesh.
transform
specifies the position, scale, and rotation
of the drawn Sprite
.
Camera
is the camera the Sprite
is viewed from.
Note: by default all sprites are square. For non-square sprites,
you must use transform.scale
to scale the quad appropriately.
pub fn draw_text(
&mut self,
text: &str,
font: &mut Font,
settings: TextSettings,
transform: &Transform,
camera: &Camera
) -> Result<(), FontError>
[src]
pub fn draw_text(
&mut self,
text: &str,
font: &mut Font,
settings: TextSettings,
transform: &Transform,
camera: &Camera
) -> Result<(), FontError>
Draws a string.
pub fn queue_drawcall(&mut self, drawcall: &DrawCall)
[src]
pub fn queue_drawcall(&mut self, drawcall: &DrawCall)
Adds a drawcall to the render queue.
If no suitable batch is found, a new one is created.
pub fn render(&mut self) -> Result<(), DrawingError>
[src]
pub fn render(&mut self) -> Result<(), DrawingError>
Renders the current queued batches.
Auto Trait Implementations
impl !Send for GraphicsManager
impl !Send for GraphicsManager
impl !Sync for GraphicsManager
impl !Sync for GraphicsManager