Crate epaint

source ·
Expand description

A simple 2D graphics library for turning simple 2D shapes and text into textured triangles.

Made for egui.

Create some Shape:s and pass them to tessellate_shapes to generate Mesh:es that you can then paint using some graphics API of your choice (e.g. OpenGL).

Feature flags




  • An assert that is only active when epaint is compiled with the extra_asserts feature or with the extra_debug_asserts feature in debug builds.



  • A rendering primitive - either a Mesh or a PaintCallback.
  • A paint primitive such as a circle or a piece of text. Coordinates are all screen space points (not physical pixels).
  • What texture to use in a Mesh mesh.


  • The UV coordinate of a white region of the texture mesh. The default egui texture has the top-left corner pixel fully white. You need need use a clamping texture sampler for this to work (so it doesn’t do bilinear blending with bottom right corner).