gergelydaniel / kgl

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

Allow passing null as glTexImage2d Buffer #18

Open wakaztahir opened 8 months ago

wakaztahir commented 8 months ago

I tried passing an empty buffer but that didn't work

My codebase explicitly passed null and it works on Android, I don't know about other platforms, An android only solution or multiplatform solution should be tried

   // null can be passed as buffer in android codebase
   GLES20.glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0,
        GL_RGBA, GL_UNSIGNED_BYTE, null
   )
wakaztahir commented 8 months ago

https://stackoverflow.com/questions/70790469/glteximage2d-null-data-pointer-and-memory-initialization