Commit b8400106bb5ffbe3efe60c7caa712d110c769d8c

Authored by Mumfrey
1 parent 4844b5bd

Extend and update GL convenience class, add GLU and some missing methods

src/client/java/com/mumfrey/liteloader/gl/GL.java
... ... @@ -834,6 +834,140 @@ public class GL
834 834 public static final int GL_SRC0_ALPHA = 0x8588;
835 835 public static final int GL_SRC1_ALPHA = 0x8589;
836 836 public static final int GL_SRC2_ALPHA = 0x858a;
  837 +
  838 + // GLU
  839 + public static final int GLU_INVALID_ENUM = GLU.GLU_INVALID_ENUM;
  840 + public static final int GLU_INVALID_VALUE = GLU.GLU_INVALID_VALUE;
  841 + public static final int GLU_OUT_OF_MEMORY = GLU.GLU_OUT_OF_MEMORY;
  842 + public static final int GLU_INCOMPATIBLE_GL_VERSION = GLU.GLU_INCOMPATIBLE_GL_VERSION;
  843 +
  844 + public static final int GLU_VERSION = GLU.GLU_VERSION;
  845 + public static final int GLU_EXTENSIONS = GLU.GLU_EXTENSIONS;
  846 +
  847 + public static final boolean GLU_TRUE = GLU.GLU_TRUE;
  848 + public static final boolean GLU_FALSE = GLU.GLU_FALSE;
  849 +
  850 + public static final int GLU_SMOOTH = GLU.GLU_SMOOTH;
  851 + public static final int GLU_FLAT = GLU.GLU_FLAT;
  852 + public static final int GLU_NONE = GLU.GLU_NONE;
  853 +
  854 + public static final int GLU_POINT = GLU.GLU_POINT;
  855 + public static final int GLU_LINE = GLU.GLU_LINE;
  856 + public static final int GLU_FILL = GLU.GLU_FILL;
  857 + public static final int GLU_SILHOUETTE = GLU.GLU_SILHOUETTE;
  858 +
  859 + public static final int GLU_OUTSIDE = GLU.GLU_OUTSIDE;
  860 + public static final int GLU_INSIDE = GLU.GLU_INSIDE;
  861 +
  862 + public static final double GLU_TESS_MAX_COORD = GLU.GLU_TESS_MAX_COORD;
  863 + public static final double TESS_MAX_COORD = GLU.TESS_MAX_COORD;
  864 +
  865 + public static final int GLU_TESS_WINDING_RULE = GLU.GLU_TESS_WINDING_RULE;
  866 + public static final int GLU_TESS_BOUNDARY_ONLY = GLU.GLU_TESS_BOUNDARY_ONLY;
  867 + public static final int GLU_TESS_TOLERANCE = GLU.GLU_TESS_TOLERANCE;
  868 +
  869 + public static final int GLU_TESS_WINDING_ODD = GLU.GLU_TESS_WINDING_ODD;
  870 + public static final int GLU_TESS_WINDING_NONZERO = GLU.GLU_TESS_WINDING_NONZERO;
  871 + public static final int GLU_TESS_WINDING_POSITIVE = GLU.GLU_TESS_WINDING_POSITIVE;
  872 + public static final int GLU_TESS_WINDING_NEGATIVE = GLU.GLU_TESS_WINDING_NEGATIVE;
  873 + public static final int GLU_TESS_WINDING_ABS_GEQ_TWO = GLU.GLU_TESS_WINDING_ABS_GEQ_TWO;
  874 +
  875 + public static final int GLU_TESS_BEGIN = GLU.GLU_TESS_BEGIN;
  876 + public static final int GLU_TESS_VERTEX = GLU.GLU_TESS_VERTEX;
  877 + public static final int GLU_TESS_END = GLU.GLU_TESS_END;
  878 + public static final int GLU_TESS_ERROR = GLU.GLU_TESS_ERROR;
  879 + public static final int GLU_TESS_EDGE_FLAG = GLU.GLU_TESS_EDGE_FLAG;
  880 + public static final int GLU_TESS_COMBINE = GLU.GLU_TESS_COMBINE;
  881 + public static final int GLU_TESS_BEGIN_DATA = GLU.GLU_TESS_BEGIN_DATA;
  882 + public static final int GLU_TESS_VERTEX_DATA = GLU.GLU_TESS_VERTEX_DATA;
  883 + public static final int GLU_TESS_END_DATA = GLU.GLU_TESS_END_DATA;
  884 + public static final int GLU_TESS_ERROR_DATA = GLU.GLU_TESS_ERROR_DATA;
  885 + public static final int GLU_TESS_EDGE_FLAG_DATA = GLU.GLU_TESS_EDGE_FLAG_DATA;
  886 + public static final int GLU_TESS_COMBINE_DATA = GLU.GLU_TESS_COMBINE_DATA;
  887 + public static final int GLU_TESS_ERROR1 = GLU.GLU_TESS_ERROR1;
  888 + public static final int GLU_TESS_ERROR2 = GLU.GLU_TESS_ERROR2;
  889 + public static final int GLU_TESS_ERROR3 = GLU.GLU_TESS_ERROR3;
  890 + public static final int GLU_TESS_ERROR4 = GLU.GLU_TESS_ERROR4;
  891 + public static final int GLU_TESS_ERROR5 = GLU.GLU_TESS_ERROR5;
  892 + public static final int GLU_TESS_ERROR6 = GLU.GLU_TESS_ERROR6;
  893 + public static final int GLU_TESS_ERROR7 = GLU.GLU_TESS_ERROR7;
  894 + public static final int GLU_TESS_ERROR8 = GLU.GLU_TESS_ERROR8;
  895 +
  896 + public static final int GLU_TESS_MISSING_BEGIN_POLYGON = GLU.GLU_TESS_MISSING_BEGIN_POLYGON;
  897 + public static final int GLU_TESS_MISSING_BEGIN_CONTOUR = GLU.GLU_TESS_MISSING_BEGIN_CONTOUR;
  898 + public static final int GLU_TESS_MISSING_END_POLYGON = GLU.GLU_TESS_MISSING_END_POLYGON;
  899 + public static final int GLU_TESS_MISSING_END_CONTOUR = GLU.GLU_TESS_MISSING_END_CONTOUR;
  900 + public static final int GLU_TESS_COORD_TOO_LARGE = GLU.GLU_TESS_COORD_TOO_LARGE;
  901 + public static final int GLU_TESS_NEED_COMBINE_CALLBACK = GLU.GLU_TESS_NEED_COMBINE_CALLBACK;
  902 +
  903 + public static final int GLU_AUTO_LOAD_MATRIX = GLU.GLU_AUTO_LOAD_MATRIX;
  904 + public static final int GLU_CULLING = GLU.GLU_CULLING;
  905 + public static final int GLU_SAMPLING_TOLERANCE = GLU.GLU_SAMPLING_TOLERANCE;
  906 + public static final int GLU_DISPLAY_MODE = GLU.GLU_DISPLAY_MODE;
  907 + public static final int GLU_PARAMETRIC_TOLERANCE = GLU.GLU_PARAMETRIC_TOLERANCE;
  908 + public static final int GLU_SAMPLING_METHOD = GLU.GLU_SAMPLING_METHOD;
  909 + public static final int GLU_U_STEP = GLU.GLU_U_STEP;
  910 + public static final int GLU_V_STEP = GLU.GLU_V_STEP;
  911 +
  912 + public static final int GLU_PATH_LENGTH = GLU.GLU_PATH_LENGTH;
  913 + public static final int GLU_PARAMETRIC_ERROR = GLU.GLU_PARAMETRIC_ERROR;
  914 + public static final int GLU_DOMAIN_DISTANCE = GLU.GLU_DOMAIN_DISTANCE;
  915 +
  916 + public static final int GLU_MAP1_TRIM_2 = GLU.GLU_MAP1_TRIM_2;
  917 + public static final int GLU_MAP1_TRIM_3 = GLU.GLU_MAP1_TRIM_3;
  918 +
  919 + public static final int GLU_OUTLINE_POLYGON = GLU.GLU_OUTLINE_POLYGON;
  920 + public static final int GLU_OUTLINE_PATCH = GLU.GLU_OUTLINE_PATCH;
  921 +
  922 + public static final int GLU_NURBS_ERROR1 = GLU.GLU_NURBS_ERROR1;
  923 + public static final int GLU_NURBS_ERROR2 = GLU.GLU_NURBS_ERROR2;
  924 + public static final int GLU_NURBS_ERROR3 = GLU.GLU_NURBS_ERROR3;
  925 + public static final int GLU_NURBS_ERROR4 = GLU.GLU_NURBS_ERROR4;
  926 + public static final int GLU_NURBS_ERROR5 = GLU.GLU_NURBS_ERROR5;
  927 + public static final int GLU_NURBS_ERROR6 = GLU.GLU_NURBS_ERROR6;
  928 + public static final int GLU_NURBS_ERROR7 = GLU.GLU_NURBS_ERROR7;
  929 + public static final int GLU_NURBS_ERROR8 = GLU.GLU_NURBS_ERROR8;
  930 + public static final int GLU_NURBS_ERROR9 = GLU.GLU_NURBS_ERROR9;
  931 + public static final int GLU_NURBS_ERROR10 = GLU.GLU_NURBS_ERROR10;
  932 + public static final int GLU_NURBS_ERROR11 = GLU.GLU_NURBS_ERROR11;
  933 + public static final int GLU_NURBS_ERROR12 = GLU.GLU_NURBS_ERROR12;
  934 + public static final int GLU_NURBS_ERROR13 = GLU.GLU_NURBS_ERROR13;
  935 + public static final int GLU_NURBS_ERROR14 = GLU.GLU_NURBS_ERROR14;
  936 + public static final int GLU_NURBS_ERROR15 = GLU.GLU_NURBS_ERROR15;
  937 + public static final int GLU_NURBS_ERROR16 = GLU.GLU_NURBS_ERROR16;
  938 + public static final int GLU_NURBS_ERROR17 = GLU.GLU_NURBS_ERROR17;
  939 + public static final int GLU_NURBS_ERROR18 = GLU.GLU_NURBS_ERROR18;
  940 + public static final int GLU_NURBS_ERROR19 = GLU.GLU_NURBS_ERROR19;
  941 + public static final int GLU_NURBS_ERROR20 = GLU.GLU_NURBS_ERROR20;
  942 + public static final int GLU_NURBS_ERROR21 = GLU.GLU_NURBS_ERROR21;
  943 + public static final int GLU_NURBS_ERROR22 = GLU.GLU_NURBS_ERROR22;
  944 + public static final int GLU_NURBS_ERROR23 = GLU.GLU_NURBS_ERROR23;
  945 + public static final int GLU_NURBS_ERROR24 = GLU.GLU_NURBS_ERROR24;
  946 + public static final int GLU_NURBS_ERROR25 = GLU.GLU_NURBS_ERROR25;
  947 + public static final int GLU_NURBS_ERROR26 = GLU.GLU_NURBS_ERROR26;
  948 + public static final int GLU_NURBS_ERROR27 = GLU.GLU_NURBS_ERROR27;
  949 + public static final int GLU_NURBS_ERROR28 = GLU.GLU_NURBS_ERROR28;
  950 + public static final int GLU_NURBS_ERROR29 = GLU.GLU_NURBS_ERROR29;
  951 + public static final int GLU_NURBS_ERROR30 = GLU.GLU_NURBS_ERROR30;
  952 + public static final int GLU_NURBS_ERROR31 = GLU.GLU_NURBS_ERROR31;
  953 + public static final int GLU_NURBS_ERROR32 = GLU.GLU_NURBS_ERROR32;
  954 + public static final int GLU_NURBS_ERROR33 = GLU.GLU_NURBS_ERROR33;
  955 + public static final int GLU_NURBS_ERROR34 = GLU.GLU_NURBS_ERROR34;
  956 + public static final int GLU_NURBS_ERROR35 = GLU.GLU_NURBS_ERROR35;
  957 + public static final int GLU_NURBS_ERROR36 = GLU.GLU_NURBS_ERROR36;
  958 + public static final int GLU_NURBS_ERROR37 = GLU.GLU_NURBS_ERROR37;
  959 +
  960 + public static final int GLU_CW = GLU.GLU_CW;
  961 + public static final int GLU_CCW = GLU.GLU_CCW;
  962 + public static final int GLU_INTERIOR = GLU.GLU_INTERIOR;
  963 + public static final int GLU_EXTERIOR = GLU.GLU_EXTERIOR;
  964 + public static final int GLU_UNKNOWN = GLU.GLU_UNKNOWN;
  965 +
  966 + public static final int GLU_BEGIN = GLU.GLU_BEGIN;
  967 + public static final int GLU_VERTEX = GLU.GLU_VERTEX;
  968 + public static final int GLU_END = GLU.GLU_END;
  969 + public static final int GLU_ERROR = GLU.GLU_ERROR;
  970 + public static final int GLU_EDGE_FLAG = GLU.GLU_EDGE_FLAG;
