Skip to content

Instantly share code, notes, and snippets.

@elect86
Created August 26, 2019 17:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elect86/641c6c2f82a9896edef49a270b545ae2 to your computer and use it in GitHub Desktop.
Save elect86/641c6c2f82a9896edef49a270b545ae2 to your computer and use it in GitHub Desktop.
interface GlBufEco {
val buffers: GlBuffers
}
interface GlBufE
fun <E> Enum<E>.bind(target: BufferTarget) where E : Enum<E>, E : GlBufE = (Enum.Companion as GlBufEco).buffers[ordinal].bind(target)
enum class Buffer : GlBufE {
A;
companion object : GlBufEco {
override val buffers = GlBuffers<Buffer>()
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment