Tangent128 / luasdl2

A pure C binding of SDL 2.0 for Lua 5.1, Lua 5.2, and LuaJIT.
ISC License
383 stars 73 forks source link

Missing functions? #90

Closed EmperorPenguin18 closed 2 years ago

EmperorPenguin18 commented 2 years ago

I'm currently working on a project that uses this library, and the guides I'm using require these two functions:

https://wiki.libsdl.org/SDL_Vulkan_GetInstanceExtensions https://wiki.libsdl.org/SDL_Vulkan_CreateSurface

But I can't find them in the API documentation. Are these available with this library? If not is it difficult to add them?

Tangent128 commented 2 years ago

1) They are not; this library has not been updated to wrap the newer SDL2 calls

2) It should not be difficult to add the Vulkan functions (Lua extensions are easy to write, and the luasdl2 codebase has a lot of helpers), but my time for maintenance has been severely limited lately. (Also, you would need to find another library to actually use the Vulkan API)

Pull requests are welcome, however.

EmperorPenguin18 commented 2 years ago

This is the library I'm using for the Vulkan API: https://github.com/stetre/moonvulkan

I have never written a Lua extension before (in fact I'm completely new to Lua). Is there a guide or tutorial to get me started? I already know C, so it's just the binding to Lua part I need to learn. I can't promise I'll get something working, but it might be an interesting learning opportunity I can work on if I have some free time.

Tangent128 commented 2 years ago

If you're interested, the Lua manual is pretty well-written and concise for the amount of information it covers: http://www.lua.org/manual/

The sections about the Lua stack and lua_pushcfunction are good starting points.

EmperorPenguin18 commented 2 years ago

Are there compilation instructions somewhere? I'm getting this error: /usr/local/lib/lua/SDL.so: undefined symbol: lua_getiuservalue and I'm pretty sure it has something to do with linking the wrong Lua version.

EmperorPenguin18 commented 2 years ago

I have created a pull request that solves this issue. Please let me know if there are any changes you want before merge.

EmperorPenguin18 commented 2 years ago

Merging https://github.com/Tangent128/luasdl2/pull/92 solves this. Closing issue.