gapp-winit 0.12.2

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
Documentation
# gapp-winit

[![Crates.io](https://img.shields.io/crates/v/gapp-winit.svg)](https://crates.io/crates/gapp-winit)
[![Docs](https://docs.rs/gapp-winit/badge.svg)](https://docs.rs/gapp-winit)
[![License](https://img.shields.io/crates/l/gapp-winit.svg)](https://crates.io/crates/gapp-winit)

An abstract event loop library for [winit](https://crates.io/crates/winit)-based applications with support for [OpenGL/glutin](https://crates.io/crates/glutin) and [wgpu](https://crates.io/crates/wgpu) backends. Integrates seamlessly with [gapp](https://crates.io/crates/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, multi-window support.

## Features

- **Multi-window**: Manage multiple windows via `Windows<R>` collection, with per-window event routing.
- **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](https://gitlab.com/porky11/gapp-template).
It also can be used as a base for your program.

## Traits Overview

- **`WindowInput<C, R>`**: Handle all `WindowEvent`s (post-resize/redraw) with `WindowId` and `&mut Windows<R>`. Call `event_loop.exit()` on close.
- **`Present<R>`**: Submit frame per window (e.g., `queue.submit()`, `surface.swap_buffers()`).
- **`Render<R>` / `Update`** (from gapp): Standard render/update loop, called per window.
- **`Windows<R>`**: Collection mapping `WindowId``(WindowData, R)`. Insert/remove windows dynamically.

Resize is **auto-handled** per window.

FPS can be supplied to `run`.