{"id":21388723,"url":"https://github.com/jmatth11/hotreload-c","last_synced_at":"2026-06-30T18:32:28.099Z","repository":{"id":250083646,"uuid":"833426665","full_name":"jmatth11/hotreload-C","owner":"jmatth11","description":"Simple setup to hotreload a C project. Setup is in SDL2.","archived":false,"fork":false,"pushed_at":"2024-07-25T03:27:56.000Z","size":33,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-30T06:42:18.863Z","etag":null,"topics":["c","hotreload","sdl2","shared-library"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jmatth11.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":"2024-07-25T03:16:25.000Z","updated_at":"2025-08-17T18:22:57.000Z","dependencies_parsed_at":"2024-07-25T04:29:09.172Z","dependency_job_id":"626397bc-b50e-423c-abec-f96db36470ed","html_url":"https://github.com/jmatth11/hotreload-C","commit_stats":null,"previous_names":["jmatth11/hotreload-c"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jmatth11/hotreload-C","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmatth11%2Fhotreload-C","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmatth11%2Fhotreload-C/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmatth11%2Fhotreload-C/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmatth11%2Fhotreload-C/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jmatth11","download_url":"https://codeload.github.com/jmatth11/hotreload-C/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmatth11%2Fhotreload-C/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34979577,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-30T02:00:05.919Z","response_time":92,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["c","hotreload","sdl2","shared-library"],"created_at":"2024-11-22T12:19:21.097Z","updated_at":"2026-06-30T18:32:28.079Z","avatar_url":"https://github.com/jmatth11.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hot-Reloading in C\n\nThis is a simple project to demonstrate how you can have a hot-reloading project in C.\n\nI structure my program around SDL2 with a \"game\" concept, but the general idea should be transferrable.\n\n## Main Loop\n\nThe core portion of this project is located in `main.c` and `driver/command.[h|c]`.\nMain does general setup of SDL2 internals and handling the main loop.\nWe load in our shared library and have a simple even handler for the 'r' key to hotreload. (This should be able to be implmented in different ways, we use this for simplicity.)\n\n## Driver\n\nThe rest of our application is behind a \"driver\" file. Ours is located in `driver/driver.[h|c]`.\nThis is where we implement the expected functions defined in `driver/command.h` for our application.\n\nWe have a little setup at the beginning of most functions to handle if we are hotreloaded at any instance.\nTechnically with our setup it only needs to be in the `event` function (as this is the next function that is called after hotreloading) but with different setups it could be setup\nto hotreload at any instance.\n\n## Running this Project\n\nSteps to running this project:\n- Run `install_deps.sh` file.\n- Run `make` to build the project.\n- Run `./bin/hotreload` to run the executable.\n- Make a change in `objects/player.c` in the render function.\n- Run `make shared` to recompile the shared library.\n- In the main application press the 'r' key to hot reload and your changes should show.\n\n## Demo\n\nThe demo is slightly older before I cleaned up the project, so ignore the old executable name.\n\nhttps://github.com/user-attachments/assets/0ad69384-b061-440d-ac01-609439396c96\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmatth11%2Fhotreload-c","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjmatth11%2Fhotreload-c","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmatth11%2Fhotreload-c/lists"}