GlUtil

object GlUtil

GlUtil contains a broad collection of graphics constants and utilities that are used in multiple places within the SDK

Properties

Link copied to clipboard

Texture coordinates in Normalized Device Coordinates, i.e. (0, 0) is bottom-left and (1, 1) is top-right.

Link copied to clipboard

Vertex coordinates in Normalized Device Coordinates, i.e. (-1, -1) is bottom-left and (1, 1) is top-right.

Functions

Link copied to clipboard

Checks to see if a OpenGLES error has been raised. Will throw exception if error raised since these mostly trigger on coder error (i.e. something that should be caught in testing like not using the same shared context)

Link copied to clipboard

Converts android.graphics.Matrix to a float16 matrix array used by surfaces and OpenGL.

Link copied to clipboard
fun convertToMatrix(transformMatrix: FloatArray): Matrix

Converts float16 matrix array used by surfaces and OpenGL to a android.graphics.Matrix.

Link copied to clipboard
fun createProgram(vertexSource: String, fragmentSource: String): Int

Creates a OpenGLES program from vertex and fragment shader sources. Will throw exception on failures since that usually indicates builder error.

Link copied to clipboard
fun generateTexture(target: Int): Int

Generate an OpenGLES texture with standard parameters.