{"id":13712869,"url":"https://github.com/tiehuis/zig-sdl2","last_synced_at":"2025-04-12T03:32:15.097Z","repository":{"id":71917820,"uuid":"141263371","full_name":"tiehuis/zig-sdl2","owner":"tiehuis","description":"SDL2 bindings for Zig","archived":false,"fork":false,"pushed_at":"2019-05-09T08:01:37.000Z","size":41,"stargazers_count":13,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-25T23:06:45.456Z","etag":null,"topics":["sdl","zig"],"latest_commit_sha":null,"homepage":null,"language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tiehuis.png","metadata":{"files":{"readme":"README","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2018-07-17T09:10:36.000Z","updated_at":"2024-11-21T08:14:38.000Z","dependencies_parsed_at":"2023-04-25T21:02:27.752Z","dependency_job_id":null,"html_url":"https://github.com/tiehuis/zig-sdl2","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/tiehuis%2Fzig-sdl2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiehuis%2Fzig-sdl2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiehuis%2Fzig-sdl2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiehuis%2Fzig-sdl2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tiehuis","download_url":"https://codeload.github.com/tiehuis/zig-sdl2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248512478,"owners_count":21116610,"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":["sdl","zig"],"created_at":"2024-08-02T23:01:23.846Z","updated_at":"2025-04-12T03:32:15.064Z","avatar_url":"https://github.com/tiehuis.png","language":"Zig","readme":"DEPRECATED: This is no longer needed since Zig added specific C-pointer types for translated code.\nI recommend using C import directly. If there is any issue with the automatic translation process, you can\nmake an issue on the main zig compiler repository and we can fix upstream.\n\nMinimal zig wrapper over SDL2.\n\nFor now, the standard SDL naming conventions are used but these will be changed\nin the future to use zig namespacing.\n\nThe only difference between this package and `@cImport(@cInclude(\"SDL.h\"))` is\nfixing and correcting single-pointer entries and completing macro definitions\nthat are otherwise untranslatable.\n\n## Example\n\n    use @import(\"src/index.zig\");\n\n    pub fn main() u8 {\n        if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) != 0) {\n            SDL_Log(c\"failed to initialized SDL\\n\");\n            return 1;\n        }\n        defer SDL_Quit();\n\n        var renderer: *SDL_Renderer = undefined;\n        var window: *SDL_Window = undefined;\n\n        if (SDL_CreateWindowAndRenderer(640, 480, SDL_WINDOW_SHOWN, \u0026window, \u0026renderer) != 0) {\n            SDL_Log(c\"failed to initialize window and renderer\\n\");\n            return 1;\n        }\n        defer SDL_DestroyRenderer(renderer);\n        defer SDL_DestroyWindow(window);\n\n        SDL_SetWindowTitle(window, c\"zig-sdl\");\n        _ = SDL_SetRenderDrawColor(renderer, 0, 64, 128, 255);\n        _ = SDL_RenderClear(renderer);\n        _ = SDL_RenderPresent(renderer);\n\n        SDL_Delay(3000);\n        return 0;\n    }\n\n## Todo\n\n - Clean up remaining arguments to take single-item pointers and non-nullables\n   where applicable.\n - Convert c_int return codes to bool where applicable.\n - Potentially namespace functions to `sdl.` instead of the current `SDL_`.\n","funding_links":[],"categories":["GUI","Multimedia \u0026 Graphics"],"sub_categories":["Graphics Library"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiehuis%2Fzig-sdl2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftiehuis%2Fzig-sdl2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiehuis%2Fzig-sdl2/lists"}