Skip to content

IGlBinding

interface IGlBinding
Known subtypes: JournalGlBinding, Lwjgl2GlBinding, Lwjgl3GlBinding
Package: dev.joid.base.opengl.binding · Module: base-opengl · Source: IGlBinding.java
Backends: LWJGL 2 LWJGL 3

The OpenGL calls of the OpenGL module, one method per OpenGL function, implemented once per library.

GlRenderBridge calls OpenGL only through a binding, so base-opengl compiles against no LWJGL version: pass Lwjgl3GlBinding, Lwjgl2GlBinding or the OpenGL functions of your engine. The arguments are the values of GlConstants; a binding passes them to OpenGL unchanged and adds no check. Every method runs on the render thread, with the context of JOID current.

ReturnsSignatureSummary
booleancanPointClientMemory() defaultIf true, the binding can hand OpenGL a pointer into client memory; true by default.
ReturnsSignatureSummary
voidenable(int capability) abstractTurns a capability on.
voiddisable(int capability) abstractTurns a capability off.
booleanisEnabled(int capability) abstractIf true, the capability is on.
intgetInteger(int name) abstractReturns the integer value of a state.
StringgetString(int name) abstractReturns a string of the context, such as its version, or null when no context is current.
StringgetString(int name, int index) abstractReturns one string of an indexed list, such as one extension.
voidgetFloats(int name, float[] values) abstractReads the float values of a state into the array.
voidgetIntegers(int name, int[] values) abstractReads the integer values of a state into the array.
intgetVertexAttribi(int index, int name) abstractReturns an integer state of a vertex attribute.
longgetVertexAttribPointer(int index, int name) abstractReturns the offset or the client pointer of a vertex attribute.
voidgetVertexAttribFloats(int index, int name, float[] values) abstractReads the float values of a vertex attribute state, such as its current value, into the array.
voidclear(int mask) abstractClears the buffers named by the mask of the bound framebuffer.
voidreadBuffer(int buffer) abstractSelects the color buffer that readPixels reads.
voidreadPixels(int x, int y, int width, int height, int format, int type, ByteBuffer pixels) abstractReads a rectangle of pixels of the read framebuffer into the buffer.
voidclearDepth(double depth) abstractSets the depth that clear writes.
voidclearStencil(int stencil) abstractSets the stencil value that clear writes.
voidviewport(int x, int y, int width, int height) abstractSets the viewport, in pixels from the bottom-left corner.
voidclearColor(float red, float green, float blue, float alpha) abstractSets the color that clear writes, each channel from 0F to 1F.
voidcolorMask(boolean red, boolean green, boolean blue, boolean alpha) abstractSets which color channels draws and clears write.
voidblendEquationSeparate(int color, int alpha) abstractSets the blend equations of the color and of the alpha.
voidblendFuncSeparate(int sourceColor, int destinationColor, int sourceAlpha, int destinationAlpha) abstractSets the blend factors of the color and of the alpha.
voiddepthFunc(int function) abstractSets the comparison of the depth test.
voiddepthMask(boolean write) abstractIf true, draws and clears write the depth.
voidstencilMask(int mask) abstractSets the bits of the stencil that draws and clears write, on both faces.
voidstencilMaskSeparate(int face, int mask) abstractSets the stencil write mask of one face.
voidstencilOp(int fail, int depthFail, int pass) abstractSets the stencil operations on both faces.
voidstencilFunc(int function, int reference, int mask) abstractSets the stencil test on both faces.
voidstencilOpSeparate(int face, int fail, int depthFail, int pass) abstractSets the stencil operations of one face.
voidstencilFuncSeparate(int face, int function, int reference, int mask) abstractSets the stencil test of one face.
voidcullFace(int mode) abstractSets which faces culling removes.
voidfrontFace(int mode) abstractSets the winding of the front faces.
voidlineWidth(float width) abstractSets the width of lines, in pixels.
voidpolygonMode(int face, int mode) abstractSets how polygons are rasterized: filled, lines or points.
voidpixelStorei(int name, int value) abstractSets a pixel storage parameter of uploads and reads.
intgenBuffer() abstractCreates a buffer object and returns its name.
voidbindBuffer(int target, int buffer) abstractBinds a buffer object to a target.
voidbufferData(int target, ByteBuffer data, int usage) abstractFills the buffer bound to the target with the remaining bytes of the data.
intgenVertexArray() abstractCreates a vertex array object and returns its name.
voidbindVertexArray(int array) abstractBinds a vertex array object, 0 for none.
voidenableVertexAttribArray(int index) abstractReads the attribute from the vertex buffer.
voiddisableVertexAttribArray(int index) abstractStops reading the attribute from the vertex buffer: it takes its current value.
voidvertexAttrib2f(int index, float x, float y) abstractSets the current value of an attribute with two components.
voidvertexAttrib3f(int index, float x, float y, float z) abstractSets the current value of an attribute with three components.
voidvertexAttrib4f(int index, float x, float y, float z, float w) abstractSets the current value of an attribute with four components.
voidvertexAttribPointer(int index, int size, int type, boolean normalized, int stride, long offset) abstractPoints an attribute at the bound array buffer, with its size, type, stride and byte offset.
voiddrawArrays(int mode, int first, int count) abstractDraws vertices of the bound buffer as lines or triangles.
intcreateProgram() abstractCreates a program and returns its name.
voiddeleteProgram(int program) abstractDeletes a program.
voiduseProgram(int program) abstractMakes a program current, 0 for none.
voidlinkProgram(int program) abstractLinks a program from its attached shaders.
intgetProgrami(int program, int name) abstractReturns an integer state of a program, such as its link status.
StringgetProgramInfoLog(int program) abstractReturns the link log of a program.
intcreateShader(int type) abstractCreates a vertex or fragment shader and returns its name.
voiddeleteShader(int shader) abstractDeletes a shader.
voidcompileShader(int shader) abstractCompiles a shader from its source.
intgetShaderi(int shader, int name) abstractReturns an integer state of a shader, such as its compile status.
StringgetShaderInfoLog(int shader) abstractReturns the compile log of a shader.
voidshaderSource(int shader, String source) abstractSets the GLSL source of a shader.
voidattachShader(int program, int shader) abstractAttaches a shader to a program.
voiddetachShader(int program, int shader) abstractDetaches a shader from a program.
voidbindAttribLocation(int program, int index, String name) abstractBinds an attribute name to a location, before the link.
voidbindFragDataLocation(int program, int color, String name) abstractBinds a fragment output name to a color number, before the link.
voiduniform1i(int location, int value) abstractSets an int or sampler uniform of the current program.
intgetUniformLocation(int program, String name) abstractReturns the location of a uniform, or -1 when the program has none of that name.
voiduniformiv(int location, int components, IntBuffer values) abstractSets an integer uniform, or an array of them, of 1 to 4 components.
voiduniformuiv(int location, int components, IntBuffer values) abstractSets an unsigned integer uniform, or an array of them, of 1 to 4 components.
voiduniformfv(int location, int components, FloatBuffer values) abstractSets a float uniform, or an array of them, of 1 to 4 components.
voiduniformMatrixfv(int location, int columns, FloatBuffer values) abstractSets a square matrix uniform of 2, 3 or 4 columns, column-major and not transposed.
intgenTexture() abstractCreates a texture and returns its name.
voiddeleteTexture(int texture) abstractDeletes a texture.
voidactiveTexture(int unit) abstractSelects the texture unit, from TEXTURE0.
voidbindSampler(int unit, int sampler) abstractBinds a sampler object to a unit, 0 to sample with the parameters of the texture.
voidbindTexture(int target, int texture) abstractBinds a texture to a target of the active unit.
voidtexParameteri(int target, int name, int value) abstractSets a parameter of the bound texture, such as its filter or its wrap.
voidtexImage2D(int target, int level, int internalFormat, int width, int height, int format, int type) abstractAllocates one level of the bound texture, without pixels.
voidtexSubImage2D(int target, int level, int x, int y, int width, int height, int format, int type, int[] pixels) abstractUploads a rectangle of pixels into one level of the bound texture.
booleanisTexture(int texture) abstractIf true, the name is a texture of the context.
intgetTexParameteri(int target, int name) abstractReturns an integer parameter of the bound texture.
intgetTexLevelParameteri(int target, int level, int name) abstractReturns an integer parameter of one level of the bound texture, such as its width.
IGlFrameBufferBindinggetFrameBufferBinding(GlFrameBufferFamily family) abstractReturns the framebuffer calls of that family: the core functions, or the functions of GL_EXT_framebuffer_object.

