[][src]Module kit::graphics

Graphics commands for drawing primitives.

Functions

aspect

returns the current aspect ratio of the application window

default_projection
draw_circ
draw_image

Draws a full image on screen at the specified position and scale using a quad.

draw_line
draw_mesh
draw_point
draw_rect
draw_shape

general draw call for drawing a shape primitive

draw_sprite

This draw command is a special alias for draw_quad with some extra utility for treating the associated image like a spritesheet. Define a Sprite to describe the zone within the image that will be drawn.

init

lifecycle function for initial setup and sensible defaults. Needs to be run after window initialization.

load_img
present

Lifecycle function for processing all draw calls collected for a single frame of rendering. Clears all calls when done to prepare for the next frame.

sprite

Sprite builder. The result can be consumed immediately by draw_sprite or stored to avoid recalculating the sprite's corners every frame.

window_height
window_width

returns the current window width