Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HACK: Temporary workaround for glColor3ub crash on macOS #17

Merged
merged 1 commit into from
Feb 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/generated/java/org/lwjglx/opengl/GL11.java
Original file line number Diff line number Diff line change
Expand Up @@ -625,8 +625,13 @@ 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.glColor3ub(red, green, 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);
}

public static void glColor4b(byte red, byte green, byte blue, byte alpha) {
Expand Down