Skip to content

Commit

Permalink
Revert the glColor3ub hack (#30)
Browse files Browse the repository at this point in the history
It's not needed for LWJGL version 3.3.2-20230304.162250-10 and up.
  • Loading branch information
pftbest authored Mar 11, 2023
1 parent 8dadeb5 commit c47e58a
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions src/generated/java/org/lwjglx/opengl/GL11.java
Original file line number Diff line number Diff line change
Expand Up @@ -625,13 +625,8 @@ public static void glColor3f(float red, float green, float blue) {
org.lwjgl.opengl.GL11.glColor3f(red, green, blue);
}

private static final int UNSIGNED_BYTE_TO_INT_RATIO = Integer.MAX_VALUE / 255;

public static void glColor3ub(byte red, byte green, byte blue) {
org.lwjgl.opengl.GL11.glColor3i(
(red & 0xff) * UNSIGNED_BYTE_TO_INT_RATIO,
(green & 0xff) * UNSIGNED_BYTE_TO_INT_RATIO,
(blue & 0xff) * UNSIGNED_BYTE_TO_INT_RATIO);
org.lwjgl.opengl.GL11.glColor3ub(red, green, blue);
}

public static void glColor4b(byte red, byte green, byte blue, byte alpha) {
Expand All @@ -647,11 +642,7 @@ public static void glColor4f(float red, float green, float blue, float alpha) {
}

public static void glColor4ub(byte red, byte green, byte blue, byte alpha) {
org.lwjgl.opengl.GL11.glColor4i(
(red & 0xff) * UNSIGNED_BYTE_TO_INT_RATIO,
(green & 0xff) * UNSIGNED_BYTE_TO_INT_RATIO,
(blue & 0xff) * UNSIGNED_BYTE_TO_INT_RATIO,
(alpha & 0xff) * UNSIGNED_BYTE_TO_INT_RATIO);
org.lwjgl.opengl.GL11.glColor4ub(red, green, blue, alpha);
}

public static void glColorMask(boolean red, boolean green, boolean blue, boolean alpha) {
Expand Down

0 comments on commit c47e58a

Please sign in to comment.