Skip to main content

Crate gapp_winit

Crate gapp_winit 

Source
Expand description

An abstract event loop library for winit-based applications with support for OpenGL (glutin) and wgpu backends. It cleanly separates input handling, updates, rendering, and presenting via traits and manages a fixed-timestep FPS loop.

§Features

  • opengl: Enables OpenGL support.
  • wgpu: Enables wgpu support (recommended).

§Usage

Implement WindowInput<I, R>, Present<R>, Render<R> (from gapp), and Update (from gapp) for your app. Create a Windows<R> collection with your backend-specific WindowData, then call run().

See the template for reference. It can be used as a starting point.

Structs§

WindowData
Platform- and backend-specific window data for OpenGL.
Windows
Collection of windows with their associated renderers.

Traits§

Present
Trait for presenting the rendered frame.
Render
Update
WindowInput
Trait for custom input handling.

Functions§

run
Starts the main event loop with a fixed timestep.