boolean canPointClientMemory() default

If true, the binding can hand OpenGL a pointer into client memory; true by default. Return false when it cannot: the state guard then leaves the client vertex arrays of a compatibility host as they are.

void enable(int capability) abstract

Turns a capability on. Maps to glEnable.

void disable(int capability) abstract

Turns a capability off. Maps to glDisable.

boolean isEnabled(int capability) abstract

If true, the capability is on. Maps to glIsEnabled.

int getInteger(int name) abstract

Returns the integer value of a state. Maps to glGetInteger.

String getString(int name) abstract

Returns a string of the context, such as its version, or null when no context is current. Maps to glGetString.

String getString(int name, int index) abstract

Returns one string of an indexed list, such as one extension. Maps to glGetStringi.

void getFloats(int name, float[] values) abstract

Reads the float values of a state into the array. Maps to glGetFloatv.

void getIntegers(int name, int[] values) abstract

Reads the integer values of a state into the array. Maps to glGetIntegerv.

int getVertexAttribi(int index, int name) abstract

Returns an integer state of a vertex attribute. Maps to glGetVertexAttribiv.

long getVertexAttribPointer(int index, int name) abstract

Returns the offset or the client pointer of a vertex attribute. Maps to glGetVertexAttribPointerv.

void getVertexAttribFloats(int index, int name, float[] values) abstract

