{"id":13892514,"url":"https://github.com/Interrupt/delve-framework","last_synced_at":"2025-07-17T05:31:54.075Z","repository":{"id":213895732,"uuid":"735203134","full_name":"Interrupt/delve-framework","owner":"Interrupt","description":"Delve is a framework for writing Games in Zig and Lua. For those who value being cross platform and keeping things simple.","archived":false,"fork":false,"pushed_at":"2024-11-24T09:15:55.000Z","size":16031,"stargazers_count":208,"open_issues_count":7,"forks_count":11,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-11-24T10:20:06.846Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Zig","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/Interrupt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":"ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-24T03:22:40.000Z","updated_at":"2024-11-24T09:15:55.000Z","dependencies_parsed_at":"2024-08-13T07:31:22.773Z","dependency_job_id":"7dc280fe-bb6c-4170-a5d6-dc67adb95c21","html_url":"https://github.com/Interrupt/delve-framework","commit_stats":null,"previous_names":["interrupt/delve-framework"],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Interrupt%2Fdelve-framework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Interrupt%2Fdelve-framework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Interrupt%2Fdelve-framework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Interrupt%2Fdelve-framework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Interrupt","download_url":"https://codeload.github.com/Interrupt/delve-framework/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226225988,"owners_count":17592300,"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-06T17:01:00.354Z","updated_at":"2024-11-24T20:30:49.663Z","avatar_url":"https://github.com/Interrupt.png","language":"Zig","funding_links":[],"categories":["Zig"],"sub_categories":[],"readme":"# Delve Framework\n\nDelve is a simple framework for building games written in Zig using Lua for scripting. Currently updated to `Zig 0.13.0`\n\n*This is in early development and the api is still coming together, so be warned!*\n\nSome examples compiled for web can be seen at https://interrupt.github.io/delve-framework-web-examples\n\n\u003cp align=\"center\"\u003e\n\u003cimg width=\"1072\" alt=\"Screen Shot 2024-01-27 at 12 02 33 AM\" src=\"https://github.com/Interrupt/delve-framework/assets/1374/45b64806-7829-4542-80d5-5a892eebf80d\"\u003e\n\u003c/p\u003e\n\n## Design Philosphy\n\nDelve uses Zig to make writing cross platform games easy, and because it is easy to interop with the vast library of existing C/C++ game development libraries. Its main goal is to be as cross platform and unopinionated as much as possible, making it easy to switch out implementations as needed. Being simple and understandable is better than being clever!\n\n* Built in console support - bring up with the '~' key!\n* Prototyping should be quick - included utilities to load Quake .map files!\n* Lots of examples!\n\n## Libraries Used\n\n* Sokol for cross platform graphics and input\n* Lua for scripting using ziglua\n* stb_image for loading images\n* stb_truetype for font loading and rendering\n* zaudio and zmesh from zig-gamedev\n* Dear Imgui for UI\n\n## Scripting\n\nThe scripting manager can generate bindings for Lua automatically by reflecting on a zig file. Example:\n\n```\n// Find all public functions in `api/graphics.zig` and make them available to Lua under the module name `graphics`\nbindZigLibrary(\"graphics\", @import(\"api/graphics.zig\"));\n```\n\nDelve will use the `assets/main.lua` Lua file for scripting unless given a new path on the command line during startup.\n\n## 2D and 3D rendering\n\nRendering uses the Sokol framework to use modern, cross platform graphics APIs. Supports DirectX 11, OpenGL 3/ES, Metal, and [WebGPU](WebGPU).\n\nhttps://github.com/user-attachments/assets/ea26efe1-d9b9-4714-bc18-30fe5bc850da\n\n## Modules, all the way down\n\nIn the Delve framework most everything is a module, so that applications can use just the functionality they want as well as extending the framework as needed. As an example, the scripting layer is a module that registers other modules.\n\nAdditional Zig code can be registered as a Module to run during the game lifecycle:\n\n```\nconst exampleModule = modules.Module {\n    .name = \"example-module\",\n    .init_fn = my_on_init,\n    .tick_fn = my_on_tick,\n    .draw_fn = my_on_draw,\n    .cleanup_fn = my_on_cleanup,\n};\n\ntry modules.registerModule(exampleModule);\n```\n\nSome example modules are included automatically to exercise some code paths, these live under `src/examples` and are good examples of how to start using the framework.\n\n* [Sprite Animation Example](src/examples/sprite-animation.zig)\n* [Mesh Drawing Example](src/examples/meshes.zig)\n* [Debug Drawing Example](src/examples/debugdraw.zig)\n\n## Building the examples\n\n- Add dependency repository link\n\n`build.zig.zon`\n```\n.{\n    .name = \"my_project\",\n    .version = \"0.0.1\",\n    .dependencies = .{\n        .delve = .{\n            .url = \"git+https://github.com/Interrupt/delve-framework/tree/0.12.x.git#___COMMIT_HASH___\",\n            // add compilers suggested line about .hash\n        },\n    },\n}\n```\n- Link dependency module\n`build.zig`\n```\n    const delve = b.dependency(\"delve\", .{\n        .target = target,\n        .optimize = optimize,\n    });\n    exe.root_module.addImport(\"delve\", delve.module(\"delve\"));\n```\n\n- Just build\n```java\nzig build run\n```\n\n### Build and run examples\n```\nzig build run-audio\nzig build run-clear\nzig build run-collision\nzig build run-debugdraw\nzig build run-easing\nzig build run-fonts\nzig build run-forest\nzig build run-framepacing\nzig build run-imgui\nzig build run-lighting\nzig build run-lua\nzig build run-meshbuilder\nzig build run-meshes\nzig build run-passes\nzig build run-quakemap\nzig build run-rays\nzig build run-skinned-meshes\nzig build run-sprite-animation\nzig build run-sprites\nzig build run-stresstest\n```\n\n### Set optimization\n\n```java\nzig build --release=fast run-forest\nzig build --release=small run-forest\n```\n\n### Building for web\nTo build for web, use the `-Dtarget=wasm32-emscripten` build argument.\n\nBuilding with optmizations is also required in some cases when the Javascript being built is large, that can be rectified with `--release=small`\n\n```java\nzig build run-clear --release=small -Dtarget=wasm32-emscripten\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FInterrupt%2Fdelve-framework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FInterrupt%2Fdelve-framework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FInterrupt%2Fdelve-framework/lists"}