This Week in Quads #4

🔗blocking_event_loop on ios opengl/metal

Shout out to birhburh for finishing a series of PRs porting blocking_event_loop on basically everything!

🔗Article on getrandom for *quad

Most rust crates just assume that everyone use a non-standart, third party binary, wasm-bindgen, to post-process .wasm files on web. rand/ahash a very popular crates, and one of the very few crates in the ecosystem that acknowledge that not everyone use wasm-bindgen.

Approach from the article demonstrates a completely different approach for wasm32 dependencies management: "getrandom" do not know about miniquad existence, do not depend on "miniquad" in any way, but it is still usable from a miniquad based project!

🔗html template

Android Chrome on some phones render a page slightly zoomed by default. This results into some part of the *quad canvas being rendered behind the navigation bar.

Adding <meta name="viewport" content="width=device-width, initial-scale=1" /> fixed the problem, therefore the new recommended html template is:

<html lang="en">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1" />
        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 -->
    <script src=""></script>
    <script>load("CRATENAME.wasm");</script> <!-- Your compiled wasm file -->


🔗Road to 3d macroquad


Old GIF for a 3d macroquad test project

API compatibility was a big challange for a new, 3d-capable macroquad. Now we have a working prototype of a way to build an (almost)0.4 compatible, UB/statics free API:

use macroquad::compat::*;

async fn game(ctx: macroquad::Context) {

    loop {

        draw_line(40.0, 40.0, 100.0, 200.0, 15.0, BLUE);
        draw_rectangle(screen_width() / 2.0 - 60.0, 100.0, 120.0, 60.0, GREEN);
        draw_circle(screen_width() - 30.0, screen_height() - 30.0, 15.0, YELLOW);
        draw_text("HELLO", 20.0, 20.0, 30.0, DARKGRAY);


fn main() {
    macroquad::start(Default::default(), |ctx| game(ctx));

While it is possible to use a new, more fine-graded API: