Skip to content

GL

OpenGL wrappers for advanced rendering operations.

WARNING

Advanced rendering API - improper use may cause visual glitches. Use render methods when possible.

alpha

Enables or disables alpha testing.

java
gl.alpha(boolean enabled);

begin

Starts specifying vertices for a primitive shape.

java
gl.begin(int mode);

blend

Enables or disables blending.

java
gl.blend(boolean enabled);

color

Sets the current drawing color.

java
gl.color(int r, int g, int b, int a);
gl.color(double r, double g, double b, double a);
gl.color(float r, float g, float b, float a);
gl.color(int rgb);
gl.resetColor(); // set to white

cull

Enables or disables face culling.

java
gl.cull(boolean enabled);

depth

Enables or disables depth testing.

java
gl.depth(boolean enabled);

depthMask

Sets whether writing to the depth buffer is enabled.

java
gl.depthMask(boolean enabled);

disable

Disables an OpenGL capability.

java
gl.disable(int cap);

disableItemLighting

Disables standard item lighting.

java
gl.disableItemLighting();

enable

Enables an OpenGL capability.

java
gl.enable(int cap);

enableItemLighting

Enables standard item lighting. Set gui to true when rendering in GUIs.

java
gl.enableItemLighting(boolean gui);

end

Completes the current vertex specification.

java
gl.end();

lighting

Enables or disables lighting.

java
gl.lighting(boolean enabled);

lineSmooth

Enables or disables line smoothing.

java
gl.lineSmooth(boolean enabled);

lineWidth

Sets the width of lines.

java
gl.lineWidth(double width);
gl.lineWidth(float width);

normal

Specifies a normal vector for lighting calculations.

java
gl.normal(double x, double y, double z);
gl.normal(float x, float y, float z);

pop

Pops the current matrix stack.

java
gl.pop();

push

Pushes the current matrix stack.

java
gl.push();

rotate

Applies rotation around the specified axis.

java
gl.rotate(double angle, double x, double y, double z);
gl.rotate(float angle, float x, float y, float z);

scale

Scales the current transformation matrix.

java
gl.scale(double x, double y, double z);
gl.scale(float x, float y, float z);

scissor (box)

Sets the scissor rectangle.

java
gl.scissor(int x, int y, int width, int height);

scissor (toggle)

Enables or disables scissoring.

java
gl.scissor(boolean enabled);

texture2d

Enables or disables 2d texturing.

java
gl.texture2d(boolean enabled);

translate

Translates the current transformation matrix.

java
gl.translate(double x, double y, double z);
gl.translate(float x, float y, float z);

vertex2

Specifies a 2d vertex.

java
gl.vertex2(double x, double y);
gl.vertex2(float x, float y);

vertex3

Specifies a 3d vertex.

java
gl.vertex3(double x, double y, double z);
gl.vertex3(float x, float y, float z);