Reads the float values of a vertex attribute state, such as its current value, into the array. Maps to glGetVertexAttribfv.

void clear(int mask) abstract

Clears the buffers named by the mask of the bound framebuffer. Maps to glClear.

void readBuffer(int buffer) abstract

Selects the color buffer that readPixels reads. Maps to glReadBuffer.

void readPixels(int x, int y, int width, int height, int format, int type, ByteBuffer pixels) abstract

Reads a rectangle of pixels of the read framebuffer into the buffer. Maps to glReadPixels.

void clearDepth(double depth) abstract

Sets the depth that clear writes. Maps to glClearDepth.

void clearStencil(int stencil) abstract

Sets the stencil value that clear writes. Maps to glClearStencil.

void viewport(int x, int y, int width, int height) abstract

Sets the viewport, in pixels from the bottom-left corner. Maps to glViewport.

void clearColor(float red, float green, float blue, float alpha) abstract

Sets the color that clear writes, each channel from 0F to 1F. Maps to glClearColor.

void colorMask(boolean red, boolean green, boolean blue, boolean alpha) abstract

Sets which color channels draws and clears write. Maps to glColorMask.

void blendEquationSeparate(int color, int alpha) abstract

Sets the blend equations of the color and of the alpha. Maps to glBlendEquationSeparate.

void blendFuncSeparate(int sourceColor, int destinationColor, int sourceAlpha, int destinationAlpha) abstract

Sets the blend factors of the color and of the alpha. Maps to glBlendFuncSeparate.

void depthFunc(int function) abstract

Sets the comparison of the depth test. Maps to glDepthFunc.

void depthMask(boolean write) abstract

If true, draws and clears write the depth. Maps to glDepthMask.

void stencilMask(int mask) abstract

Sets the bits of the stencil that draws and clears write, on both faces. Maps to glStencilMask.

void stencilMaskSeparate(int face, int mask) abstract

Sets the stencil write mask of one face. Maps to glStencilMaskSeparate.

void stencilOp(int fail, int depthFail, int pass) abstract

Sets the stencil operations on both faces. Maps to glStencilOp.

void stencilFunc(int function, int reference, int mask) abstract

Sets the stencil test on both faces. Maps to glStencilFunc.

void stencilOpSeparate(int face, int fail, int depthFail, int pass) abstract

Sets the stencil operations of one face. Maps to glStencilOpSeparate.

void stencilFuncSeparate(int face, int function, int reference, int mask) abstract

Sets the stencil test of one face. Maps to glStencilFuncSeparate.

void cullFace(int mode) abstract

Sets which faces culling removes. Maps to glCullFace.

void frontFace(int mode) abstract

Sets the winding of the front faces. Maps to glFrontFace.

void lineWidth(float width) abstract

Sets the width of lines, in pixels. Maps to glLineWidth.

void polygonMode(int face, int mode) abstract

Sets how polygons are rasterized: filled, lines or points. Maps to glPolygonMode.

void pixelStorei(int name, int value) abstract

Sets a pixel storage parameter of uploads and reads. Maps to glPixelStorei.

int genBuffer() abstract

Creates a buffer object and returns its name. Maps to glGenBuffers.

void bindBuffer(int target, int buffer) abstract

Binds a buffer object to a target. Maps to glBindBuffer.

void bufferData(int target, ByteBuffer data, int usage) abstract

Fills the buffer bound to the target with the remaining bytes of the data. Maps to glBufferData.

int genVertexArray() abstract

Creates a vertex array object and returns its name. Maps to glGenVertexArrays.

void bindVertexArray(int array) abstract

Binds a vertex array object, 0 for none. Maps to glBindVertexArray.

void enableVertexAttribArray(int index) abstract

Reads the attribute from the vertex buffer. Maps to glEnableVertexAttribArray.

void disableVertexAttribArray(int index) abstract

Stops reading the attribute from the vertex buffer: it takes its current value. Maps to glDisableVertexAttribArray.

void vertexAttrib2f(int index, float x, float y) abstract

Sets the current value of an attribute with two components. Maps to glVertexAttrib2f.

void vertexAttrib3f(int index, float x, float y, float z) abstract

Sets the current value of an attribute with three components. Maps to glVertexAttrib3f.

void vertexAttrib4f(int index, float x, float y, float z, float w) abstract

Sets the current value of an attribute with four components. Maps to glVertexAttrib4f.

void vertexAttribPointer(int index, int size, int type, boolean normalized, int stride, long offset) abstract

