Module tetra::graphics

source ·
Expand description

Functions and types relating to rendering.

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.


  • Functions and types relating to animations.
  • Functions and types relating to meshes and shape drawing.
  • Functions and types relating to screen scaling.
  • Functions and types relating to text rendering.


  • Defines how colors should be blended when drawing to the screen.
  • A camera that can be used to transform the player’s view of the scene.
  • A texture that can be used for off-screen rendering.
  • A builder for creating advanced canvas configurations.
  • An RGBA color.
  • Parameters that can be manipulated when drawing an object.
  • Information about the device currently being used to render graphics.
  • Raw image data.
  • Information on how to slice a texture so that it can be stretched or squashed without distorting the borders.
  • A rectangle, represented by a top-left position, a width and a height.
  • A shader program, consisting of a vertex shader and a fragment shader.
  • Represents a global stencil configuration.
  • A texture, held in GPU memory.


  • Defines a multiplier that will be applied to a color or alpha value before blending it.
  • Defines a formula for blending two color or alpha values.
  • Filtering algorithms that can be used when scaling an image.
  • How drawing operations should modify the stencil buffer.
  • The test for whether a pixel is visible when using a stencil.
  • In-memory data formats for textures.



  • Implemented for types that can be passed as a uniform value to a shader.