{"id":27693140,"url":"https://github.com/prcastro/zerogl","last_synced_at":"2025-04-25T12:54:01.809Z","repository":{"id":181304185,"uuid":"666550307","full_name":"prcastro/zeroGL","owner":"prcastro","description":"A zero-dependencies, single-header 3D graphics library","archived":false,"fork":false,"pushed_at":"2025-03-25T22:36:36.000Z","size":45482,"stargazers_count":26,"open_issues_count":14,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-25T23:29:20.761Z","etag":null,"topics":["3d","c","graphics","graphics-programming","nuklear","rendering","sdl2","single-header","software-rendering"],"latest_commit_sha":null,"homepage":"https://prcastro.github.io/zeroGL/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/prcastro.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":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-14T20:14:53.000Z","updated_at":"2025-03-16T19:19:15.000Z","dependencies_parsed_at":"2024-02-01T02:46:10.599Z","dependency_job_id":"28507685-1199-40f1-9eb0-7c2ad54a00af","html_url":"https://github.com/prcastro/zeroGL","commit_stats":null,"previous_names":["prcastro/simple-rasterizer"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prcastro%2FzeroGL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prcastro%2FzeroGL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prcastro%2FzeroGL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prcastro%2FzeroGL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prcastro","download_url":"https://codeload.github.com/prcastro/zeroGL/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250822406,"owners_count":21492902,"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":["3d","c","graphics","graphics-programming","nuklear","rendering","sdl2","single-header","software-rendering"],"created_at":"2025-04-25T12:54:00.312Z","updated_at":"2025-04-25T12:54:01.800Z","avatar_url":"https://github.com/prcastro.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# zeroGL\nA zero-dependencies, single-header 3D graphics library\n\n\u003cimg src=\"./docs/img/rasterizer.gif\" width=\"500\"\u003e\n\n## Features\n\n* Single-header library written in C with no external dependencies\n* Programmable shaders\n* Perspective-correct texture support\n* Point/Ambient/Directional lighting\n* Materials with specular and diffuse properties\n* Camera and backface culling\n* z-Buffering\n* Load OBJ/MTL files (in separate library)\n\n## Getting started\n\nTo use zeroGL in your project, download `zerogl.h` from the releases page and include it in your project. You can find the [documentation here](prcastro.github.io/zeroGL/). To run the demo, download the latest .zip file from the releases page, uncompress it and run.\n\n## Building the demo\n\nClone this repo with submodules:\n\n```console\n$ git clone --recurse-submodules https://github.com/prcastro/zeroGL.git\n```\n\nBefore starting, you need to decide whether you are going to use the vendored SDL3 version (in the `external/sdl3` directory) or if you're going to use the system SDL3 you've installed. The following instructions assume you're using the vendored SDL3 distribution. If you want to use the SDL system library, see the instructions [here](#using-a-system-SDL-library).\n\nIf you're not using CMake or Zig, you first need to [build SDL3](https://github.com/libsdl-org/SDL/blob/main/docs/README-cmake.md) from the `external/sdl3` directory. If you're using CMake, the `external/sdl3` will build automatically. If you're using Zig as the build system, we're using [castholm/SDL](https://github.com/castholm/SDL) as the SDL dependency, as it provides SDL integration with Zig's build system, so you don't even need to download the `external/sdl3` git submodule.\n\n\n### Windows\n\n#### CMake\nInstall Visual Studio Community 2022 (the C/C++ compilers may suffice) and CMake. This is the only option that doesn't require you to pre-build SDL3 before starting. Then, from the command-line run:\n\n```console\n\u003e cmake -B build/ -G \"Visual Studio 17 2022\"\n\n\u003e cmake --build build/ --config Release\n```\n\nThe binary will be written to build/Release/main.exe\n\n#### Zig\n\nTo run the demo, just [install zig](https://ziglang.org/learn/getting-started/#installing-zig) (it's basically downloading a binary and adding it to your path) and then run:\n\n```console\n\u003e zig build run --release=fast\n```\n\n#### build.bat\nInstall Visual Studio Community 2022 (the C/C++ compilers may suffice) and then double-click the `build.bat` file. Alternatively, from the command-line run:\n\n```console\n\u003e build.bat\n```\n\nThe binary will be written to build/main.exe\n\n\n#### Using cl.exe\nInstall Visual Studio Community 2022 (the C/C++ compilers may suffice), then run:\n\n```console\n\u003e \"c:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Auxiliary\\Build\\vcvarsall.bat\" x86_amd64\n\n\u003e cl.exe /Zi /EHsc /O2 /nologo /Fobuild\\obj\\ /Febuild\\main.exe main.c /I external\\sdl3\\include /link /LIBPATH:external\\sdl3\\build\\RelWithDebInfo SDL3.lib\n\n\u003e copy external\\sdl3\\build\\RelWithDebInfo\\SDL3.dll build\\SDL3.dll\n```\n\nChange the `vcvarsall.bat` path according to your VS installation. The binary will be written to build/Release/main.exe.\n\n#### VS Code\nIf you're using Visual Studio Code, then you can install Visual Studio Community 2022 (the C/C++ compilers may suffice) and CMake. Also install the C/C++ extensions from Microsoft and the CMake Tools extension as well.\n\nOpen `main.c` on the editor and then click on ▶ on status bar at the bottom.\n\n### Linux\n\n#### GCC\n\nOn Linux sytems where SDL3 is installed, the exemple main program can also be built by running (again, ):\n\n```console\ngcc main.c -I./external/sdl3/include -Lexternal/sdl3/build/RelWithDebInfo -lSDL3 -lm -o build/main\n```\n\n#### Zig\n\n```console\n$ zig build run --release=fast\n```\n\n### macOS\n\n#### Zig\n\nTo run the demo, just [install zig](https://ziglang.org/learn/getting-started/#installing-zig) (it's basically downloading a binary and adding it to your path) and then run:\n\n```console\n$ zig build run --release=fast\n```\n\n### Using a system SDL library\n\nIf you want to use the SDL library installed in your system, make sure you have version v3.2.8 (using `apt` or `brew`) and find the installed libraries. On every instruction, you can replace:\n\n* Library path: `external/sdl3/build/RelWithDebInfo` with `usr/include/SDL3` (or wherever you have the SDL3 headers installed)\n* Include path: `external/sdl3/include` with `usr/local/lib` (or wherever you have the SDL3 libraries installed)\n\nIf you're using CMake, simply set the `USE_VENDORED_SDL3` to `OFF` during the configure step:\n\n```console\n\u003e cmake -DUSE_VENDORED_SDL3=OFF -B build/ -G \"Visual Studio 17 2022\"\n```\n\n## Current limitations\n\n* No alpha compositing\n* No multi-threading/SIMD\n* Support only a subset of the OBJ specification\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprcastro%2Fzerogl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprcastro%2Fzerogl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprcastro%2Fzerogl/lists"}