{"id":24651546,"url":"https://github.com/grahamchill/sdl2-template","last_synced_at":"2026-04-15T18:02:30.720Z","repository":{"id":270596130,"uuid":"910612267","full_name":"GrahamCHill/SDL2-Template","owner":"GrahamCHill","description":"A simple cross-platform template using  Dear ImGui, SDL, and Tiny File Dialog","archived":false,"fork":false,"pushed_at":"2025-01-17T09:43:06.000Z","size":9782,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-25T19:12:16.787Z","etag":null,"topics":["app-development","cmake","cpp","dear-imgui","macos","metal","opengl","sdl","vulkan","windows"],"latest_commit_sha":null,"homepage":"","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/GrahamCHill.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-12-31T20:12:01.000Z","updated_at":"2025-01-17T09:43:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"cc8f3834-3e66-4990-a41d-81a61f94dc0b","html_url":"https://github.com/GrahamCHill/SDL2-Template","commit_stats":null,"previous_names":["grahamchill/sdl3-vulkan-dearimgui-template","grahamchill/sdl-dearimgui-template","grahamchill/sdl2-template"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrahamCHill%2FSDL2-Template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrahamCHill%2FSDL2-Template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrahamCHill%2FSDL2-Template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrahamCHill%2FSDL2-Template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GrahamCHill","download_url":"https://codeload.github.com/GrahamCHill/SDL2-Template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244702048,"owners_count":20495815,"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":["app-development","cmake","cpp","dear-imgui","macos","metal","opengl","sdl","vulkan","windows"],"created_at":"2025-01-25T19:12:22.583Z","updated_at":"2026-04-15T18:02:30.692Z","avatar_url":"https://github.com/GrahamCHill.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# SDL2+DearImGUI Project Template\n\n\nIf you want the SDL3 version got to [SDL3 Template](https://github.com/GrahamCHill/SDL3-template)\nThis template is built with git submodules, and CMake!  \n\nThis template uses git submodules, if you do *not* git clone it and just use download from the web, you will have to \nplace the content of SDL2 into the SDL folder in the folder External/SDL2 and the content of Tiny File Dialog (if you want \nto use it,) in AppTemplate/Submodules/tinyfd (or you can delete the files and folders relating to it and remove the references in\nthe CMake files.)  \n\nYou can Change the rendering backend without much effort, as time progresses I will make this process easier, but at the \nmoment it can be done easily by changing the contents of src/main (the actual entry point of your program,) and the \ngraphics-backend value in CMake (You can see the options in AppTemplate/CMakeLists.txt.)  \n\n\nThis a template designed around the CMake build system, it includes \n[Dear ImGui](https://github.com/ocornut/imgui), [Vulkan](https://vulkan.lunarg.com/),\n[SDL2](https://github.com/libsdl-org/SDL), and [Tiny File Dialog](https://sourceforge.net/projects/tinyfiledialogs/).\n\n### Building\n#### Requirements\nThis project requires you to have the Vulkan SDK installed on your system, as well as an appropriate compiler and CMake \nfor the actual build process. Below are links you may require:\n1. [Vulkan SDK](https://vulkan.lunarg.com/sdk/home)\n2. [CMake](https://cmake.org/download/)\n\nOn Windows the [MinGW](https://www.mingw-w64.org/), \n[Visual Studio Compiler](https://visualstudio.microsoft.com/vs/features/cplusplus/), or other appropriate compiler is \nrequired for building.  \nOn Linux based systems [GCC](https://gcc.gnu.org/) or another appropriate compiler can be used.  \nOn macOS when you install Xcode, you should have all you need to build it.  \n\n#### Commands\nIf you open the Folder `SDL2-Vulkan-DearImGUI-Template` (the top level of this git repository), in your chosen platforms console/terminal \nyou can run the following commands to build the project\n\n```shell\n\nmkdir \"build\"\ncd build\n\ncmake ..\nmake\n\n```\n### Removing Unwanted Libraries\nThis template has made a few simple choices in order to show you how you can structure your project or add other git repositories to your \nproject, but if you don't want any of them you just have to remove them, remove the reference to it in .gitsubmodules and alter the \nrelevant CMake files from your project for example with Tiny File Dialog files you can remove it by deleting the following files in the \nproject:\n\n- `/AppTemplate/Submodules/tinyfd.cmake`\n- `/AppTemplate/Submodules/tinyfd/*`  \n\nThe line in the CMakeLists.txt file present in `AppTemplate/Submodules/` which says `include(${SUBMODULE_CMAKE}/tinyfd.cmake)`.\n\nThe files I wrote using them located at \n\n- `/AppTemplate/src/fileDialog.h`\n- `/AppTemplate/src/fileDialog.cpp`\n\nAny reference to them in the `main.h` and `main.cpp` files.\n\nFinally remove the following from `/AppTemplate/CMakeLists.txt` located in the `set_executable` command\n\n- `src/fileDialog.cpp`\n- `src/fileDialog.h`\n- `${TINYFD_REQ}`\n\nYou can also disable Vulkan and use only SDL2's renderer, if you choose by modifying your CMakeLists files, as this template is\nbuilt for you to make use of so you can skip to learning SDL2, Dear ImGui, Vulkan, and/or whatever you want to add/remove into \nthis template.\n\n### Adding New Libraries/git Projects\n\nTo add a new library, I recomend using the project layout I have set up and adding it as either a git submodule if \nit can be built with CMake to the folder `/External/` followed by the project/git repository name, if adding with git submodules\nyou can for example run (the command below shows how to add the SDL2 branch to your project, if you would rather use that*.)\n```shell\ngit submodule add -b SDL2 https://github.com/libsdl-org/SDL.git External/SDL2\n```\n\\* - You will have to make several changes throughout the CMake build system, and the CMake Bundler scripts will not work without\n  changes\n\nIf you want to integrate code directly into the main program you can instead use the `/AppTemplate/Submodules/` directory as \nopposed to `External` in the above command.\n\nSome External Libraries and git repositories, might not be built with CMake, in which case you can look at how the imgui.cmake,\nand `imgui` folder located in `/AppTemplate/Submodules/` is integrated into the project to bring your wanted project in.\n\n### License\n#### This Project\nThis Project is licensed under the MIT license, as such you are free to do anything allowed by the MIT license with this \nproject.\n\n#### Third-Party Libraries\n\n- This project uses the Dear ImGui GUI Framework. The MIT license is included in the folder \n`src/Submodules/imgui`.\n\n- This project uses Vulkan. The license for which is available from them \n[Vulkan Site](https://vulkan.lunarg.com/license/).\n\n- This project uses SDL2. The Zlib license is included in the folder `external/SDL2`.\n\n- This project uses the Tiny File Dialog Project. The zlib license is included in the source code files of \n`src/Submodules/tinyfd`.\n\n### Other \nIf you appreciate it, give sugestions to make it better, drop a star, or tell a friend.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrahamchill%2Fsdl2-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrahamchill%2Fsdl2-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrahamchill%2Fsdl2-template/lists"}