smack0007 / SDL_ts

SDL bindings for TypeScript. Currently running on deno.
MIT License
26 stars 6 forks source link

Implement toPlatformStruct and a few bug fixes #9

Closed jingkaimori closed 1 year ago

jingkaimori commented 1 year ago

This pr use Deno.ForeignLibraryInterface to improve type inference in denoLoadLibrary, fix missing Quit function in IMG and TTF, and adjust _data property of Color class to avoid typescript error.

smack0007 commented 1 year ago

Hi sorry I've been on vacation for the last 3 weeks. I'll try and take a look at this in the next few days.

smack0007 commented 1 year ago

I'll be willing to take the toPlatformStruct changes but please run deno fmt on the code. The changes from DynamicLibrary to Deno.DynamicLibrary are a no go for me.

jingkaimori commented 1 year ago

So can we make DynamicLibrary infer return type from FFI symbol type? Some copy from deno is needed, with a MIT license

smack0007 commented 1 year ago

Honestly it's not needed. There is never any interaction directly with the FFI layer. Only generated code directly interacts with the FFI stuff. If you can figure out how to keep the names of the functions available via FFI I would gladly accept that but we don't need to copy the entire interface from deno.