{"id":13805336,"url":"https://github.com/kjlaw89/vsdl","last_synced_at":"2025-05-13T19:30:50.177Z","repository":{"id":45061017,"uuid":"299511009","full_name":"kjlaw89/vsdl","owner":"kjlaw89","description":"A V SDL2 Wrapper","archived":false,"fork":false,"pushed_at":"2022-01-11T20:42:59.000Z","size":7738,"stargazers_count":12,"open_issues_count":2,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-13T02:57:32.210Z","etag":null,"topics":["sdl2","vlang","vlang-module"],"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/kjlaw89.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-09-29T05:14:25.000Z","updated_at":"2024-08-27T18:49:53.000Z","dependencies_parsed_at":"2022-09-02T22:51:06.261Z","dependency_job_id":null,"html_url":"https://github.com/kjlaw89/vsdl","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/kjlaw89%2Fvsdl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kjlaw89%2Fvsdl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kjlaw89%2Fvsdl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kjlaw89%2Fvsdl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kjlaw89","download_url":"https://codeload.github.com/kjlaw89/vsdl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254012968,"owners_count":21999346,"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":["sdl2","vlang","vlang-module"],"created_at":"2024-08-04T01:01:00.172Z","updated_at":"2025-05-13T19:30:49.252Z","avatar_url":"https://github.com/kjlaw89.png","language":"C","funding_links":[],"categories":["Libraries"],"sub_categories":["Graphics"],"readme":"\u003cdiv align=\"center\"\u003e\n\t\u003ch1\u003eVSDL\u003c/h1\u003e\n\u003c/div\u003e\n\nVSDL is a work-in-progress V wrapper for the C-based [SDL library](https://www.libsdl.org). The aim of this library is to provide a thorough implementation of SDL2 in V. The implementation is faithful to the original API but takes some liberties to provide a native \"V\" feel.\n\n\u003cdiv align=\"center\"\u003e\n\t\u003cimg src=\"https://raw.githubusercontent.com/kjlaw89/vsdl/master/sample.png\" alt=\"'Image' Example\" style=\"width: 480px;\" /\u003e\n\u003c/div\u003e\n\n## Features\n\n- [x] gfx\n  - [x] window management\n  - [x] renderer\n  - [x] texture\n  - [x] surface\n  - [x] rect\n  - [x] gl hook\n  - [x] vulkan hook (untested)\n  - [x] pixel formats\n- [ ] events\n  - [x] basic event handling\n  - [ ] subscribed events\n- [x] input\n  - [x] keyboard\n  - [x] mouse\n- [x] controller\n  - [x] joysticks\n  - [x] game controllers\n- [ ] sensors\n- [ ] haptics\n- [x] audio\n- [x] ttf\n- [x] mixer\n- [x] image\n  - [x] load\n  - [x] file type\n- [ ] network\n- [ ] concurrency/threading\n- [x] RWops\n\n## Example\n\n```v\nmodule main\n\nimport vsdl\nimport vsdl.events\nimport vsdl.gfx\n\nfn main() {\n\tmut window := gfx.create_window(\"Simple VSDL Window\", -1, -1, 640, 480, .shown)?\n\tsurface := window.get_surface()?\n\tsurface.fill(r: 255, g: 255, b: 255)\n\n\tdefer {\n\t\tsurface.free()\n\t\twindow.destroy()\n\t\tvsdl.quit()\n\t}\n\t\n\twindow.update()\n\tevents.loop()\n}\n```\n\nSee the examples folder for more examples. Run any `.v` files with `v run [file]`.\n\n## Requirements\n\nThe SDL2 headers come pre-included with this repo. To run the only thing needed are the runtime binaries.\n\nOn **Ubuntu 14.04 and above**, run:\n\n`apt install libsdl2{,-image,-mixer,-ttf}-dev zlib1g-dev libfreetype6-dev`\n\nOn **MacOS** install SDL2 via Homebrew:\n\n`brew install sdl2{,-image,-mixer,-ttf}`\n\nOn **Windows**,\n\n1. Download the runtime binaries from SDL2\n  * [SDL2 Runtime Binaries](https://libsdl.org/download-2.0.php)\n  * [SDL2 Image Runtime Binaries](https://www.libsdl.org/projects/SDL_image/) (optional)\n  * [SDL2 Mixer Runtime Binaries](https://www.libsdl.org/projects/SDL_mixer/) (optional)\n  * [SDL2 TTF Runtime Binaries](https://www.libsdl.org/projects/SDL_ttf/) (optional)\n2. Extract the binaries to the folder where your executable resides\n\n### Notes about dependencies\n\nThis repo comes with a copy of the headers for the version of SDL2 that it was developed against (2.0.12), but does not ship with the runtime libraries. It is *not* necessary to get the Image, Mixer or TTF library runtimes if you do not plan to use them in your application.\n\nBy default VSDL only initializes the subsystems that are imported. For example, importing just `vsdl` only initializes the main SDL2 system, giving you limited access to SDL2 base functionality. The `video` or `audio` subsystems are only initialized when `vsdl.gfx` or `vsdl.audio` are imported. This allows you to only activate the subsystems that are important to your project.\n\nIf an extension library is loaded (`vsdl.image`, `vsdl.mixer`, `vsdl.ttf`), the required runtime binaries must be installed or provided along with the build.\n\n## Contributing / Support\n\nThis project was developed as a way of improving my understanding of V \u0026 C. I will not be providing active support for the project, but I'll happily accept any pull requests. Use at your own discretion! ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkjlaw89%2Fvsdl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkjlaw89%2Fvsdl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkjlaw89%2Fvsdl/lists"}