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.
Description
Section titled “Description”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.
Learn more
Section titled “Learn more”Methods
Section titled “Methods”Queries
Section titled “Queries”| Returns | Signature | Summary |
|---|---|---|
boolean | canPointClientMemory() default | If true, the binding can hand OpenGL a pointer into client memory; true by default. |
For subclasses
Section titled “For subclasses”| Returns | Signature | Summary |
|---|---|---|
void | enable(int capability) abstract | Turns a capability on. |
void | disable(int capability) abstract | Turns a capability off. |
boolean | isEnabled(int capability) abstract | If true, the capability is on. |
int | getInteger(int name) abstract | Returns the integer value of a state. |
String | getString(int name) abstract | Returns a string of the context, such as its version, or null when no context is current. |
String | getString(int name, int index) abstract | Returns one string of an indexed list, such as one extension. |
void | getFloats(int name, float[] values) abstract | Reads the float values of a state into the array. |
void | getIntegers(int name, int[] values) abstract | Reads the integer values of a state into the array. |
int | getVertexAttribi(int index, int name) abstract | Returns an integer state of a vertex attribute. |
long | getVertexAttribPointer(int index, int name) abstract | Returns the offset or the client pointer of a vertex attribute. |
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. |
void | clear(int mask) abstract | Clears the buffers named by the mask of the bound framebuffer. |
void | readBuffer(int buffer) abstract | Selects the color buffer that readPixels reads. |
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. |
void | clearDepth(double depth) abstract | Sets the depth that clear writes. |
void | clearStencil(int stencil) abstract | Sets the stencil value that clear writes. |
void | viewport(int x, int y, int width, int height) abstract | Sets the viewport, in pixels from the bottom-left corner. |
void | clearColor(float red, float green, float blue, float alpha) abstract | Sets the color that clear writes, each channel from 0F to 1F. |
void | colorMask(boolean red, boolean green, boolean blue, boolean alpha) abstract | Sets which color channels draws and clears write. |
void | blendEquationSeparate(int color, int alpha) abstract | Sets the blend equations of the color and of the alpha. |
void | blendFuncSeparate(int sourceColor, int destinationColor, int sourceAlpha, int destinationAlpha) abstract | Sets the blend factors of the color and of the alpha. |
void | depthFunc(int function) abstract | Sets the comparison of the depth test. |
void | depthMask(boolean write) abstract | If true, draws and clears write the depth. |
void | stencilMask(int mask) abstract | Sets the bits of the stencil that draws and clears write, on both faces. |
void | stencilMaskSeparate(int face, int mask) abstract | Sets the stencil write mask of one face. |
void | stencilOp(int fail, int depthFail, int pass) abstract | Sets the stencil operations on both faces. |
void | stencilFunc(int function, int reference, int mask) abstract | Sets the stencil test on both faces. |
void | stencilOpSeparate(int face, int fail, int depthFail, int pass) abstract | Sets the stencil operations of one face. |
void | stencilFuncSeparate(int face, int function, int reference, int mask) abstract | Sets the stencil test of one face. |
void | cullFace(int mode) abstract | Sets which faces culling removes. |
void | frontFace(int mode) abstract | Sets the winding of the front faces. |
void | lineWidth(float width) abstract | Sets the width of lines, in pixels. |
void | polygonMode(int face, int mode) abstract | Sets how polygons are rasterized: filled, lines or points. |
void | pixelStorei(int name, int value) abstract | Sets a pixel storage parameter of uploads and reads. |
int | genBuffer() abstract | Creates a buffer object and returns its name. |
void | bindBuffer(int target, int buffer) abstract | Binds a buffer object to a target. |
void | bufferData(int target, ByteBuffer data, int usage) abstract | Fills the buffer bound to the target with the remaining bytes of the data. |
int | genVertexArray() abstract | Creates a vertex array object and returns its name. |
void | bindVertexArray(int array) abstract | Binds a vertex array object, 0 for none. |
void | enableVertexAttribArray(int index) abstract | Reads the attribute from the vertex buffer. |
void | disableVertexAttribArray(int index) abstract | Stops reading the attribute from the vertex buffer: it takes its current value. |
void | vertexAttrib2f(int index, float x, float y) abstract | Sets the current value of an attribute with two components. |
void | vertexAttrib3f(int index, float x, float y, float z) abstract | Sets the current value of an attribute with three components. |
void | vertexAttrib4f(int index, float x, float y, float z, float w) abstract | Sets the current value of an attribute with four components. |
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. |
void | drawArrays(int mode, int first, int count) abstract | Draws vertices of the bound buffer as lines or triangles. |
int | createProgram() abstract | Creates a program and returns its name. |
void | deleteProgram(int program) abstract | Deletes a program. |
void | useProgram(int program) abstract | Makes a program current, 0 for none. |
void | linkProgram(int program) abstract | Links a program from its attached shaders. |
int | getProgrami(int program, int name) abstract | Returns an integer state of a program, such as its link status. |
String | getProgramInfoLog(int program) abstract | Returns the link log of a program. |
int | createShader(int type) abstract | Creates a vertex or fragment shader and returns its name. |
void | deleteShader(int shader) abstract | Deletes a shader. |
void | compileShader(int shader) abstract | Compiles a shader from its source. |
int | getShaderi(int shader, int name) abstract | Returns an integer state of a shader, such as its compile status. |
String | getShaderInfoLog(int shader) abstract | Returns the compile log of a shader. |
void | shaderSource(int shader, String source) abstract | Sets the GLSL source of a shader. |
void | attachShader(int program, int shader) abstract | Attaches a shader to a program. |
void | detachShader(int program, int shader) abstract | Detaches a shader from a program. |
void | bindAttribLocation(int program, int index, String name) abstract | Binds an attribute name to a location, before the link. |
void | bindFragDataLocation(int program, int color, String name) abstract | Binds a fragment output name to a color number, before the link. |
void | uniform1i(int location, int value) abstract | Sets an int or sampler uniform of the current program. |
int | getUniformLocation(int program, String name) abstract | Returns the location of a uniform, or -1 when the program has none of that name. |
void | uniformiv(int location, int components, IntBuffer values) abstract | Sets an integer uniform, or an array of them, of 1 to 4 components. |
void | uniformuiv(int location, int components, IntBuffer values) abstract | Sets an unsigned integer uniform, or an array of them, of 1 to 4 components. |
void | uniformfv(int location, int components, FloatBuffer values) abstract | Sets a float uniform, or an array of them, of 1 to 4 components. |
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. |
int | genTexture() abstract | Creates a texture and returns its name. |
void | deleteTexture(int texture) abstract | Deletes a texture. |
void | activeTexture(int unit) abstract | Selects the texture unit, from TEXTURE0. |
void | bindSampler(int unit, int sampler) abstract | Binds a sampler object to a unit, 0 to sample with the parameters of the texture. |
void | bindTexture(int target, int texture) abstract | Binds a texture to a target of the active unit. |
void | texParameteri(int target, int name, int value) abstract | Sets a parameter of the bound texture, such as its filter or its wrap. |
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. |
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. |
boolean | isTexture(int texture) abstract | If true, the name is a texture of the context. |
int | getTexParameteri(int target, int name) abstract | Returns an integer parameter of the bound texture. |
int | getTexLevelParameteri(int target, int level, int name) abstract | Returns an integer parameter of one level of the bound texture, such as its width. |
IGlFrameBufferBinding | getFrameBufferBinding(GlFrameBufferFamily family) abstract | Returns the framebuffer calls of that family: the core functions, or the functions of GL_EXT_framebuffer_object. |
Method details
Section titled “Method details”canPointClientMemory
Section titled “canPointClientMemory”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.
enable
Section titled “enable”void enable(int capability) abstract
Turns a capability on.
Maps to glEnable.
disable
Section titled “disable”void disable(int capability) abstract
Turns a capability off.
Maps to glDisable.
isEnabled
Section titled “isEnabled”boolean isEnabled(int capability) abstract
If true, the capability is on.
Maps to glIsEnabled.
getInteger
Section titled “getInteger”int getInteger(int name) abstract
Returns the integer value of a state.
Maps to glGetInteger.
getString
Section titled “getString”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.
getFloats
Section titled “getFloats”void getFloats(int name, float[] values) abstract
Reads the float values of a state into the array.
Maps to glGetFloatv.
getIntegers
Section titled “getIntegers”void getIntegers(int name, int[] values) abstract
Reads the integer values of a state into the array.
Maps to glGetIntegerv.
getVertexAttribi
Section titled “getVertexAttribi”int getVertexAttribi(int index, int name) abstract
Returns an integer state of a vertex attribute.
Maps to glGetVertexAttribiv.
getVertexAttribPointer
Section titled “getVertexAttribPointer”long getVertexAttribPointer(int index, int name) abstract
Returns the offset or the client pointer of a vertex attribute.
Maps to glGetVertexAttribPointerv.
getVertexAttribFloats
Section titled “getVertexAttribFloats”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.
readBuffer
Section titled “readBuffer”void readBuffer(int buffer) abstract
Selects the color buffer that readPixels reads.
Maps to glReadBuffer.
readPixels
Section titled “readPixels”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.
clearDepth
Section titled “clearDepth”void clearDepth(double depth) abstract
Sets the depth that clear writes.
Maps to glClearDepth.
clearStencil
Section titled “clearStencil”void clearStencil(int stencil) abstract
Sets the stencil value that clear writes.
Maps to glClearStencil.
viewport
Section titled “viewport”void viewport(int x, int y, int width, int height) abstract
Sets the viewport, in pixels from the bottom-left corner.
Maps to glViewport.
clearColor
Section titled “clearColor”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.
colorMask
Section titled “colorMask”void colorMask(boolean red, boolean green, boolean blue, boolean alpha) abstract
Sets which color channels draws and clears write.
Maps to glColorMask.
blendEquationSeparate
Section titled “blendEquationSeparate”void blendEquationSeparate(int color, int alpha) abstract
Sets the blend equations of the color and of the alpha.
Maps to glBlendEquationSeparate.
blendFuncSeparate
Section titled “blendFuncSeparate”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.
depthFunc
Section titled “depthFunc”void depthFunc(int function) abstract
Sets the comparison of the depth test.
Maps to glDepthFunc.
depthMask
Section titled “depthMask”void depthMask(boolean write) abstract
If true, draws and clears write the depth.
Maps to glDepthMask.
stencilMask
Section titled “stencilMask”void stencilMask(int mask) abstract
Sets the bits of the stencil that draws and clears write, on both faces.
Maps to glStencilMask.
stencilMaskSeparate
Section titled “stencilMaskSeparate”void stencilMaskSeparate(int face, int mask) abstract
Sets the stencil write mask of one face.
Maps to glStencilMaskSeparate.
stencilOp
Section titled “stencilOp”void stencilOp(int fail, int depthFail, int pass) abstract
Sets the stencil operations on both faces.
Maps to glStencilOp.
stencilFunc
Section titled “stencilFunc”void stencilFunc(int function, int reference, int mask) abstract
Sets the stencil test on both faces.
Maps to glStencilFunc.
stencilOpSeparate
Section titled “stencilOpSeparate”void stencilOpSeparate(int face, int fail, int depthFail, int pass) abstract
Sets the stencil operations of one face.
Maps to glStencilOpSeparate.
stencilFuncSeparate
Section titled “stencilFuncSeparate”void stencilFuncSeparate(int face, int function, int reference, int mask) abstract
Sets the stencil test of one face.
Maps to glStencilFuncSeparate.
cullFace
Section titled “cullFace”void cullFace(int mode) abstract
Sets which faces culling removes.
Maps to glCullFace.
frontFace
Section titled “frontFace”void frontFace(int mode) abstract
Sets the winding of the front faces.
Maps to glFrontFace.
lineWidth
Section titled “lineWidth”void lineWidth(float width) abstract
Sets the width of lines, in pixels.
Maps to glLineWidth.
polygonMode
Section titled “polygonMode”void polygonMode(int face, int mode) abstract
Sets how polygons are rasterized: filled, lines or points.
Maps to glPolygonMode.
pixelStorei
Section titled “pixelStorei”void pixelStorei(int name, int value) abstract
Sets a pixel storage parameter of uploads and reads.
Maps to glPixelStorei.
genBuffer
Section titled “genBuffer”int genBuffer() abstract
Creates a buffer object and returns its name.
Maps to glGenBuffers.
bindBuffer
Section titled “bindBuffer”void bindBuffer(int target, int buffer) abstract
Binds a buffer object to a target.
Maps to glBindBuffer.
bufferData
Section titled “bufferData”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.
genVertexArray
Section titled “genVertexArray”int genVertexArray() abstract
Creates a vertex array object and returns its name.
Maps to glGenVertexArrays.
bindVertexArray
Section titled “bindVertexArray”void bindVertexArray(int array) abstract
Binds a vertex array object, 0 for none.
Maps to glBindVertexArray.
enableVertexAttribArray
Section titled “enableVertexAttribArray”void enableVertexAttribArray(int index) abstract
Reads the attribute from the vertex buffer.
Maps to glEnableVertexAttribArray.
disableVertexAttribArray
Section titled “disableVertexAttribArray”void disableVertexAttribArray(int index) abstract
Stops reading the attribute from the vertex buffer: it takes its current value.
Maps to glDisableVertexAttribArray.
vertexAttrib2f
Section titled “vertexAttrib2f”void vertexAttrib2f(int index, float x, float y) abstract
Sets the current value of an attribute with two components.
Maps to glVertexAttrib2f.
vertexAttrib3f
Section titled “vertexAttrib3f”void vertexAttrib3f(int index, float x, float y, float z) abstract
Sets the current value of an attribute with three components.
Maps to glVertexAttrib3f.
vertexAttrib4f
Section titled “vertexAttrib4f”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.
vertexAttribPointer
Section titled “vertexAttribPointer”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.
drawArrays
Section titled “drawArrays”void drawArrays(int mode, int first, int count) abstract
Draws vertices of the bound buffer as lines or triangles.
Maps to glDrawArrays.
createProgram
Section titled “createProgram”int createProgram() abstract
Creates a program and returns its name.
Maps to glCreateProgram.
deleteProgram
Section titled “deleteProgram”void deleteProgram(int program) abstract
Deletes a program.
Maps to glDeleteProgram.
useProgram
Section titled “useProgram”void useProgram(int program) abstract
Makes a program current, 0 for none.
Maps to glUseProgram.
linkProgram
Section titled “linkProgram”void linkProgram(int program) abstract
Links a program from its attached shaders.
Maps to glLinkProgram.
getProgrami
Section titled “getProgrami”int getProgrami(int program, int name) abstract
Returns an integer state of a program, such as its link status.
Maps to glGetProgramiv.
getProgramInfoLog
Section titled “getProgramInfoLog”String getProgramInfoLog(int program) abstract
Returns the link log of a program.
Maps to glGetProgramInfoLog.
createShader
Section titled “createShader”int createShader(int type) abstract
Creates a vertex or fragment shader and returns its name.
Maps to glCreateShader.
deleteShader
Section titled “deleteShader”void deleteShader(int shader) abstract
Deletes a shader.
Maps to glDeleteShader.
compileShader
Section titled “compileShader”void compileShader(int shader) abstract
Compiles a shader from its source.
Maps to glCompileShader.
getShaderi
Section titled “getShaderi”int getShaderi(int shader, int name) abstract
Returns an integer state of a shader, such as its compile status.
Maps to glGetShaderiv.
getShaderInfoLog
Section titled “getShaderInfoLog”String getShaderInfoLog(int shader) abstract
Returns the compile log of a shader.
Maps to glGetShaderInfoLog.
shaderSource
Section titled “shaderSource”void shaderSource(int shader, String source) abstract
Sets the GLSL source of a shader.
Maps to glShaderSource.
attachShader
Section titled “attachShader”void attachShader(int program, int shader) abstract
Attaches a shader to a program.
Maps to glAttachShader.
detachShader
Section titled “detachShader”void detachShader(int program, int shader) abstract
Detaches a shader from a program.
Maps to glDetachShader.
bindAttribLocation
Section titled “bindAttribLocation”void bindAttribLocation(int program, int index, String name) abstract
Binds an attribute name to a location, before the link.
Maps to glBindAttribLocation.
bindFragDataLocation
Section titled “bindFragDataLocation”void bindFragDataLocation(int program, int color, String name) abstract
Binds a fragment output name to a color number, before the link.
Maps to glBindFragDataLocation.
uniform1i
Section titled “uniform1i”void uniform1i(int location, int value) abstract
Sets an int or sampler uniform of the current program.
Maps to glUniform1i.
getUniformLocation
Section titled “getUniformLocation”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.
uniformiv
Section titled “uniformiv”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.
uniformuiv
Section titled “uniformuiv”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.
uniformfv
Section titled “uniformfv”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.
uniformMatrixfv
Section titled “uniformMatrixfv”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.
genTexture
Section titled “genTexture”int genTexture() abstract
Creates a texture and returns its name.
Maps to glGenTextures.
deleteTexture
Section titled “deleteTexture”void deleteTexture(int texture) abstract
Deletes a texture.
Maps to glDeleteTextures.
activeTexture
Section titled “activeTexture”void activeTexture(int unit) abstract
Selects the texture unit, from TEXTURE0.
Maps to glActiveTexture.
bindSampler
Section titled “bindSampler”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.
bindTexture
Section titled “bindTexture”void bindTexture(int target, int texture) abstract
Binds a texture to a target of the active unit.
Maps to glBindTexture.
texParameteri
Section titled “texParameteri”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.
texImage2D
Section titled “texImage2D”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.
texSubImage2D
Section titled “texSubImage2D”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.
isTexture
Section titled “isTexture”boolean isTexture(int texture) abstract
If true, the name is a texture of the context.
Maps to glIsTexture.
getTexParameteri
Section titled “getTexParameteri”int getTexParameteri(int target, int name) abstract
Returns an integer parameter of the bound texture.
Maps to glGetTexParameteriv.
getTexLevelParameteri
Section titled “getTexLevelParameteri”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.
getFrameBufferBinding
Section titled “getFrameBufferBinding”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
