gergelydaniel / kgl

Lightweight OpenGL abstraction for Kotlin Multiplatform
MIT License
38 stars 9 forks source link

Allow different implementations of TextureResource #20

Open wakaztahir opened 9 months ago

wakaztahir commented 9 months ago

Use Case

Android has GL calls to allow providing a Bitmap as texture data, Currently you need to copy the bitmap to a buffer before you can pass it to Kgl

Solution : Introduce TextureAsset interface, Make TextureResource implementation of TextureAsset

TextureResource can be a deprecated typealias for BufferTextureAsset (Later)

The only CON with this solution is that anyone can implement TextureAsset, in my opinion that is OK since

I've implemented it in the linked pull request, except for the iOS platform since I work on windows !

wakaztahir commented 9 months ago

@gergelydaniel Could you please let me know your thoughts about this