837 971  
838 972 public static void glPushAttrib()
839 973 {
... ... @@ -888,12 +1022,12 @@ public class GL
888 1022  
889 1023 public static void glLight(int light, int pname, FloatBuffer params)
890 1024 {
891   - GL11.glLight(light, pname, params);
  1025 + GlStateManager.glLight(light, pname, params);
892 1026 }
893 1027  
894 1028 public static void glLightModel(int pname, FloatBuffer params)
895 1029 {
896   - GL11.glLightModel(pname, params);
  1030 + GlStateManager.glLightModel(pname, params);
897 1031 }
898 1032  
899 1033 public static void glLightModeli(int pname, int param)
... ... @@ -988,12 +1122,12 @@ public class GL
988 1122  
989 1123 public static void glSetFogColour(FloatBuffer colour)
990 1124 {
991   - GL11.glFog(GL_FOG_COLOR, colour);
  1125 + GlStateManager.glFog(GL_FOG_COLOR, colour);
992 1126 }
993 1127  
994 1128 public static void glFogi(int pname, int param)
995 1129 {
996   - GL11.glFogi(pname, param);
  1130 + GlStateManager.glFogi(pname, param);
997 1131 }
998 1132  
999 1133 public static void glFogf(int pname, float param)
... ... @@ -1271,7 +1405,22 @@ public class GL
1271 1405 {
1272 1406 GlStateManager.resetColor();
1273 1407 }
  1408 +
  1409 + public static void glEnableClientState(int cap)
  1410 + {
  1411 + GlStateManager.glEnableClientState(cap);
  1412 + }
  1413 +
  1414 + public static void glDisableClientState(int cap)
  1415 + {
  1416 + GlStateManager.glDisableClientState(cap);
  1417 + }
1274 1418  
  1419 + public static void glDrawArrays(int mode, int first, int count)
  1420 + {
  1421 + GlStateManager.glDrawArrays(mode, first, count);
  1422 + }
  1423 +
1275 1424 public static void glCallList(int list)
1276 1425 {
1277 1426 GlStateManager.callList(list);
... ... @@ -1281,30 +1430,40 @@ public class GL
1281 1430 {
1282 1431 GL11.glCallLists(lists);
1283 1432 }
  1433 +
  1434 + public static int glGenLists(int range)
  1435 + {
  1436 + return GlStateManager.glGenLists(range);
  1437 + }
1284 1438  
1285 1439 public static void glNewList(int list, int mode)
1286 1440 {
1287   - GL11.glNewList(list, mode);
  1441 + GlStateManager.glNewList(list, mode);
1288 1442 }
1289 1443  
1290 1444 public static void glEndList()
1291 1445 {
1292   - GL11.glEndList();
  1446 + GlStateManager.glEndList();
  1447 + }
  1448 +
  1449 + public static void glDeleteLists(int list, int range)
  1450 + {
  1451 + GlStateManager.glDeleteLists(list, range);
1293 1452 }
1294 1453  
1295 1454 public static void glLineWidth(float width)
1296 1455 {
1297   - GL11.glLineWidth(width);
  1456 + GlStateManager.glLineWidth(width);
1298 1457 }
1299 1458  
1300 1459 public static void glPolygonMode(int face, int mode)
1301 1460 {
1302   - GL11.glPolygonMode(face, mode);
  1461 + GlStateManager.glPolygonMode(face, mode);
1303 1462 }
1304 1463  
1305 1464 public static void glPixelStorei(int pname, int param)
1306 1465 {
1307   - GL11.glPixelStorei(pname, param);
  1466 + GlStateManager.glPixelStorei(pname, param);
1308 1467 }
1309 1468  
1310 1469 public static void glReadPixels(int x, int y, int width, int height, int format, int type, ByteBuffer pixels)
... ... @@ -1312,8 +1471,58 @@ public class GL
1312 1471 GL11.glReadPixels(x, y, width, height, format, type, pixels);
1313 1472 }
1314 1473  
  1474 + public static void glReadPixels(int x, int y, int width, int height, int format, int type, IntBuffer pixels)
  1475 + {
  1476 + GlStateManager.glReadPixels(x, y, width, height, format, type, pixels);
  1477 + }
  1478 +
1315 1479 public static void glGetTexImage(int target, int level, int format, int type, ByteBuffer pixels)
1316 1480 {
1317 1481 GL11.glGetTexImage(target, level, format, type, pixels);
1318 1482 }
  1483 +
  1484 + public static void glGetTexImage(int target, int level, int format, int type, IntBuffer pixels)
  1485 + {
  1486 + GlStateManager.glGetTexImage(target, level, format, type, pixels);
  1487 + }
  1488 +
  1489 + public static void glNormalPointer(int stride, FloatBuffer pointer)
  1490 + {
  1491 + GL11.glNormalPointer(stride, pointer);
  1492 + }
  1493 +
  1494 + public static void glNormalPointer(int type, int stride, ByteBuffer pointer)
  1495 + {
  1496 + GlStateManager.glNormalPointer(type, stride, pointer);
  1497 + }
  1498 +
  1499 + public static void glTexCoordPointer(int size, int stride, FloatBuffer pointer)
  1500 + {
  1501 + GL11.glTexCoordPointer(size, stride, pointer);
  1502 + }
  1503 +
  1504 + public static void glTexCoordPointer(int size, int type, int stride, int pointerBufferOffset)
  1505 + {
  1506 + GlStateManager.glTexCoordPointer(size, type, stride, pointerBufferOffset);
  1507 + }
  1508 +
  1509 + public static void glTexCoordPointer(int size, int type, int stride, ByteBuffer pointer)
  1510 + {
  1511 + GlStateManager.glTexCoordPointer(size, type, stride, pointer);
  1512 + }
  1513 +
  1514 + public static void glVertexPointer(int size, int stride, FloatBuffer pointer)
  1515 + {
  1516 + GL11.glVertexPointer(size, stride, pointer);
  1517 + }
  1518 +
  1519 + public static void glVertexPointer(int size, int type, int stride, ByteBuffer pointer)
  1520 + {
  1521 + GlStateManager.glVertexPointer(size, type, stride, pointer);
  1522 + }
  1523 +
  1524 + public static void glEdgeFlagPointer(int stride, ByteBuffer pointer)
  1525 + {
  1526 + GL11.glEdgeFlagPointer(stride, pointer);
  1527 + }
1319 1528 }
... ...