diff options
| author | s-ol <s+removethis@s-ol.nu> | 2025-03-21 12:25:10 +0000 |
|---|---|---|
| committer | s-ol <s+removethis@s-ol.nu> | 2025-03-21 12:37:22 +0000 |
| commit | 8987c88bba84125e358319c2d4085f958401ff11 (patch) | |
| tree | da54035fb9e2ef25c92660a7ea886c2d7275d421 | |
| parent | as lib (diff) | |
| download | lua-texture-share-vk-8987c88bba84125e358319c2d4085f958401ff11.tar.gz lua-texture-share-vk-8987c88bba84125e358319c2d4085f958401ff11.zip | |
package for luarocks
| -rw-r--r-- | LICENSE | 21 | ||||
| -rw-r--r-- | README.md | 14 | ||||
| -rw-r--r-- | example/main.lua (renamed from main.lua) | 4 | ||||
| l--------- | example/texture-share-vk.lua | 1 | ||||
| -rw-r--r-- | texture-share-vk-scm-0.rockspec | 28 | ||||
| -rw-r--r-- | texture-share-vk.lua (renamed from texture_share_vk.lua) | 0 |
6 files changed, 67 insertions, 1 deletions
@@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 s-ol + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..c234d19 --- /dev/null +++ b/README.md @@ -0,0 +1,14 @@ +# lua texture-share-vk + +A LÖVE library for sharing GPU textures between processes. + +This wraps the OpenGL C API of [texture-share-vk](https://github.com/DigitOtter/texture-share-vk) and allows publishing a LÖVE Canvas object. + +## API + +- `tvs.new()`: creates a new `Client` object (`texture-share-gl` client). +- `Client:newSharedCanvas(name, ...)`: creates a new `SharedCanvas` object by delegating to [`love.graphics.newCanvas(...)`](https://love2d.org/wiki/love.graphics.newCanvas) and publishes it. +- `Canvas.name`: the name passed in the SharedCanvas constructor +- `Canvas.canvas`: the love2d `Canvas` object +- `Canvas:send()`: Sends the current contents of the Canvas to subscribers, call this after drawing to the Canvas. +- `Canvas:any_other_method()`: delegated to the love2d `Canvas` object diff --git a/main.lua b/example/main.lua index d1b6d70..4788361 100644 --- a/main.lua +++ b/example/main.lua @@ -1,9 +1,11 @@ -local tvs = require 'texture_share_vk' +local tvs = require 'texture-share-vk' local client, shared function love.load() client = tvs.new() shared = client:newSharedCanvas("love2d", love.graphics.getDimensions()) + + print(shared:getDimensions()) -- NOTE: delegated to LÖVE Canvas end local angle = 0 diff --git a/example/texture-share-vk.lua b/example/texture-share-vk.lua new file mode 120000 index 0000000..f828f1e --- /dev/null +++ b/example/texture-share-vk.lua @@ -0,0 +1 @@ +../texture-share-vk.lua
\ No newline at end of file diff --git a/texture-share-vk-scm-0.rockspec b/texture-share-vk-scm-0.rockspec new file mode 100644 index 0000000..2c70e89 --- /dev/null +++ b/texture-share-vk-scm-0.rockspec @@ -0,0 +1,28 @@ +package = "texture-share-vk" +version = "scm-0" + +source = { + url = "git+https://git.s-ol.nu/lua-texture-share-vk.git", +} + +description = { + summary = "A LÖVE library for sharing GPU textures between processes", + detailed = [[ + This wraps the OpenGL C API of https://github.com/DigitOtter/texture-share-vk + and allows publishing a LÖVE Canvas object. + ]], + homepage = "https://git.s-ol.nu/lua-texture-share-vk/-/", + license = "MIT", +} + +dependencies = { + -- requires luajit FFI + "lua == 5.1", +} + +build = { + type = "builtin", + modules = { + ["texture-share-vk"] = "texture-share-vk.lua", + } +} diff --git a/texture_share_vk.lua b/texture-share-vk.lua index b8e2523..b8e2523 100644 --- a/texture_share_vk.lua +++ b/texture-share-vk.lua |
