{"id":13741442,"url":"https://github.com/jack-ji/zplay","last_synced_at":"2025-05-08T21:33:59.933Z","repository":{"id":46144453,"uuid":"491092423","full_name":"Jack-Ji/zplay","owner":"Jack-Ji","description":"A simple framework intended for game/tool creation.","archived":true,"fork":false,"pushed_at":"2023-01-07T07:29:47.000Z","size":3973,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-08-03T04:08:00.678Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","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/Jack-Ji.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}},"created_at":"2022-05-11T12:02:42.000Z","updated_at":"2024-01-14T05:18:48.000Z","dependencies_parsed_at":"2023-02-06T14:46:06.959Z","dependency_job_id":null,"html_url":"https://github.com/Jack-Ji/zplay","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/Jack-Ji%2Fzplay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jack-Ji%2Fzplay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jack-Ji%2Fzplay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jack-Ji%2Fzplay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jack-Ji","download_url":"https://codeload.github.com/Jack-Ji/zplay/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224774815,"owners_count":17367797,"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-03T04:00:59.246Z","updated_at":"2024-11-15T11:31:18.659Z","avatar_url":"https://github.com/Jack-Ji.png","language":"C","funding_links":[],"categories":["Libraries"],"sub_categories":[],"readme":"# zplay\nA simple framework intended for game/tool creation.\n\n## Features\n* Little external dependency, only SDL2 and OpenGL3/GLES3\n* Support PC platforms: windows/linux (possibly macOS, don't know for sure)\n* Flexible render-passes pipeline, greatly simplify rendering code\n* Graphics oriented math library: Vec2/Vec3/Mat4/Quaternion ([zalgebra](https://github.com/kooparse/zalgebra))\n* Vector graphics drawing ([nanovg](https://github.com/memononen/nanovg))\n* Immediate mode GUI toolkits ([dear-imgui](https://github.com/ocornut/imgui))\n* Realtime data visualization ([ImPlot](https://github.com/epezent/implot))\n* TrueType font loading and rendering\n* Image picture loading/decoding/writing (support png/jpg/bmp/tga)\n* Audio playback (support wav/flac/mp3/vorbis)\n* 2D toolkits:\n  * Camera component\n  * Sprite and SpriteBatch system\n  * Texture packer used to programmatically create sprite-sheet\n  * Particle system\n  * Chipmunk physics lib integration\n* 3D toolkits:\n  * Camera component\n  * Model loading and rendering (only glTF 2.0 for now)\n  * Blinn-Phong renderer (directional/point/spot light)\n  * Environment mapping renderer\n  * Skybox renderer\n  * Bullet3 physics lib integration (credit to [zig-gamedev](https://github.com/michal-z/zig-gamedev))\n\n## Getting started\nCopy `zplay` folder or clone repo (recursively) into `libs` subdirectory of the root of your project.\n\nInstall SDL2 library, please refer to [docs of SDL2.zig](https://github.com/MasterQ32/SDL.zig)\n\nThen in your `build.zig` add:\n\n```zig\nconst std = @import(\"std\");\nconst zplay = @import(\"libs/zplay/build.zig\");\n\npub fn build(b: *std.build.Builder) void {\n    const exe = b.addExecutable(\"your_bin\", \"src/main.zig\");\n\n    exe.setBuildMode(b.standardReleaseOptions());\n    exe.setTarget(b.standardTargetOptions(.{}));\n    exe.install();\n\n    zplay.link(exe, .{\n      // choose graphics api (gl33/gles3)\n      // link optional modules (imgui/nanovg etc)\n    });\n\n    const run_cmd = exe.run();\n    run_cmd.step.dependOn(b.getInstallStep());\n\n    const run_step = b.step(\"run\", \"Run the app\");\n    run_step.dependOn(\u0026run_cmd.step);\n}\n```\n\nNow in your code you may import and use zplay:\n\n```zig\nconst std = @import(\"std\");\nconst zp = @import(\"zplay\");\n\nfn init(ctx: *zp.Context) anyerror!void {\n    _ = ctx;\n    std.log.info(\"game init\", .{});\n\n    // your init code\n}\n\nfn loop(ctx: *zp.Context) anyerror!void {\n    while (ctx.pollEvent()) |e| {\n        switch (e) {\n            .quit_event =\u003e ctx.kill(),\n            else =\u003e {},\n        }\n    }\n\n    // your game loop\n}\n\nfn quit(ctx: *zp.Context) void {\n    _ = ctx;\n    std.log.info(\"game quit\", .{});\n\n    // your deinit code\n}\n\npub fn main() anyerror!void {\n    try zp.run(.{\n        .initFn = init,\n        .loopFn = loop,\n        .quitFn = quit,\n    });\n}\n```\n\n## Third-Party Libraries\n* [SDL2](https://www.libsdl.org) (zlib license)\n* [glad-generated OpenGL3 loader](https://glad.dav1d.de) (Apache Version 2.0 license)\n* [zalgebra](https://github.com/kooparse/zalgebra) (MIT license)\n* [miniaudio](https://miniaud.io/index.html) (MIT license)\n* [cgltf](https://github.com/jkuhlmann/cgltf) (MIT license)\n* [stb headers](https://github.com/nothings/stb) (MIT license)\n* [dear-imgui](https://github.com/ocornut/imgui) (MIT license)\n* [ImPlot](https://github.com/epezent/implot) (MIT license)\n* [imnodes](https://github.com/Nelarius/imnodes) (MIT license)\n* [nanovg](https://github.com/memononen/nanovg) (zlib license)\n* [nanosvg](https://github.com/memononen/nanosvg) (zlib license)\n* [bullet3](https://github.com/bulletphysics/bullet3) (zlib license)\n* [chipmunk](https://chipmunk-physics.net/) (MIT license)\n* [nativefiledialog](https://github.com/mlabbe/nativefiledialog) (zlib license)\n* [known-folders](https://github.com/ziglibs/known-folders) (MIT license)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjack-ji%2Fzplay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjack-ji%2Fzplay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjack-ji%2Fzplay/lists"}