gapp-winit 0.10.0

Abstract event loop library for winit-based applications with OpenGL and wgpu backends, integrating gapp traits for clean separation of input, update, render, and present
docs.rs failed to build gapp-winit-0.10.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: gapp-winit-0.5.0

gapp-winit

Crates.io Docs License

An abstract event loop library for winit-based applications with support for OpenGL/glutin and wgpu backends. Integrates seamlessly with gapp traits for clean separation of input, update, render, and present.

Supports native (Windows/Linux/macOS) and WASM. Fixed-timestep FPS cap, automatic resize handling.

Features

  • Backend-agnostic: Switch between OpenGL and wgpu via Cargo features.
  • Trait-based: Implement WindowInput, Present, Render (gapp), Update (gapp).
  • Cross-platform: Full WASM support (HTML canvas).
  • Performance: Fixed timestep, on-demand redraw, FPS sleep (native).
Feature OpenGL wgpu
Native
WASM
Default ❎️

Quickstart

For reference, have a look at the template program. It also can be used as a base for your program.

Traits Overview

  • WindowInput<C, R>: Handle all WindowEvents (post-resize/redraw). Call event_loop.exit() on close.
  • Present<R>: Submit frame (e.g., queue.submit(), surface.swap_buffers()).
  • Render<R> / Update (from gapp): Standard render/update loop.

Resize is auto-handled.

FPS can be supplied to run.