{"id":13534425,"url":"https://github.com/not-fl3/miniquad","last_synced_at":"2025-05-14T04:07:41.329Z","repository":{"id":37270808,"uuid":"229360531","full_name":"not-fl3/miniquad","owner":"not-fl3","description":"Cross platform rendering in Rust","archived":false,"fork":false,"pushed_at":"2025-04-28T17:02:56.000Z","size":4062,"stargazers_count":1733,"open_issues_count":119,"forks_count":192,"subscribers_count":25,"default_branch":"master","last_synced_at":"2025-04-28T18:22:42.381Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/not-fl3.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"patreon":"fedorgames","github":"not-fl3"}},"created_at":"2019-12-21T01:27:45.000Z","updated_at":"2025-04-28T17:03:01.000Z","dependencies_parsed_at":"2023-02-01T18:15:33.575Z","dependency_job_id":"f4307a04-8cce-46ca-9af6-a09cd1874364","html_url":"https://github.com/not-fl3/miniquad","commit_stats":{"total_commits":543,"total_committers":87,"mean_commits":6.241379310344827,"dds":0.3609576427255985,"last_synced_commit":"aa38a5bfc01350dd6e6132d44372189f14ba5dd9"},"previous_names":[],"tags_count":40,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/not-fl3%2Fminiquad","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/not-fl3%2Fminiquad/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/not-fl3%2Fminiquad/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/not-fl3%2Fminiquad/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/not-fl3","download_url":"https://codeload.github.com/not-fl3/miniquad/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254069220,"owners_count":22009513,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T07:01:32.727Z","updated_at":"2025-05-14T04:07:41.321Z","avatar_url":"https://github.com/not-fl3.png","language":"Rust","funding_links":["https://patreon.com/fedorgames","https://github.com/sponsors/not-fl3"],"categories":["Rust","Game engines","Libraries"],"sub_categories":["Rust"],"readme":"# Miniquad\n\n[![Github Actions](https://github.com/not-fl3/miniquad/workflows/Cross-compile/badge.svg)](https://github.com/not-fl3/miniquad/actions?query=workflow%3A)\n[![Docs](https://docs.rs/miniquad/badge.svg?version=0.3.13)](https://docs.rs/miniquad/0.3.13/miniquad/index.html)\n[![Crates.io version](https://img.shields.io/crates/v/miniquad.svg)](https://crates.io/crates/miniquad)\n[![Discord chat](https://img.shields.io/discord/710177966440579103.svg?label=discord%20chat)](https://discord.gg/WfEp6ut)\n[![Matrix](https://img.shields.io/matrix/quad-general:matrix.org?label=matrix%20chat)](https://matrix.to/#/#quad-general:matrix.org)\n\nMiniquad 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.\n\nMiniquad 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. \n\n## Supported Platforms\n\n* Windows, OpenGL 3, OpenGL 2.2;\n* Linux, OpenGL 2.2, OpenGL 3, GLES 2, GLES 3;\n* macOS, OpenGL 3, Metal;\n* iOS, GLES 2, GLES 3, Metal;\n* WASM, WebGL 1 - tested on iOS Safari, Firefox, Chrome;\n* Android, GLES 2, GLES 3.\n\n## Examples\n\n![Imgur](https://i.imgur.com/TRI50rk.gif)\n\n[examples/quad.rs](https://github.com/not-fl3/miniquad/blob/master/examples/quad.rs): [web demo](https://not-fl3.github.io/miniquad-samples/quad.html)\u003cbr/\u003e\n[examples/offscreen.rs](https://github.com/not-fl3/miniquad/blob/master/examples/offscreen.rs): [web demo](https://not-fl3.github.io/miniquad-samples/offscreen.html)\u003cbr/\u003e\n\n[PonasKovas/miniquad-mandelbrot](https://github.com/PonasKovas/miniquad-mandelbrot): [web demo](https://ponaskovas.github.io/miniquad-mandelbrot-wasm-demo/)\n\n# Building examples\n\n## Linux\n\n```bash\ncargo run --example quad\n```\n\nOn NixOS Linux you can use [`shell.nix`](shell.nix) to start a development\nenvironment where Miniquad can be built and run.\n\n## Windows\n\n```bash\n# both MSVC and GNU target is supported:\nrustup target add x86_64-pc-windows-msvc\n# or\nrustup target add x86_64-pc-windows-gnu\n\ncargo run --example quad\n```\n\n## WASM\n\n```bash\nrustup target add wasm32-unknown-unknown\ncargo build --example quad --target wasm32-unknown-unknown\n```\n\nAnd then use the following .html to load .wasm:\n\n\u003cdetails\u003e\u003csummary\u003eindex.html\u003c/summary\u003e\n\n```html\n\u003chtml lang=\"en\"\u003e\n\n\u003chead\u003e\n    \u003cmeta charset=\"utf-8\"\u003e\n    \u003ctitle\u003eTITLE\u003c/title\u003e\n    \u003cstyle\u003e\n        html,\n        body,\n        canvas {\n            margin: 0px;\n            padding: 0px;\n            width: 100%;\n            height: 100%;\n            overflow: hidden;\n            position: absolute;\n            background: black;\n            z-index: 0;\n        }\n    \u003c/style\u003e\n\u003c/head\u003e\n\n\u003cbody\u003e\n    \u003ccanvas id=\"glcanvas\" tabindex='1'\u003e\u003c/canvas\u003e\n    \u003c!-- Minified and statically hosted version of https://github.com/not-fl3/miniquad/blob/master/native/sapp-wasm/js/gl.js --\u003e\n    \u003cscript src=\"https://not-fl3.github.io/miniquad-samples/gl.js\"\u003e\u003c/script\u003e\n    \u003cscript\u003eload(\"quad.wasm\");\u003c/script\u003e \u003c!-- Your compiled wasm file --\u003e\n\u003c/body\u003e\n\n\u003c/html\u003e\n```\n\u003c/details\u003e\n\nOne of the ways to server static .wasm and .html:\n\n```no-run\ncargo install basic-http-server\nbasic-http-server .\n```\n\n## Android\n\nRecommended way to build for android is using Docker.\u003cbr/\u003e\nminiquad uses slightly modifed version of `cargo-apk`\n\n```no-run\ndocker run --rm -v $(pwd)\":/root/src\" -w /root/src notfl3/cargo-apk cargo quad-apk build --example quad\n```\n\nAPK file will be in `target/android-artifacts/(debug|release)/apk`\n\nWith \"log-impl\" enabled all log calls will be forwarded to adb console.\nNo code modifications for Android required, everything should just works.\n\n## iOS\n\nTo run on the simulator:\n\n```no-run\nmkdir MyGame.app\ncargo build --target x86_64-apple-ios --release\ncp target/release/mygame MyGame.app\n# only if the game have any assets\ncp -r assets MyGame.app\ncat \u003e MyGame.app/Info.plist \u003c\u003c EOF\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003c!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\"\u003e\n\u003cplist version=\"1.0\"\u003e\n\u003cdict\u003e\n\u003ckey\u003eCFBundleExecutable\u003c/key\u003e\n\u003cstring\u003emygame\u003c/string\u003e\n\u003ckey\u003eCFBundleIdentifier\u003c/key\u003e\n\u003cstring\u003ecom.mygame\u003c/string\u003e\n\u003ckey\u003eCFBundleName\u003c/key\u003e\n\u003cstring\u003emygame\u003c/string\u003e\n\u003ckey\u003eCFBundleVersion\u003c/key\u003e\n\u003cstring\u003e1\u003c/string\u003e\n\u003ckey\u003eCFBundleShortVersionString\u003c/key\u003e\n\u003cstring\u003e1.0\u003c/string\u003e\n\u003c/dict\u003e\n\u003c/plist\u003e\nEOF\n\nxcrun simctl install booted MyGame.app/\nxcrun simctl launch booted com.mygame\n```\n\nFor details and instructions on provisioning for real iphone, check [https://macroquad.rs/articles/ios/](https://macroquad.rs/articles/ios/)\n\n## Cross Compilation\n\n```bash\n\n# windows target from linux host:\n# this is how windows builds are tested from linux machine:\nrustup target add x86_64-pc-windows-gnu\ncargo run --example quad --target x86_64-pc-windows-gnu\n```\n\n# Goals\n\n* Fast compilation time. Right now it is ~5s from \"cargo clean\" for both desktop and web.\n\n* Cross platform. Amount of platform specific user code required should be kept as little as possible.\n\n* Low-end devices support.\n\n* 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.\n\n* 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.\n\n# Non-goals\n\n* 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!\n\n* High-end API, like Vulkan/DirectX 12. Take a look on [gfx-rs](https://github.com/gfx-rs/gfx) or [vulkano](https://github.com/vulkano-rs/vulkano) instead!\n\n# Platinum sponsors\n\nMiniquad is supported by:\n\n[SourceGear](https://www.sourcegear.com/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnot-fl3%2Fminiquad","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnot-fl3%2Fminiquad","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnot-fl3%2Fminiquad/lists"}