fabmax / kool

An OpenGL / WebGPU engine for Desktop JVM, Android and Javascript written in Kotlin
https://fabmax.github.io/kool/kool-js
Apache License 2.0
273 stars 16 forks source link

Suggestion for getTexImage wrapper #29

Closed andrey-zakharov closed 1 year ago

andrey-zakharov commented 1 year ago

Hello. I've just saw latest commits with same getTexImage wrapper method (copyToBufferedImage), but it has narrow usage and has some internal logic to pack data to make buffered image. I'm suggesting move out all such things out of LoadedTexture to clients and remain only write to TextureData data, as buffer-with-format passed to cross-platform method. Clients could easily manipulate TextureData.buffer, or just make BufferedImage( TextureData ).

What do you think? Thanks

fabmax commented 1 year ago

Yes good idea. I added a few comments but looks good in general