Skip to content
zeganstyl edited this page Sep 18, 2020 · 1 revision

Most of Thelema objects uses GL object. It is singleton, that implements IGL and delegates all it's functions to proxy.

Each platform has own IGL implementation. If you want, you can implement this interface and replace proxy.

GL provides functions from OpenGL ES 3 API. In addition to the standard functions, it has properties that allow you to get or set some OpenGL value. For example, to set some texture as active, you wrote glActiveTexture(unit), but with GL, you can write GL.activeTexture = unit. GL remembers these values and doesn't call OpenGL functions once again if the value hasn't changed.

All OpenGL constants are stored in this file. You have to import org.ksdfv.thelema.gl.* to use them.

OpenGL functions can be called only from main thread, so if you want to call some OpenGL function from another thread, you must use GL.call {}

GL.call {
	GL.glUseProgram(0)
}

GL.render {} can be used repeat some functions in main loop, for example rendering.

GL.render {
	GL.glClear(GL_COLOR_BUFFER_BIT)
}
Clone this wiki locally