{"id":16759987,"url":"https://github.com/shockham/caper","last_synced_at":"2025-03-03T03:06:44.606Z","repository":{"id":29938132,"uuid":"33484423","full_name":"shockham/caper","owner":"shockham","description":"Minimalist game framework","archived":false,"fork":false,"pushed_at":"2021-01-14T12:32:52.000Z","size":2282,"stargazers_count":102,"open_issues_count":1,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-24T02:08:20.137Z","etag":null,"topics":["game-dev","game-frameworks","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shockham.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-06T13:52:24.000Z","updated_at":"2025-02-20T00:09:10.000Z","dependencies_parsed_at":"2022-09-19T02:40:21.816Z","dependency_job_id":null,"html_url":"https://github.com/shockham/caper","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shockham%2Fcaper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shockham%2Fcaper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shockham%2Fcaper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shockham%2Fcaper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shockham","download_url":"https://codeload.github.com/shockham/caper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241600483,"owners_count":19988713,"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":["game-dev","game-frameworks","rust"],"created_at":"2024-10-13T04:09:28.549Z","updated_at":"2025-03-03T03:06:44.567Z","avatar_url":"https://github.com/shockham.png","language":"Rust","readme":"# Caper\n[![crates.io version](https://img.shields.io/crates/v/caper.svg)](https://crates.io/crates/caper)\n[![Build status](https://travis-ci.org/shockham/caper.svg?branch=master)](https://travis-ci.org/shockham/caper)\n[![Documentation](https://docs.rs/caper/badge.svg)](https://docs.rs/caper)\n\nMinimalist game framework using [rust](https://www.rust-lang.org/).\nCurrently has systems for:\n- Rendering ([glium](https://github.com/tomaka/glium))\n- Input ([winit](https://github.com/tomaka/winit) via [volition](https://github.com/shockham/volition))\n- Physics ([nphysics](https://github.com/sebcrozet/nphysics))\n- Audio ([rodio](https://github.com/tomaka/rodio) via [impose](https://github.com/shockham/impose))\n\n[**Documentation**](https://docs.rs/caper)\n\n## Setup\n### Linux\nDue to the crate alsa-sys being use for linux the following packages are required:\n#### Debian/Ubuntu etc\n`apt install libasound2-dev pkg-config`\n#### Fedora/RHEL/CentOS\n`dnf install alsa-lib-devel`\n\n## Usage\n[Example](https://github.com/shockham/caper/blob/master/examples/simple.rs) of a basis for a game:\n```rust\nextern crate caper;\n\nuse caper::game::*;\nuse caper::imgui::Ui;\nuse caper::input::Key;\nuse caper::mesh::gen_cube;\nuse caper::types::{DefaultTag, RenderItemBuilder, TransformBuilder};\nuse caper::utils::handle_fp_inputs;\n\nfn main() {\n    // crate an instance of the game struct\n    let (mut game, event_loop) = Game::\u003cDefaultTag\u003e::new();\n\n    // define some items to be rendered\n    game.add_render_item(\n        RenderItemBuilder::default()\n            .vertices(gen_cube())\n            .instance_transforms(vec![TransformBuilder::default()\n                .pos((-0.5, 0.0, -5.0))\n                .build()\n                .unwrap()])\n            .build()\n            .unwrap(),\n    );\n\n    // run the engine update\n    start_loop(event_loop, move |events| {\n        game.update(\n            |_: \u0026Ui| {},\n            |g: \u0026mut Game\u003cDefaultTag\u003e| -\u003e UpdateStatus {\n                // update the first person inputs\n                handle_fp_inputs(\u0026mut g.input, \u0026mut g.cams[0]);\n\n                // quit\n                if g.input.keys_down.contains(\u0026Key::Escape) {\n                    return UpdateStatus::Finish;\n                }\n\n                UpdateStatus::Continue\n            },\n            events,\n        )\n    });\n}\n```\n\nCheck out the [examples](https://github.com/shockham/caper/tree/master/examples) and run with:\n```\ncargo run --example transforms\n```\n\n[License](https://github.com/shockham/caper/blob/master/LICENSE.md)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshockham%2Fcaper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshockham%2Fcaper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshockham%2Fcaper/lists"}