You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Miniquad is a manifestation of a dream in a world where we do not need a deep dependencies tree and thousands lines of code to draw things with a computer.
Miniquad aims to provide a graphics abstraction that works the same way on any platform with a GPU, being as light weight as possible while covering as many machines as possible.
Supported Platforms
Windows, OpenGL 3, OpenGL 2.2;
Linux, OpenGL 2.2, OpenGL 3, GLES 2, GLES 3;
macOS, OpenGL 3, Metal;
iOS, GLES 2, GLES 3, Metal;
WASM, WebGL 1 - tested on iOS Safari, Firefox, Chrome;
On NixOS Linux you can use shell.nix to start a development
environment where Miniquad can be built and run.
Windows
# both MSVC and GNU target is supported:
rustup target add x86_64-pc-windows-msvc
# or
rustup target add x86_64-pc-windows-gnu
cargo run --example quad
<htmllang="en"><head><metacharset="utf-8"><title>TITLE</title><style>html,body,canvas{margin:0px;padding:0px;width:100%;height:100%;overflow: hidden;position: absolute;background: black;z-index:0;}</style></head><body><canvasid="glcanvas" tabindex='1'></canvas><!-- Minified and statically hosted version of https://github.com/not-fl3/miniquad/blob/master/native/sapp-wasm/js/gl.js --><scriptsrc="https://not-fl3.github.io/miniquad-samples/gl.js"></script><script>load("quad.wasm");</script><!-- Your compiled wasm file --></body></html>
# windows target from linux host:# this is how windows builds are tested from linux machine:
rustup target add x86_64-pc-windows-gnu
cargo run --example quad --target x86_64-pc-windows-gnu
Goals
Fast compilation time. Right now it is ~5s from "cargo clean" for both desktop and web.
Cross platform. Amount of platform specific user code required should be kept as little as possible.
Low-end devices support.
Hackability. Working on your own game, highly probable some hardware incompability will be found. Working around that kind of bugs should be easy, implementation details should not be hidden under layers of abstraction.
Forkability. Each platform implementation is, usually, just one pure Rust file. And this file is very copy-paste friendly - it doesnt use any miniquad specific abstractions. It is very easy to just copy some part of miniquad's platform implementation and use it standalone.
Non-goals
Ultimate type safety. Library should be entirely safe in Rust's definition of safe - no UB or memory unsafety. But correct GPU state is not type guaranteed. Feel free to provide safety abstraction in the user code then!
High-end API, like Vulkan/DirectX 12. Take a look on gfx-rs or vulkano instead!