Points an attribute at the bound array buffer, with its size, type, stride and byte offset. Maps to glVertexAttribPointer.

void drawArrays(int mode, int first, int count) abstract

Draws vertices of the bound buffer as lines or triangles. Maps to glDrawArrays.

int createProgram() abstract

Creates a program and returns its name. Maps to glCreateProgram.

void deleteProgram(int program) abstract

Deletes a program. Maps to glDeleteProgram.

void useProgram(int program) abstract

Makes a program current, 0 for none. Maps to glUseProgram.

void linkProgram(int program) abstract

Links a program from its attached shaders. Maps to glLinkProgram.

int getProgrami(int program, int name) abstract

Returns an integer state of a program, such as its link status. Maps to glGetProgramiv.

String getProgramInfoLog(int program) abstract

Returns the link log of a program. Maps to glGetProgramInfoLog.

int createShader(int type) abstract

Creates a vertex or fragment shader and returns its name. Maps to glCreateShader.

void deleteShader(int shader) abstract

Deletes a shader. Maps to glDeleteShader.

void compileShader(int shader) abstract

Compiles a shader from its source. Maps to glCompileShader.

int getShaderi(int shader, int name) abstract

Returns an integer state of a shader, such as its compile status. Maps to glGetShaderiv.

String getShaderInfoLog(int shader) abstract

Returns the compile log of a shader. Maps to glGetShaderInfoLog.

void shaderSource(int shader, String source) abstract

Sets the GLSL source of a shader. Maps to glShaderSource.

void attachShader(int program, int shader) abstract

Attaches a shader to a program. Maps to glAttachShader.

void detachShader(int program, int shader) abstract

Detaches a shader from a program. Maps to glDetachShader.

void bindAttribLocation(int program, int index, String name) abstract

Binds an attribute name to a location, before the link. Maps to glBindAttribLocation.

void bindFragDataLocation(int program, int color, String name) abstract

Binds a fragment output name to a color number, before the link. Maps to glBindFragDataLocation.

void uniform1i(int location, int value) abstract

Sets an int or sampler uniform of the current program. Maps to glUniform1i.

int getUniformLocation(int program, String name) abstract

Returns the location of a uniform, or -1 when the program has none of that name. Maps to glGetUniformLocation.

void uniformiv(int location, int components, IntBuffer values) abstract

Sets an integer uniform, or an array of them, of 1 to 4 components. Maps to glUniform1iv to glUniform4iv.

void uniformuiv(int location, int components, IntBuffer values) abstract

Sets an unsigned integer uniform, or an array of them, of 1 to 4 components. Maps to glUniform1uiv to glUniform4uiv.

void uniformfv(int location, int components, FloatBuffer values) abstract

Sets a float uniform, or an array of them, of 1 to 4 components. Maps to glUniform1fv to glUniform4fv.

void uniformMatrixfv(int location, int columns, FloatBuffer values) abstract

Sets a square matrix uniform of 2, 3 or 4 columns, column-major and not transposed. Maps to glUniformMatrix2fv to glUniformMatrix4fv.

int genTexture() abstract

Creates a texture and returns its name. Maps to glGenTextures.

void deleteTexture(int texture) abstract

Deletes a texture. Maps to glDeleteTextures.

void activeTexture(int unit) abstract

Selects the texture unit, from TEXTURE0. Maps to glActiveTexture.

void bindSampler(int unit, int sampler) abstract

Binds a sampler object to a unit, 0 to sample with the parameters of the texture. Maps to glBindSampler.

void bindTexture(int target, int texture) abstract

Binds a texture to a target of the active unit. Maps to glBindTexture.

void texParameteri(int target, int name, int value) abstract

Sets a parameter of the bound texture, such as its filter or its wrap. Maps to glTexParameteri.

void texImage2D(int target, int level, int internalFormat, int width, int height, int format, int type) abstract

Allocates one level of the bound texture, without pixels. Maps to glTexImage2D.

void texSubImage2D(int target, int level, int x, int y, int width, int height, int format, int type, int[] pixels) abstract

Uploads a rectangle of pixels into one level of the bound texture. Maps to glTexSubImage2D.

boolean isTexture(int texture) abstract

If true, the name is a texture of the context. Maps to glIsTexture.

int getTexParameteri(int target, int name) abstract

Returns an integer parameter of the bound texture. Maps to glGetTexParameteriv.

int getTexLevelParameteri(int target, int level, int name) abstract

Returns an integer parameter of one level of the bound texture, such as its width. Maps to glGetTexLevelParameteriv.

IGlFrameBufferBinding getFrameBufferBinding(GlFrameBufferFamily family) abstract

Returns the framebuffer calls of that family: the core functions, or the functions of GL_EXT_framebuffer_object.


fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses

Report a problem with this page