{"id":13872321,"url":"https://github.com/compnerd/DXSample","last_synced_at":"2025-07-16T02:30:31.434Z","repository":{"id":136979459,"uuid":"337821573","full_name":"compnerd/DXSample","owner":"compnerd","description":"Sample Program for DirectX 12 + Swift","archived":false,"fork":false,"pushed_at":"2021-02-23T16:21:23.000Z","size":848,"stargazers_count":80,"open_issues_count":0,"forks_count":1,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-11-21T00:02:38.721Z","etag":null,"topics":["directx","directx-12","swift","windows","windows-10"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/compnerd.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}},"created_at":"2021-02-10T18:50:23.000Z","updated_at":"2024-11-14T16:12:25.000Z","dependencies_parsed_at":"2023-04-07T23:36:06.277Z","dependency_job_id":null,"html_url":"https://github.com/compnerd/DXSample","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/compnerd%2FDXSample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compnerd%2FDXSample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compnerd%2FDXSample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compnerd%2FDXSample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/compnerd","download_url":"https://codeload.github.com/compnerd/DXSample/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226095659,"owners_count":17572970,"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":["directx","directx-12","swift","windows","windows-10"],"created_at":"2024-08-05T23:00:39.721Z","updated_at":"2024-11-23T20:30:53.059Z","avatar_url":"https://github.com/compnerd.png","language":"Swift","readme":"DXSample\n--------\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"3D Cube\" src=\"Documentation/Resources/Cube.png\" width=\"640\" height\"360\" /\u003e\n\u003c/p\u003e\n\nThis sample application shows how to use [Swift](https://www.swift.org),\n[Swift/COM](https://github.com/compnerd/swift-com) to build an application which\nleverages DirectX 12 on Windows 10.\n\nThis sample is a proof of concept of the possible functionality but does not\nfollow many best graphics best practices.  This code eschews V-Sync support for\nsimplicity in the code, doing simple double buffering.  There are many math\nroutines which are transliterated from the DXMath library by Microsoft.  It also\ndoes not try to optimize the math routines, opting instead for simplicity in the\ncode.  Many pieces of trivial functionality, e.g. fullscreen support, are simply\ndiscarded for brevity.\n \n## Build Requirements\n\n- Latest Swift **Development** Snapshot (2021-02-18 or later)\u003csup\u003e[1](#snapshot-requirement)\u003c/sup\u003e\n- Windows SDK 10.0.107763 or newer\n- Windows 10\n\n\u003csup\u003e\u003ca name=\"snapshot-requirements\"\u003e1\u003c/a\u003e\u003c/sup\u003e Stable releases are not\ncurrently supported as they are built from release branches and this project\nrequires the latest development snapshot from the `main` branch.\u003cbr/\u003e\n\n## Building\n\nThis project requires the latest Swift snapshot (February 18, 2021 or newer).\nYou can use the snapshot binaries from\n[swift.org](https://swift.org/download#snapshots) or download the nightly build\nfrom [Azure](https://dev.azure.com/compnerd/swift-build/_build?definitionId=7).\n\n### Building the Demo\n\nSimply running the demo, as described below, will implicitly build the demo\nprogram.  However, should you wish to explicitly build the demo application you\ncan do so as:\n\n```cmd\nswift build\n```\n\n### Running the Demo\n\nWith SPM, you can simply run the target demo program.  Because there is only a\nsingle executable in the repository, you can simply run it using the following:\n\n```cmd\nswift run\n```\n\n### Debugging\n\nDebugging this demo is complicated as there are separate portions involved:\n  1. Swift application code\n  2. System integration for DirectX\n\nLLDB currently does not support debugging with PDBs very well and does not\nhave the same level of conveniences that WinDBG may support.  Depending on which\nportion is being debugged you may have better experiences with different\ndebugging approaches.\n\nFor debugging the Swift application code, it is easier to debug using LLDB and\nDWARF.  In such a case, you will need to build the application as follows to\nenable the debug information:\n\n```cmd\nswift build -Xlinker -debug:dwarf\n```\n\nFor debugging the DirectX support, the WinDBG support may be more convenient.\nIn such a case, it would be better to build the application with CodeView and\nPDBs to allow WinDBG to provide stack traces in addition to the additional\ninformation from the debug mode.  You can build that using the following\ncommand:\n\n```cmd\nswift build -Xswiftc -g -Xswiftc -debug-info-format=codeview -Xlinker -debug\n```\n\nWhen the demo application is built in the `Debug` configuration, additional\ndebugging features are enabled in DirectX.  This will include halting execution\non any warning from the execution of the DirectX pipeline.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"Debugging with WinDBG\" src=\"Documentation/Resources/WinDBGX.png\" width=\"640\" height\"360\" /\u003e\n\u003c/p\u003e\n","funding_links":[],"categories":["Swift"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcompnerd%2FDXSample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcompnerd%2FDXSample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcompnerd%2FDXSample/lists"}