Skip to main content

Crate egor

Crate egor 

Source
Expand description

§Egor

A dead simple cross-platform 2D graphics engine

§Why Egor?

Egor is dead simple, lightweight and cross-platform. The same code runs on native and web (WASM) with minimal boilerplate. It’s built from small, composable crates on top of modern graphics and windowing abstractions

Egor gives you the essentials for 2D apps and games:

  • Efficient 2D rendering (shapes, textures, text)
  • Keyboard & mouse input
  • Camera & world-space transforms
  • Optional egui integration for tools and UIs
  • Optional hot-reload during development

§Start Here

These are the main types Egor users interact with:

§Minimal Example: Draw a Rectangle

use egor::{app::{App, FrameContext}, render::Graphics};
App::new().run(|FrameContext { gfx, .. }| {
    // start building a rectangle with some defaults
    // draws automatically on `Drop` without an explicit `build()`
    gfx.rect();
});

§Crate Layout

egor is a meta crate that re-exports egor_* crates for convenience:

§Cargo Features

FeatureDescriptionDefault
logEnable logging via egor_app/logopt-in
hot_reloadHot-reload support via egor_glue/hot_reloadopt-in
uiEnable egui integration via egor_glue/uiopt-in
webglWebGL backend for egor_renderopt-in
angleANGLE backend for egor_renderopt-in
glesOpenGL ES backend for egor_renderopt-in
vulkanVulkan backend for egor_renderLinux default/opt-in

Notes:

  • Windows builds use DX12 by default, Linux builds use Vulkan by default, etc
  • Optional backends can be enabled to override defaults or for cross-platform targeting

Modules§

app
input
math
render
time