kmamal / node-sdl

🎮 SDL bindings for Node.js
https://www.npmjs.com/package/@kmamal/sdl
MIT License
120 stars 10 forks source link

Add TypeScript support to @kmamal/gl #49

Closed LmanTW closed 4 months ago

LmanTW commented 4 months ago

It seems like @kmamal/gl doesn't support TypeScript yet. it'll be really nice if we have type declaration, thx!

kmamal commented 4 months ago

@LmanTW I tried adding types in v8.0.2-1 of @kmamal/gl. Let me know if it works.

LmanTW commented 4 months ago

There seems to be some problem with WebGLContextAttributes.

const window = sdl.video.createWindow({ opengl: true })
const ctx = createContext(window.pixelWidth, window.pixelHeight, { window: window.native })
//                                                               ^ Object literal may only specify known properties, and 'window' does not exist in type 'WebGLContextAttributes'.
kmamal commented 4 months ago

@LmanTW Damn missed that one, try with v8.0.2-2.

kmamal commented 4 months ago

Actually give me a minute, I just setup typescript and I'll try it out myself.

kmamal commented 4 months ago

@LmanTW With v8.0.2-5 it works for me.

LmanTW commented 4 months ago

Yep, it works fluently, thx!