{"id":20704330,"url":"https://github.com/osch/lua-lpugl","last_synced_at":"2025-10-29T12:41:31.598Z","repository":{"id":50449722,"uuid":"235885205","full_name":"osch/lua-lpugl","owner":"osch","description":"A minimal Lua-API for building GUIs using Cairo or OpenGL (see: https://github.com/osch/lua-lpugl#lpugl)","archived":false,"fork":false,"pushed_at":"2023-11-10T00:58:53.000Z","size":1386,"stargazers_count":36,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-11T15:32:39.654Z","etag":null,"topics":["gui","lua","lua-binding","lua-gui","lua-library","luagl","nanovg","oocairo","pugl"],"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/osch.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}},"created_at":"2020-01-23T20:57:47.000Z","updated_at":"2025-07-06T12:27:46.000Z","dependencies_parsed_at":"2024-11-17T01:12:03.561Z","dependency_job_id":"b716c802-791c-4d9c-8b3d-db2e10e5f554","html_url":"https://github.com/osch/lua-lpugl","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/osch/lua-lpugl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osch%2Flua-lpugl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osch%2Flua-lpugl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osch%2Flua-lpugl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osch%2Flua-lpugl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/osch","download_url":"https://codeload.github.com/osch/lua-lpugl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osch%2Flua-lpugl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000687,"owners_count":26082850,"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","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["gui","lua","lua-binding","lua-gui","lua-library","luagl","nanovg","oocairo","pugl"],"created_at":"2024-11-17T01:11:57.755Z","updated_at":"2025-10-08T22:58:39.584Z","avatar_url":"https://github.com/osch.png","language":"C","readme":"# lpugl\n[![Licence](http://img.shields.io/badge/Licence-MIT-brightgreen.svg)](LICENSE)\n[![Install](https://img.shields.io/badge/Install-LuaRocks-brightgreen.svg)](https://luarocks.org/modules/osch/lpugl)\n\nLPugl is a minimal Lua-API for building GUIs. It is based on [Pugl] (*PlUgin Graphics Library*), \na minimal portable API for embeddable GUIs.\n\nLPugl provides only a very minimal API. See [lwtk] (*Lua Widget Toolkit*)\nfor implementing GUI widgets on top of LPugl.\n\nLike Pugl, LPugl does only have explicit context and no static data, so it's\npossible to have several instances within the same program and even within \nthe same Lua main state. Therefore LPugl is especially suited for building \nGUIs for plugins or components within larger applications. For example \nsee [LDPF-Examples]: here LPugl is used for the GUI of audio processing plugins \nwith [DPF] (*DISTRHO Plugin Framework*).\n\n#### Supported platforms: \n   * X11\n   * Windows\n   * Mac OS X \n\n#### Supported rendering backends: \n   * Cairo  (requires [OOCairo])\n   * OpenGL\n\nThanks to the modular architecture of Pugl, more rendering backends could be\npossible in the future. Different rendering backends can be combined in one\napplication and also in the same window by embedding different view objects.\n\n#### LuaRocks modules:\n   * **[lpugl]**        - platform specific base module\n   * **[lpugl_cairo]**  - Cairo rendering backend module\n   * **[lpugl_opengl]** - OpenGL rendering backend module\n\n\n#### Further reading:\n   * [Documentation](./doc/README.md#lpugl-documentation)\n   * [Examples](./example/README.md#lpugl-examples)\n\n## First Example\n\n* Simple example for using the Cairo backend:\n\n    ```lua\n    local lpugl = require\"lpugl_cairo\"\n    \n    local world = lpugl.newWorld(\"Hello World App\")\n    local scale = world:getScreenScale()\n    \n    local view = world:newView \n    {\n        title     = \"Hello World Window\",\n        size      = {300*scale, 100*scale},\n        resizable = true,\n        \n        eventFunc = function(view, event, ...)\n            print(event, ...)\n            if event == \"EXPOSE\" then\n                local cairo = view:getDrawContext()\n                local w, h  = view:getSize()\n                cairo:set_source_rgb(0.9, 0.9, 0.9)\n                cairo:rectangle(0, 0, w, h)\n                cairo:fill()\n                cairo:set_source_rgb(0, 0, 0)\n                cairo:select_font_face(\"sans-serif\", \"normal\", \"normal\")\n                cairo:set_font_size(24*scale)\n                local text = \"Hello World!\"\n                local ext = cairo:text_extents(text)\n                cairo:move_to((w - ext.width)/2, (h - ext.height)/2 + ext.height)\n                cairo:show_text(text)\n            elseif event == \"CLOSE\" then\n                view:close()\n            end\n        end\n    }\n    view:show()\n    \n    while world:hasViews() do\n        world:update()\n    end\n    ```\n\n[Pugl]:                     https://drobilla.net/software/pugl\n[DPF]:                      https://github.com/DISTRHO/DPF\n[LDPF-Examples]:            https://github.com/LDPF/LDPF-Examples\n[OOCairo]:                  https://luarocks.org/modules/osch/oocairo\n[lwtk]:                     https://github.com/osch/lua-lwtk#lwtk---lua-widget-toolkit\n[lpugl]:                    https://luarocks.org/modules/osch/lpugl\n[lpugl_cairo]:              https://luarocks.org/modules/osch/lpugl_cairo\n[lpugl_opengl]:             https://luarocks.org/modules/osch/lpugl_opengl\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosch%2Flua-lpugl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fosch%2Flua-lpugl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosch%2Flua-lpugl/lists"}