@@ -5946,13 +5946,19 @@ public void run(TomVM vm) {
59465946 }
59475947 }
59485948
5949- public static final class WrapglColor3ub implements Function {
5949+ public final class WrapglColor3ub implements Function {
59505950
59515951 public void run (TomVM vm ) {
5952- glColor3ub (
5953- vm .getIntParam (3 ).byteValue (),
5954- vm .getIntParam (2 ).byteValue (),
5955- vm .getIntParam (1 ).byteValue ());
5952+ // glColor3ub crashes on macOS - remap parameters to glColor3ubv
5953+ byteBuffer16 .rewind ();
5954+ byteBuffer16 .put (vm .getIntParam (3 ).byteValue ());
5955+ byteBuffer16 .put (vm .getIntParam (2 ).byteValue ());
5956+ byteBuffer16 .put (vm .getIntParam (1 ).byteValue ());
5957+
5958+ byteBuffer16 .rewind ();
5959+ glColor3ubv (byteBuffer16 );
5960+
5961+ byteBuffer16 .rewind ();
59565962 }
59575963 }
59585964
@@ -6352,14 +6358,20 @@ public void run(TomVM vm) {
63526358 }
63536359 }
63546360
6355- public static final class WrapglColor4ub implements Function {
6361+ public final class WrapglColor4ub implements Function {
63566362
63576363 public void run (TomVM vm ) {
6358- glColor4ub (
6359- vm .getIntParam (4 ).byteValue (),
6360- vm .getIntParam (3 ).byteValue (),
6361- vm .getIntParam (2 ).byteValue (),
6362- vm .getIntParam (1 ).byteValue ());
6364+ // glColor4ub crashes on macOS - remap parameters to glColor4ubv
6365+ byteBuffer16 .rewind ();
6366+ byteBuffer16 .put (vm .getIntParam (4 ).byteValue ());
6367+ byteBuffer16 .put (vm .getIntParam (3 ).byteValue ());
6368+ byteBuffer16 .put (vm .getIntParam (2 ).byteValue ());
6369+ byteBuffer16 .put (vm .getIntParam (1 ).byteValue ());
6370+
6371+ byteBuffer16 .rewind ();
6372+ glColor4ubv (byteBuffer16 );
6373+
6374+ byteBuffer16 .rewind ();
63636375 }
63646376 }
63656377
0 commit comments