{"id":37168515,"url":"https://github.com/hadeweka/sdl-crystal-bindings","last_synced_at":"2026-01-14T19:55:05.827Z","repository":{"id":59404523,"uuid":"530707806","full_name":"Hadeweka/SDL-Crystal-Bindings","owner":"Hadeweka","description":"Crystal binding generator for raw SDL 3 methods","archived":false,"fork":false,"pushed_at":"2025-10-27T13:42:58.000Z","size":917,"stargazers_count":15,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-27T14:13:15.330Z","etag":null,"topics":["binding-generator","bindings","sdl","sdl3"],"latest_commit_sha":null,"homepage":"","language":"Crystal","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/Hadeweka.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-08-30T15:02:11.000Z","updated_at":"2025-10-27T13:43:02.000Z","dependencies_parsed_at":"2025-01-04T01:18:48.240Z","dependency_job_id":"0b79d389-b129-40f9-adbe-558d9d430465","html_url":"https://github.com/Hadeweka/SDL-Crystal-Bindings","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/Hadeweka/SDL-Crystal-Bindings","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hadeweka%2FSDL-Crystal-Bindings","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hadeweka%2FSDL-Crystal-Bindings/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hadeweka%2FSDL-Crystal-Bindings/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hadeweka%2FSDL-Crystal-Bindings/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Hadeweka","download_url":"https://codeload.github.com/Hadeweka/SDL-Crystal-Bindings/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hadeweka%2FSDL-Crystal-Bindings/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28433544,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T18:57:19.464Z","status":"ssl_error","status_checked_at":"2026-01-14T18:52:48.501Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["binding-generator","bindings","sdl","sdl3"],"created_at":"2026-01-14T19:55:05.206Z","updated_at":"2026-01-14T19:55:05.822Z","avatar_url":"https://github.com/Hadeweka.png","language":"Crystal","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Direct SDL bindings to Crystal\r\n\r\nThis shard allows for the direct use of all unsafe SDL functions.\r\nIt is designed to use as a low-level foundation for your own libraries. \r\n\r\nNote that it is NOT recommended to use these bindings unless you want to write your own wrappers (which are not provided).\r\nThe bindings here are unsafe and are therefore able to crash your program.\r\n\r\n## Requirements\r\n\r\nYou need to have SDL installed or the SDL library files accessible by Crystal for linking and running.\r\n\r\nFor the other SDL library bindings, you also need to have SDL_image, SDL_mixer and SDL_ttf available.\r\n\r\nDepending on the SDL version, you should use either the main branch (for SDL 3) or an sdl2 release (for SDL 2).\r\n\r\n## Usage\r\n\r\nSimply add this shard (`sdl-crystal-bindings`) to your `shard.yml`.\r\nThis repository comes with pre-generated binding files.\r\n\r\nThen, use `require \"sdl-crystal-bindings/sdl3-crystal-bindings\"`.\r\n\r\nFor the other SDL libraries, you can use `require \"sdl-crystal-bindings/sdl3-image-bindings\"`, for example.\r\nNote that the examples use the relative paths to the respective files.\r\n\r\nRegular SDL functions, structs, enums, unions and constants are accessible using the `LibSDL` namespace, while\r\npreprocessor macro functions are accessible using the `LibSDLMacro` module. This separation is due to the fact\r\nthat no functions can be added to the Crystal `lib` modules, which do not already exist in C. Since these are\r\nsimple macro expressions, they have no real analogon and thus need to be implemented separately.\r\n\r\nNote that also the syntax differs from regular SDL in many aspects and is more oriented to Crystal (for example,\r\nfunctions are in snake_case, while structs are in CamelCase).\r\n\r\n## Examples\r\n\r\nThere are some examples ported directly from https://examples.libsdl.org/SDL3/ to Crystal. You might have to\r\nchange the relative paths in the examples for them to work if not started from this directory.\r\n\r\n## Generating new bindings\r\n\r\nTo update the bindings, you need to have Ruby, gcc and clang installed on your system (ideally Linux or it might not work).\r\n\r\nJust call `ruby generate3.rb` from the main directory of this shard and the files under `src/` will be generated or updated.\r\nThe script will download the newest SDL headers and generate automated bindings.\r\n\r\nIf you need to add manual changes, please either use the filters from the script to exclude structs and/or modify the\r\nfiles in the `additions3` directory to add specific bindings manually.\r\n\r\nIf you encounter any problems while generating the bindings, please open an issue.\r\n\r\n## Changelog\r\n\r\n### Version 0.4.0\r\n\r\n#### SDL header versions\r\n\r\n* SDL: preview-3.3.2\r\n* SDL-image: release-3.2.4\r\n* SDL-mixer: main (3.0+, no official release yet)\r\n* SDL-ttf: release-3.2.2\r\n\r\n#### Usability\r\n\r\n* Kept old mixer bindings for compatibility\r\n\r\n#### Bugfixes\r\n\r\n* Fixed typo in mixer version function\r\n* Fixed properties and hints not working properly\r\n\r\n### Version 0.3.0\r\n\r\n#### Features\r\n\r\n* Support for SDL3 (specifically 3.2 and in some parts 3.4)\r\n* Many examples for SDL3\r\n\r\n## Roadmap\r\n\r\nCurrently no new releases planned\r\n\r\n### Wishlist\r\n\r\n#### Features\r\n\r\n* [ ] Merging of all functions and macros into one single module (if possible and helpful)\r\n* [ ] Even more examples\r\n* [ ] Documentation\r\n* [ ] Automated binding generation via CI\r\n\r\n#### Usability\r\n\r\n* [ ] Fix weird formatting in some header files\r\n* [ ] Add original C struct/function/constant/macro names as comments\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhadeweka%2Fsdl-crystal-bindings","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhadeweka%2Fsdl-crystal-bindings","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhadeweka%2Fsdl-crystal-bindings/lists"}