#dummy #tree #draw #deep #world #computer #cross #miniquad #dream #stub


Part of miniquad rendering library. Stub sapp definitions.

6 releases

0.1.5 Dec 31, 2020
0.1.4 Oct 5, 2020
0.1.3 Feb 24, 2020
0.1.2 Jan 25, 2020
Download history 558/week @ 2022-03-12 288/week @ 2022-03-19 295/week @ 2022-03-26 467/week @ 2022-04-02 384/week @ 2022-04-09 573/week @ 2022-04-16 696/week @ 2022-04-23 319/week @ 2022-04-30 416/week @ 2022-05-07 400/week @ 2022-05-14 345/week @ 2022-05-21 400/week @ 2022-05-28 416/week @ 2022-06-04 301/week @ 2022-06-11 401/week @ 2022-06-18 223/week @ 2022-06-25

1,406 downloads per month
Used in 16 crates (via miniquad-fork-x)


21K SLoC


Github Actions Docs Crates.io version Discord chat Matrix

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
  • Linux, OpenGl 3
  • macOS, OpenGL 3
  • iOS, GLES 3
  • WASM, WebGl1 - tested on ios safari, ff, chrome
  • Android, GLES3

Not supported, but desirable platforms

  • Android, GLES2 - work in progress.
  • Metal. For both MacOs and IOS metal rendering backend next to opengl one is highly desirable. But I just dont have any MacOs capable hardware to start working on it :/



examples/quad.rs: web demo
examples/offscreen.rs: web demo

PonasKovas/miniquad-mandelbrot: web demo

Building examples


cargo run --example quad


# 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


rustup target add wasm32-unknown-unknown
cargo build --example quad --target wasm32-unknown-unknown

And then use the following .html to load .wasm:

<html lang="en">

    <meta charset="utf-8">
        canvas {
            margin: 0px;
            padding: 0px;
            width: 100%;
            height: 100%;
            overflow: hidden;
            position: absolute;
            background: black;
            z-index: 0;

    <canvas id="glcanvas" tabindex='1'></canvas>
    <!-- Minified and statically hosted version of https://github.com/not-fl3/miniquad/blob/master/native/sapp-wasm/js/gl.js -->
    <script src="https://not-fl3.github.io/miniquad-samples/gl.js"></script>
    <script>load("quad.wasm");</script> <!-- Your compiled wasm file -->


One of the ways to server static .wasm and .html:

cargo install basic-http-server
basic-http-server .


Recommended way to build for android is using Docker.
miniquad use slightly modifed version of cargo-apk

docker run --rm -v $(pwd)":/root/src" -w /root/src notfl3/cargo-apk cargo quad-apk build --example quad

APK file will be in target/android-artifacts/(debug|release)/apk

With "log-impl" enabled all log calls will be forwarded to adb console. No code modifications for Android required, everything should just works.


See miniquad iOS sample project.

cross compilation

# 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


  • 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!

Platinum sponsors

Miniquad is supported by: