{"id":26560537,"url":"https://github.com/roy-fokker/sdl3-cpp23-project-template","last_synced_at":"2025-07-23T00:07:43.816Z","repository":{"id":282783606,"uuid":"949640865","full_name":"Roy-Fokker/sdl3-cpp23-project-template","owner":"Roy-Fokker","description":"SDL3 GPU with C++23 Modules Project Template","archived":false,"fork":false,"pushed_at":"2025-07-10T15:57:08.000Z","size":139,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-10T22:02:04.916Z","etag":null,"topics":["cmake","cmake-modules","cpm","cpp-modules","cpp23","linux","sdl-gpu","sdl3","windows"],"latest_commit_sha":null,"homepage":"https://github.com/Roy-Fokker/sdl3-cpp23-project-template","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/Roy-Fokker.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,"zenodo":null}},"created_at":"2025-03-16T22:14:35.000Z","updated_at":"2025-07-10T15:57:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"c8fd9160-bce7-4290-8922-a8d878a311cf","html_url":"https://github.com/Roy-Fokker/sdl3-cpp23-project-template","commit_stats":null,"previous_names":["roy-fokker/sdl3-cpp23-project-template"],"tags_count":1,"template":true,"template_full_name":null,"purl":"pkg:github/Roy-Fokker/sdl3-cpp23-project-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Roy-Fokker%2Fsdl3-cpp23-project-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Roy-Fokker%2Fsdl3-cpp23-project-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Roy-Fokker%2Fsdl3-cpp23-project-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Roy-Fokker%2Fsdl3-cpp23-project-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Roy-Fokker","download_url":"https://codeload.github.com/Roy-Fokker/sdl3-cpp23-project-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Roy-Fokker%2Fsdl3-cpp23-project-template/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266592316,"owners_count":23953109,"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","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":["cmake","cmake-modules","cpm","cpp-modules","cpp23","linux","sdl-gpu","sdl3","windows"],"created_at":"2025-03-22T13:18:13.595Z","updated_at":"2025-07-23T00:07:43.806Z","avatar_url":"https://github.com/Roy-Fokker.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SDL3 + C++23 Project Template\n---\nTemplate project to play around with SDL3 GPU API with C++23 using modules.\n\n## Using the template\n### Project Config\n- In root `CMakeLists.txt` change `project name`, `url`, and `description`.\n- In `src/CMakeLists.txt` change `PRJ_APP_NAME`\n- Ensure `dxc` shader compiler is findable by CMake, \n  - `target_hlsl_sources` cmake function accepts shader format as option.\n    It will choose DXC location based on shader format in `src/CMakeLists.txt`\n\tSupports either SPIRV or DXIL (DXIL is windows only)\n\n### CMake commands for configuring and building\nVSCode will run these automatically.\n- On Windows\n```shell\n  # Configure Project\n  cmake --preset windows-default\n  # Build Project, parameter order matters\n  cmake --build --preset windows-debug\n```\n- On Linux\n```shell\n  # Configure Project\n  cmake --preset linux-default\n  # Build Project, parameter order matters\n  cmake --build --preset linux-debug\n```\n\n## Uses/Dependencies\n- CPM.CMake for package management\n- Ninja-Build for build engine\n- CMake 3.31+ with cmakepresets for configuration and build\n  - There is an issue, on my machine, with CMake 4.0. It fails to configure properly.\n  - CMake 4.0.1 fixed the issue with configure, seems like it was regression in CMake.\n- C++ modules enabled\n- Uses C++ Standard Library modules\n  - MSVC (Windows only)\n  - Clang (Linux with libc++ only)\n- Focuses on SDL3 GPU\n- HLSL for all shaders, compile to SPIRV for Vulkan and DXIL for Direct3D\n\n## Example project dependencies\nUses following libraries retrieved from their project repos by CPM.CMake\n- SDL3, obviously\n- GLM, for math\n- DXC, from Vulkan SDK for Vulkan backend **or** from Windows SDK for DirectX backend\n\n## Basic notes on code structure\n- As much as is possible, functions will not take ownership of pointers to objects.\n- Where able, all SDL GPU types are wrapped into std::unique_ptr with custom deleters, so they self clean on scope exit.\n- SDL init and quit is wrapped in C++ class and created/destructed by Application class.\n- `Application` class does following\n  - Create SDL Window and GPU, in Application `C'Tor`\n  - Create Basic Pipeline, in `Prepare Scene`\n    - Simple vertex shader that uses uniform buffer to fix rendering perspective\n    - Simple pixel/fragment shader\n  - Vertex and Index buffers for Square mesh, in `Prepare Scene`\n  - Create Perspective projection, in `Prepare Scene`\n  - `Draw`s square using Indexed Primitives\n  - Quit on any-key pressed, in `Handle SDL Input`\n\n## To be figured out\n- Intellisense and clangd both cannot handle modules so don't work correctly\n  - Hacky solution for intellisense to show STD library types.\n\n## references\n- CMake 3.30 magic incantations, https://www.kitware.com/import-std-in-cmake-3-30/\n- CMake module compilations, https://www.kitware.com/import-cmake-the-experiment-is-over/\n- CMake experimental flag GUID for modules, https://github.com/Kitware/CMake/blob/master/Help/dev/experimental.rst#c-import-std-support\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froy-fokker%2Fsdl3-cpp23-project-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froy-fokker%2Fsdl3-cpp23-project-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froy-fokker%2Fsdl3-cpp23-project-template/lists"}