{"id":44328887,"url":"https://github.com/stetre/moonsdl2","last_synced_at":"2026-02-11T08:54:15.342Z","repository":{"id":170295855,"uuid":"642787720","full_name":"stetre/moonsdl2","owner":"stetre","description":"Lua bindings for SDL2","archived":false,"fork":false,"pushed_at":"2024-11-11T11:42:40.000Z","size":1270,"stargazers_count":5,"open_issues_count":3,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-11T12:33:14.391Z","etag":null,"topics":["lua-bindings","sdl2"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stetre.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}},"created_at":"2023-05-19T10:48:21.000Z","updated_at":"2024-11-11T11:42:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"35aff047-b6ae-45d0-b666-628a16925654","html_url":"https://github.com/stetre/moonsdl2","commit_stats":null,"previous_names":["stetre/moonsdl2"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/stetre/moonsdl2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stetre%2Fmoonsdl2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stetre%2Fmoonsdl2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stetre%2Fmoonsdl2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stetre%2Fmoonsdl2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stetre","download_url":"https://codeload.github.com/stetre/moonsdl2/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stetre%2Fmoonsdl2/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29330756,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-11T06:13:03.264Z","status":"ssl_error","status_checked_at":"2026-02-11T06:12:55.843Z","response_time":97,"last_error":"SSL_read: 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":["lua-bindings","sdl2"],"created_at":"2026-02-11T08:54:14.828Z","updated_at":"2026-02-11T08:54:15.334Z","avatar_url":"https://github.com/stetre.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"## MoonSDL2: Lua bindings for SDL2\n\nMoonSDL2 is a Lua binding library for the [Simple DirectMedia Layer (SDL2)](https://www.libsdl.org).\n\nIt runs on GNU/Linux and on Windows (MSYS2/MinGW or MSVC) and requires\n[Lua](http://www.lua.org/) (\u003e=5.3),\n[SDL2](https://github.com/libsdl-org/SDL/releases/) (\u003e= 2.26.0),\n[SDL_image](https://github.com/libsdl-org/SDL_image/releases/) (\u003e= 2.6.3),\n[SDL_mixer](https://github.com/libsdl-org/SDL_mixer/releases/) (\u003e= 2.6.0), and\n[SDL_ttf](https://github.com/libsdl-org/SDL_ttf/releases/) (\u003e= 2.20.0).\n\n_Author:_ _[Stefano Trettel](https://www.linkedin.com/in/stetre)_\n\n[![Lua logo](./doc/powered-by-lua.gif)](http://www.lua.org/)\n\n#### License\n\nMIT/X11 license (same as Lua). See [LICENSE](./LICENSE).\n\n#### Documentation\n\nSee the [Reference Manual](https://stetre.github.io/moonsdl2/doc/index.html).\n\n#### Getting and installing\n\nSetup the build environment as described [here](https://github.com/stetre/moonlibs), then:\n\n```sh\n$ git clone https://github.com/stetre/moonsdl2/\n$ cd moonsdl2\nmoonsdl2$ make\nmoonsdl2$ sudo make install\n```\n\n**On Windows Using Visual Studio**\n\n```\n\u003e git clone https://github.com/stetre/moonsdl2/\n\u003e cd moonsdl2\\src\n\u003e mingw32-make -f Makefile.msvc ^\n    LUAVER=\u003clua version\u003e ^\n    LUA_INCDIR=\u003cpath to directory containing lua.h\u003e ^\n    LUA_LIBDIR=\u003cpath to directory containing lua5X.dll\u003e ^\n    SDL_INCDIR=\u003cpath to directory containing SDL2.h, SDL2_image.h, etc.\u003e ^\n    SDL_LIBDIR=\u003cpath to directory containing SDL2.lib, SDL2_image.lib, etc.\u003e\n```\n\n`\u003clua version\u003e` is in dotted notation, like \"5.1\" (no quotes).\n\nEnsure all the other directories don't have spaces in their paths.\n\nIf you don't have access to `mingw32-make`, you can edit `src\\rebuild.bat` to\nsuit your Lua version and paths, and then run it (from the `src` directory) to\nperform a full rebuild.\n\n#### Example\n\nThe example below creates a window and draws a triangle using SDL2's 2D renderer.\n\nOther examples can be found in the **examples/** directory contained in the release package.\n\n```lua\n-- MoonSDL2 example: hello.lua\nlocal sdl = require(\"moonsdl2\")\n\nsdl.init()\n\nlocal window = sdl.create_window(\"Hello, triangle!\", nil, nil, 800, 600, sdl.WINDOW_SHOWN)\n\nlocal renderer = sdl.create_renderer(window, nil, sdl.RENDERER_ACCELERATED|sdl.RENDERER_PRESENTVSYNC)\n\nlocal vertices =\n    { --   position           color\n        { { 400, 150 }, { 255, 0, 0, 255 } },\n        { { 200, 450 }, { 0, 0, 255, 255 } },\n        { { 600, 450 }, { 0, 255, 0, 255 } },\n    }\n\nlocal quit = false\nwhile not quit do\n   e = sdl.poll_event()\n   if e then\n      if e.type == 'quit' then quit = true end\n   end\n   renderer:set_draw_color({0, 0, 0, 255})\n   renderer:clear()\n   renderer:render_geometry(nil, vertices, nil)\n   renderer:present()\nend\n```\n\nThe script can be executed at the shell prompt with the standard Lua interpreter:\n\n```shell\n$ lua hello.lua\n```\n\n#### See also\n\n* [MoonLibs - Graphics and Audio Lua Libraries](https://github.com/stetre/moonlibs).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstetre%2Fmoonsdl2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstetre%2Fmoonsdl2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstetre%2Fmoonsdl2/lists"}