{"id":13682628,"url":"https://github.com/hecrj/coffee","last_synced_at":"2025-05-15T01:04:25.110Z","repository":{"id":41142613,"uuid":"179140142","full_name":"hecrj/coffee","owner":"hecrj","description":"An opinionated 2D game engine for Rust","archived":false,"fork":false,"pushed_at":"2024-03-03T11:30:40.000Z","size":1442,"stargazers_count":1111,"open_issues_count":45,"forks_count":55,"subscribers_count":28,"default_branch":"master","last_synced_at":"2025-04-06T17:09:38.140Z","etag":null,"topics":["2d-game-engine","engine","game","game-development","game-engine","gamedev","rust"],"latest_commit_sha":null,"homepage":"https://docs.rs/coffee","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hecrj.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","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},"funding":{"ko_fi":"hecrj_"}},"created_at":"2019-04-02T18:55:55.000Z","updated_at":"2025-04-03T05:34:28.000Z","dependencies_parsed_at":"2024-08-02T13:22:29.927Z","dependency_job_id":"406e91fa-8ff2-44a1-89b7-68fc6ca2780e","html_url":"https://github.com/hecrj/coffee","commit_stats":{"total_commits":369,"total_committers":17,"mean_commits":"21.705882352941178","dds":0.1842818428184282,"last_synced_commit":"5bb04cf8483188582a2adb8c36567242af86f49d"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hecrj%2Fcoffee","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hecrj%2Fcoffee/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hecrj%2Fcoffee/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hecrj%2Fcoffee/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hecrj","download_url":"https://codeload.github.com/hecrj/coffee/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248784866,"owners_count":21161188,"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":["2d-game-engine","engine","game","game-development","game-engine","gamedev","rust"],"created_at":"2024-08-02T13:01:50.026Z","updated_at":"2025-04-13T21:28:49.459Z","avatar_url":"https://github.com/hecrj.png","language":"Rust","funding_links":["https://ko-fi.com/hecrj_"],"categories":["Rust"],"sub_categories":[],"readme":"# Coffee\n\n[![Integration status](https://github.com/hecrj/coffee/workflows/Integration/badge.svg)](https://github.com/hecrj/coffee/actions)\n[![Documentation](https://docs.rs/coffee/badge.svg)](https://docs.rs/coffee)\n[![Crates.io](https://img.shields.io/crates/v/coffee.svg)](https://crates.io/crates/coffee)\n[![License](https://img.shields.io/crates/l/coffee.svg)](https://github.com/hecrj/coffee/blob/master/LICENSE)\n[![Gitter chat](https://badges.gitter.im/hecrj/coffee.png)](https://gitter.im/hecrj/coffee)\n\nAn opinionated 2D game engine for Rust focused on simplicity, explicitness, and type-safety.\n\n__Coffee is in a very early stage of development.__ Many [basic features are still missing], some [dependencies are experimental], and there are probably _many_ bugs. [Feel free to contribute!]\n\n[basic features are still missing]: https://github.com/hecrj/coffee/issues?q=is%3Aissue+is%3Aopen+label%3Afeature\n[dependencies are experimental]: #implementation-details\n[Feel free to contribute!]: #contributing--feedback\n\n## Features\n  * [Responsive, customizable GUI]\n  * Declarative, type-safe loading screens with progress tracking\n  * Built-in [debug view with performance metrics]\n  * Fixed, deterministic timestep\n  * Explicit, easy to use, hardware-accelerated 2D graphics API\n  * Multiplatform support leveraging OpenGL, Vulkan, Metal, D3D11, and D3D12\n  * [Explicit and efficient batched draws]\n  * [Mesh support]\n  * Texture array support\n  * Off-screen rendering\n  * TrueType font rendering\n  * Gamepad support\n\nAnd more! Check out the [examples] to see them in action.\n\n[Responsive, customizable GUI]: https://gfycat.com/gloomyweakhammerheadshark\n[debug view with performance metrics]: https://github.com/hecrj/coffee/blob/master/images/debug.png\n[Explicit and efficient batched draws]: https://gfycat.com/beautifulseparatebeetle\n[Mesh support]: https://gfycat.com/academicglossykingfisher\n\n## Usage\nAdd `coffee` as a dependency in your `Cargo.toml` and enable a graphics backend\nfeature (`opengl`, `vulkan`, `metal`, `dx11`, or `dx12`):\n\n```toml\ncoffee = { version = \"0.4\", features = [\"opengl\"] }\n```\n\nRust is quite slow in debug mode. If you experience performance issues when\ndrawing hundreds of sprites, enable compiler optimizations in your `Cargo.toml`.\nI recommend level 2 optimizations in order to stay closer to `--release`\nperformance:\n\n```toml\n[profile.dev]\nopt-level = 2\n```\n\n__Coffee moves fast and the `master` branch can contain breaking changes!__ If\nyou want to learn about a specific release, check out [the release list].\n\n[the release list]: https://github.com/hecrj/coffee/releases\n\n## Overview\nHere is a minimal example that will open a window:\n\n```rust\nuse coffee::graphics::{Color, Frame, Window, WindowSettings};\nuse coffee::load::Task;\nuse coffee::{Game, Result, Timer};\n\nfn main() -\u003e Result\u003c()\u003e {\n    MyGame::run(WindowSettings {\n        title: String::from(\"A caffeinated game\"),\n        size: (1280, 1024),\n        resizable: true,\n        fullscreen: false,\n        maximized: false,\n    })\n}\n\nstruct MyGame {\n    // Your game state and assets go here...\n}\n\nimpl Game for MyGame {\n    type Input = (); // No input data\n    type LoadingScreen = (); // No loading screen\n\n    fn load(_window: \u0026Window) -\u003e Task\u003cMyGame\u003e {\n        // Load your game assets here. Check out the `load` module!\n        Task::succeed(|| MyGame { /* ... */ })\n    }\n\n    fn draw(\u0026mut self, frame: \u0026mut Frame, _timer: \u0026Timer) {\n        // Clear the current frame\n        frame.clear(Color::BLACK);\n\n        // Draw your game here. Check out the `graphics` module!\n    }\n}\n```\n\nBrowse the [documentation] and the [examples] to learn more!\n\n[documentation]: https://docs.rs/coffee\n[examples]: https://github.com/hecrj/coffee/tree/master/examples\n\n## Implementation details\nCoffee builds upon\n\n  * [`winit`] for windowing and mouse/keyboard events.\n  * [`gfx` pre-ll] for OpenGL support, based heavily on the [`ggez`] codebase.\n  * [`wgpu`] for _experimental_ Vulkan, Metal, D3D11 and D3D12 support.\n  * [`stretch`] for responsive GUI layouting based on Flexbox.\n  * [`glyph_brush`] for TrueType font rendering.\n  * [`gilrs`] for gamepad support.\n  * [`nalgebra`] for the `Point`, `Vector`, and `Transformation` types.\n  * [`image`] for image loading and texture array building.\n\n[`winit`]: https://github.com/rust-windowing/winit\n[`gfx` pre-ll]: https://github.com/gfx-rs/gfx/tree/pre-ll\n[`wgpu`]: https://github.com/gfx-rs/wgpu\n[`stretch`]: https://github.com/vislyhq/stretch\n[`glyph_brush`]: https://github.com/alexheretic/glyph-brush/tree/master/glyph-brush\n[`gilrs`]: https://gitlab.com/gilrs-project/gilrs\n[`nalgebra`]: https://github.com/rustsim/nalgebra\n[`image`]: https://github.com/image-rs/image\n\n## Contributing / Feedback\nI am quite new to Rust, systems programming, and computer graphics. I am\nlearning along the way as I build the engine for a game I am currently\ndeveloping. I am always glad to to learn from anyone.\n\nIf you want to contribute, you are more than welcome to be a part of the\nproject! Check out the current [issues] if you want to find something to work\non. Try to share you thoughts first! Feel free to open a new issue if you want\nto discuss new ideas.\n\nAny kind of feedback is welcome! You can open an issue or, if you want to talk,\nyou can find me (and a bunch of awesome folks) over the `#games-and-graphics`\nchannel in the [Rust Community Discord]. I go by `@lone_scientist` there.\n\n[issues]: https://github.com/hecrj/coffee/issues\n[Rust Community Discord]: https://bit.ly/rust-community\n\n## Credits / Thank you\n  * [`ggez`], an awesome, easy-to-use, good game engine that introduced me to\n    Rust. Its graphics implementation served me as a guide to implement OpenGL\n    support for Coffee.\n  * [Kenney], creators of amazing free game assets with no strings attached. The\n    built-in GUI renderer in Coffee uses a modified version of their UI sprites.\n\n[`ggez`]: https://github.com/ggez/ggez\n[Kenney]: https://kenney.nl\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhecrj%2Fcoffee","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhecrj%2Fcoffee","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhecrj%2Fcoffee/lists"}