> For the complete documentation index, see [llms.txt](https://daikirai.gitbook.io/scripting/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://daikirai.gitbook.io/scripting/documentation/gl.md).

# gl

{% hint style="warning" %}
advanced rendering api - improper use may cause visual glitches. use [`render`](/scripting/documentation/render.md) methods when possible.
{% endhint %}

### 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);
```
