Context
An OpenGL ES 3 context. Its methods are OpenGL ES's, called on the thread where it is current.
Static methods
function hxnAdopt(hxnRaw:Handle):ContextAn object for a value the library returned.
Properties
var hxnRaw:HandleMethods
function resizeWindow(width:Int, height:Int):VoidSets the size of the window the default framebuffer is, where EGL takes it from the program rather than the window system: Wayland. Elsewhere it does nothing.
function makeCurrent():VoidMakes the context current on the calling thread.
function swapBuffers():VoidPresents the window's back buffer, for a context made with createWindowContext.
function swapInterval(interval:Int):VoidThe number of vertical blanks swapBuffers waits for: 0 presents at once.
function renderer():StringGL_RENDERER.
function version():StringGL_VERSION.
function extensions():StringGL_EXTENSIONS, separated by spaces.
function error():IntglGetError: 0, or the first error since the last call.
function createBuffer(target:BufferTarget, size:Int64, usage:Usage):BufferA buffer of size bytes, uninitialized, for target.
function createBufferWith(target:BufferTarget, bytes:Bytes, usage:Usage):BufferA buffer holding bytes, for target.
function createTexture(width:Int, height:Int, format:TextureFormat):TextureA 2D texture of one level, with immutable storage.
function createSampler(min:Filter, mag:Filter, wrapS:Wrap, wrapT:Wrap):SamplerA sampler with these filters and wrap modes.
function createProgram(vertex:String, fragment:String):ProgramA program linked from GLSL ES 3.00 vertex and fragment sources. Compile and link errors are thrown with OpenGL ES's log.
function createVertexArray():VertexArrayAn empty vertex array.
function createFramebuffer(color:Texture):FramebufferA framebuffer rendering into color. Throws unless it is complete.
function bindFramebuffer(framebuffer:Framebuffer):VoidRenders into framebuffer from now on.
function bindDefaultFramebuffer():VoidRenders into the window from now on.
function viewport(x:Int, y:Int, width:Int, height:Int):Voidfunction scissor(x:Int, y:Int, width:Int, height:Int):Voidfunction clear(bits:Int, r:Float, g:Float, b:Float, a:Float):VoidClears the bound framebuffer's color, depth or stencil: bits are ClearBits or-ed together.
function useProgram(program:Program):Voidfunction bindVertexArray(vertexArray:VertexArray):Voidfunction bindUniformBuffer(index:Int, buffer:Buffer):VoidBinds buffer to uniform buffer binding point index.
function bindTexture(unit:Int, texture:Texture, sampler:Sampler):VoidBinds texture and sampler to texture unit unit.
function drawArrays(primitive:Primitive, first:Int, count:Int, instances:Int):VoidglDrawArraysInstanced.
function drawElements(primitive:Primitive, count:Int, kind:ComponentType, offset:Int, instances:Int):VoidglDrawElementsInstanced, with indices from the bound vertex array's element buffer, starting offset bytes in.
function readPixels(x:Int, y:Int, width:Int, height:Int):BytesThe bound framebuffer's pixels in a rectangle, as 8-bit RGBA, bottom row first.
function flush():VoidglFlush.
function finish():VoidglFinish: returns when the GPU has finished every command so far.
function completed():Future<Unit>Settles when the GPU has finished every command so far. It waits on an EGL fence from another thread; without EGL 1.5 and EGL_KHR_fence_sync it finishes here and is settled already.
function close():VoidReleases the native value now. The collector does it otherwise. Using this object afterwards throws.