[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-5845":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":25,"hasPages":23,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":32,"readmeContent":33,"aiSummary":34,"trendingCount":16,"starSnapshotCount":16,"syncStatus":35,"lastSyncTime":36,"discoverSource":37},5845,"macroquad","not-fl3\u002Fmacroquad","not-fl3","Cross-platform game engine in Rust. ","",null,"Rust",4494,416,37,258,0,10,16,36,30,29.86,"Apache License 2.0",false,"master",true,[27,28,29,30,31],"android","game-engine","ios","rust","wasm","2026-06-12 02:01:15","# macroquad\n\n[![Github Actions](https:\u002F\u002Fgithub.com\u002Fnot-fl3\u002Fmacroquad\u002Fworkflows\u002FCI\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fnot-fl3\u002Fmacroquad\u002Factions?query=workflow%3A)\n[![Docs](https:\u002F\u002Fdocs.rs\u002Fmacroquad\u002Fbadge.svg?version=0.4.5)](https:\u002F\u002Fdocs.rs\u002Fmacroquad\u002F0.4.5\u002Fmacroquad\u002Findex.html)\n[![Crates.io version](https:\u002F\u002Fimg.shields.io\u002Fcrates\u002Fv\u002Fmacroquad.svg)](https:\u002F\u002Fcrates.io\u002Fcrates\u002Fmacroquad)\n[![Discord chat](https:\u002F\u002Fimg.shields.io\u002Fdiscord\u002F710177966440579103.svg?label=discord%20chat)](https:\u002F\u002Fdiscord.gg\u002FWfEp6ut)\n\n`macroquad` is a simple and easy to use game library for Rust programming language, heavily inspired by [raylib](https:\u002F\u002Fgithub.com\u002Fraysan5\u002Fraylib).\n\n## Features\n\n* Same code for all supported platforms, no platform dependent defines required.\n* Efficient 2D rendering with automatic geometry batching.\n* Minimal amount of dependencies: build after `cargo clean` takes only 16s on x230(~6 years old laptop).\n* Immediate mode UI library included.\n* Single command deploy for both WASM and Android.\n\n## Supported Platforms\n\n* PC: Windows\u002FLinux\u002FmacOS;\n* HTML5;\n* Android;\n* IOS.\n\n## Build Instructions\n\n### Setting Up a Macroquad Project\n\nMacroquad is a normal rust dependency, therefore an empty macroquad project may be created with:\n\n```sh\n# Create empty cargo project\ncargo init --bin\n```\n\nAdd macroquad as a dependency to Cargo.toml:\n```toml\n\n[dependencies]\nmacroquad = \"0.4\"\n```\n\nPut some macroquad code in `src\u002Fmain.rs`:\n```rust\nuse macroquad::prelude::*;\n\n#[macroquad::main(\"BasicShapes\")]\nasync fn main() {\n    loop {\n        clear_background(RED);\n\n        draw_line(40.0, 40.0, 100.0, 200.0, 15.0, BLUE);\n        draw_rectangle(screen_width() \u002F 2.0 - 60.0, 100.0, 120.0, 60.0, GREEN);\n        draw_circle(screen_width() - 30.0, screen_height() - 30.0, 15.0, YELLOW);\n\n        draw_text(\"IT WORKS!\", 20.0, 20.0, 30.0, DARKGRAY);\n\n        next_frame().await\n    }\n}\n```\n\nAnd to run it natively:\n```sh\ncargo run\n```\n\nFor more examples take a look at [Macroquad examples folder](https:\u002F\u002Fgithub.com\u002Fnot-fl3\u002Fmacroquad\u002Ftree\u002Fmaster\u002Fexamples)\n\n### Linux\n\n```sh\n# ubuntu system dependencies\napt install pkg-config libx11-dev libxi-dev libgl1-mesa-dev libasound2-dev\n\n# fedora system dependencies\ndnf install libX11-devel libXi-devel mesa-libGL-devel alsa-lib-devel\n\n# arch linux system dependencies\npacman -S pkg-config libx11 libxi mesa-libgl alsa-lib\n```\n\n### Windows\n\nOn windows both MSVC and GNU target are supported, no additional dependencies required.\n\nAlso cross-compilation to windows from linux is supported:\n\n```sh\nrustup target add x86_64-pc-windows-gnu\n\ncargo run --target x86_64-pc-windows-gnu\n```\n\n### WASM\n\n```sh\nrustup target add wasm32-unknown-unknown\ncargo build --target wasm32-unknown-unknown\n```\n\nThis will produce .wasm file in `target\u002Fwasm32-unknown-unknown\u002Fdebug\u002FCRATENAME.wasm` or in `target\u002Fwasm32-unknown-unknown\u002Frelease\u002FCRATENAME.wasm` if built with `--release`.\n\nAnd then use the following .html to load it:\n\n\u003Cdetails>\u003Csummary>index.html\u003C\u002Fsummary>\n\n```html\n\u003Chtml lang=\"en\">\n\n\u003Chead>\n    \u003Cmeta charset=\"utf-8\">\n    \u003Ctitle>TITLE\u003C\u002Ftitle>\n    \u003Cstyle>\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\u002Fstyle>\n\u003C\u002Fhead>\n\n\u003Cbody>\n    \u003Ccanvas id=\"glcanvas\" tabindex='1'>\u003C\u002Fcanvas>\n    \u003C!-- Minified and statically hosted version of https:\u002F\u002Fgithub.com\u002Fnot-fl3\u002Fmacroquad\u002Fblob\u002Fmaster\u002Fjs\u002Fmq_js_bundle.js -->\n    \u003Cscript src=\"https:\u002F\u002Fnot-fl3.github.io\u002Fminiquad-samples\u002Fmq_js_bundle.js\">\u003C\u002Fscript>\n    \u003Cscript>load(\"CRATENAME.wasm\");\u003C\u002Fscript> \u003C!-- Your compiled wasm file -->\n\u003C\u002Fbody>\n\n\u003C\u002Fhtml>\n```\n\u003C\u002Fdetails>\n\nOne of the ways to server static .wasm and .html:\n\n```sh\ncargo install basic-http-server\nbasic-http-server .\n```\n\n### IOS\n\nTo run on the simulator:\n\n```sh\nmkdir MyGame.app\ncargo build --target x86_64-apple-ios --release\ncp target\u002Fx86_64-apple-ios\u002Frelease\u002Fmygame MyGame.app\n# only if the game have any assets\ncp -r assets MyGame.app\ncat > MyGame.app\u002FInfo.plist \u003C\u003C EOF\n\u003C?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\u003C!DOCTYPE plist PUBLIC \"-\u002F\u002FApple\u002F\u002FDTD PLIST 1.0\u002F\u002FEN\" \"http:\u002F\u002Fwww.apple.com\u002FDTDs\u002FPropertyList-1.0.dtd\">\n\u003Cplist version=\"1.0\">\n\u003Cdict>\n\u003Ckey>CFBundleExecutable\u003C\u002Fkey>\n\u003Cstring>mygame\u003C\u002Fstring>\n\u003Ckey>CFBundleIdentifier\u003C\u002Fkey>\n\u003Cstring>com.mygame\u003C\u002Fstring>\n\u003Ckey>CFBundleName\u003C\u002Fkey>\n\u003Cstring>mygame\u003C\u002Fstring>\n\u003Ckey>CFBundleVersion\u003C\u002Fkey>\n\u003Cstring>1\u003C\u002Fstring>\n\u003Ckey>CFBundleShortVersionString\u003C\u002Fkey>\n\u003Cstring>1.0\u003C\u002Fstring>\n\u003C\u002Fdict>\n\u003C\u002Fplist>\nEOF\n\nxcrun simctl install booted MyGame.app\u002F\nxcrun simctl launch booted com.mygame\n```\n\nFor details and instructions on provisioning for real iphone, check [https:\u002F\u002Fmacroquad.rs\u002Farticles\u002Fios\u002F](https:\u002F\u002Fmacroquad.rs\u002Farticles\u002Fios\u002F)\n\n\u003Cdetails>\n\u003Csummary>Tips\u003C\u002Fsummary>\nAdding the following snippet to your Cargo.toml ensures that all dependencies compile in release even in debug mode. In macroquad, this has the effect of making images load several times faster and your applications much more performant, while keeping compile times miraculously low.\n\n```toml\n[profile.dev.package.'*']\nopt-level = 3\n```\n\u003C\u002Fdetails>\n\n## async\u002Fawait\n\nWhile macroquad attempts to use as few Rust-specific concepts as possible, `.await` in all examples looks a bit scary.\nRust's `async\u002Fawait` is used to solve just one problem - cross platform main loop organization.\n\n\u003Cdetails>\n\u003Csummary>Details\u003C\u002Fsummary>\n\n\nThe problem: on WASM and android it's not really easy to organize the main loop like this:\n```rust\nfn main() {\n    \u002F\u002F do some initialization\n\n    \u002F\u002F start main loop\n    loop {\n        \u002F\u002F handle input\n\n        \u002F\u002F update logic\n\n        \u002F\u002F draw frame\n    }\n}\n```\n\nIt is fixable on Android with threads, but on web there is not way to \"pause\" and \"resume\" WASM execution, so no WASM code should block ever.\nWhile that loop is blocking for the entire game execution!\nThe C++ solution for that problem: https:\u002F\u002Fkripken.github.io\u002Fblog\u002Fwasm\u002F2019\u002F07\u002F16\u002Fasyncify.html\n\nBut in Rust we have async\u002Fawait. Rust's `futures` are basically continuations - `future`'s stack may be stored into a variable to pause\u002Fresume execution of future's code at a later point.\n\nasync\u002Fawait support in macroquad comes without any external dependencies - no runtime, no executors and futures-rs is not involved. It's just a way to preserve `main`'s stack on WASM and keep the code cross platform without any WASM-specific main loop.\n\u003C\u002FDetails>\n\n## Community\n\n- [Quads Discord server](https:\u002F\u002Fdiscord.gg\u002FWfEp6ut) - a place to chat with the library's devs and other community members.\n- [Awesome Quads](https:\u002F\u002Fgithub.com\u002Fozkriff\u002Fawesome-quads) - a curated list of links to miniquad\u002Fmacroquad-related code & resources.\n\n# Platinum sponsors\n\nMacroquad is supported by:\n\n[SourceGear](https:\u002F\u002Fwww.sourcegear.com\u002F)\n","macroquad 是一个用 Rust 编写的跨平台游戏引擎。它提供高效的 2D 渲染、自动几何批处理和即时模式 UI 库，支持 Windows、Linux、macOS、HTML5、Android 和 iOS 平台，且代码在所有平台上保持一致，无需平台特定的定义。项目依赖极少，构建速度快，适用于需要快速开发和部署 2D 游戏或图形应用的场景。无论是初学者还是有经验的开发者，都可以利用 macroquad 快速实现创意。",2,"2026-06-11 03:05:12","top_language"]