diff --git a/build.xml b/build.xml index d7b195b2..d4f2f3e0 100644 --- a/build.xml +++ b/build.xml @@ -457,6 +457,8 @@ + + diff --git a/platform_build/build-definitions.xml b/platform_build/build-definitions.xml index 426ab048..3f2fc322 100644 --- a/platform_build/build-definitions.xml +++ b/platform_build/build-definitions.xml @@ -27,6 +27,7 @@ + diff --git a/src/java/org/lwjgl/LWJGLIconData.java b/src/java/org/lwjgl/LWJGLIconData.java new file mode 100644 index 00000000..428f9bfd --- /dev/null +++ b/src/java/org/lwjgl/LWJGLIconData.java @@ -0,0 +1,201 @@ +package org.lwjgl; + +final class LWJGLIconData { + static final String ICON_16x16 = + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + + "\377\377\377\377\377\377\377\377\376\377\377\377\302\327\350\377" + + "\164\244\313\377\120\213\275\377\124\216\277\377\206\257\322\377" + + "\347\357\366\377\377\377\377\377\377\377\377\377\377\377\377\377" + + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + + "\377\377\377\377\365\365\365\377\215\217\221\377\166\202\215\377" + + "\175\215\233\377\204\231\252\377\224\267\325\377\072\175\265\377" + + "\110\206\272\377\332\347\361\377\377\377\377\377\377\377\377\377" + + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + + "\364\370\373\377\234\236\240\377\000\000\000\377\000\000\000\377" + + "\000\000\000\377\000\000\000\377\344\344\344\377\204\255\320\377" + + "\072\175\265\377\133\222\301\377\374\375\376\377\377\377\377\377" + + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + + "\221\266\325\377\137\137\137\377\000\000\000\377\000\000\000\377" + + "\000\000\000\377\042\042\042\377\377\377\377\377\350\360\366\377" + + "\071\174\265\377\072\175\265\377\304\330\351\377\377\377\377\377" + + "\377\377\377\377\377\377\377\377\377\377\377\377\306\331\351\377" + + "\201\253\316\377\035\035\035\377\000\000\000\377\000\000\000\377" + + "\000\000\000\377\146\146\146\377\377\377\377\377\320\340\355\377" + + "\072\175\265\377\072\175\265\377\215\264\324\377\377\377\377\377" + + "\362\362\362\377\245\245\245\377\337\337\337\377\242\301\334\377" + + "\260\305\326\377\012\012\012\377\000\000\000\377\000\000\000\377" + + "\000\000\000\377\250\250\250\377\377\377\377\377\227\272\330\377" + + "\072\175\265\377\072\175\265\377\161\241\312\377\377\377\377\377" + + "\241\241\241\377\000\000\000\377\001\001\001\377\043\043\043\377" + + "\314\314\314\377\320\320\320\377\245\245\245\377\204\204\204\377" + + "\134\134\134\377\357\357\357\377\377\377\377\377\140\226\303\377" + + "\072\175\265\377\072\175\265\377\155\236\310\377\377\377\377\377" + + "\136\136\136\377\000\000\000\377\000\000\000\377\000\000\000\377" + + "\317\317\317\377\037\037\037\377\003\003\003\377\053\053\053\377" + + "\154\154\154\377\306\306\306\377\372\374\375\377\236\277\332\377" + + "\167\245\314\377\114\211\274\377\174\250\316\377\377\377\377\377" + + "\033\033\033\377\000\000\000\377\000\000\000\377\027\027\027\377" + + "\326\326\326\377\001\001\001\377\000\000\000\377\000\000\000\377" + + "\000\000\000\377\122\122\122\377\345\345\345\377\075\075\075\377" + + "\150\150\150\377\246\246\247\377\332\336\341\377\377\377\377\377" + + "\164\164\164\377\016\016\016\377\000\000\000\377\131\131\131\377" + + "\225\225\225\377\000\000\000\377\000\000\000\377\000\000\000\377" + + "\000\000\000\377\221\221\221\377\233\233\233\377\000\000\000\377" + + "\000\000\000\377\000\000\000\377\002\002\002\377\103\103\103\377" + + "\377\377\377\377\356\356\356\377\214\214\214\377\277\277\277\377" + + "\126\126\126\377\000\000\000\377\000\000\000\377\000\000\000\377" + + "\000\000\000\377\323\323\323\377\130\130\130\377\000\000\000\377" + + "\000\000\000\377\000\000\000\377\000\000\000\377\063\063\063\377" + + "\377\377\377\377\377\377\377\377\374\375\376\377\377\377\377\377" + + "\300\300\300\377\100\100\100\377\002\002\002\377\000\000\000\377" + + "\033\033\033\377\373\373\373\377\027\027\027\377\000\000\000\377" + + "\000\000\000\377\000\000\000\377\000\000\000\377\170\170\170\377" + + "\377\377\377\377\377\377\377\377\322\341\356\377\176\251\316\377" + + "\340\352\363\377\377\377\377\377\324\324\324\377\155\155\155\377" + + "\204\204\204\377\323\323\323\377\000\000\000\377\000\000\000\377" + + "\000\000\000\377\000\000\000\377\000\000\000\377\275\275\275\377" + + "\377\377\377\377\377\377\377\377\376\376\376\377\146\232\305\377" + + "\075\177\266\377\202\254\320\377\344\355\365\377\377\377\377\377" + + "\377\377\377\377\345\345\345\377\055\055\055\377\000\000\000\377" + + "\000\000\000\377\000\000\000\377\014\014\014\377\366\366\366\377" + + "\377\377\377\377\377\377\377\377\377\377\377\377\342\354\364\377" + + "\115\211\274\377\072\175\265\377\076\200\266\377\207\260\322\377" + + "\347\357\366\377\377\377\377\377\376\376\376\377\274\274\274\377" + + "\117\117\117\377\003\003\003\377\112\112\112\377\377\377\377\377" + + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + + "\353\362\370\377\214\263\324\377\126\220\300\377\120\214\275\377" + + "\167\245\314\377\355\363\370\377\377\377\377\377\377\377\377\377" + + "\377\377\377\377\337\337\337\377\346\346\346\377\377\377\377\377"; + + static final String ICON_32x32 = + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\372\374\375\377" + + "\313\335\354\377\223\267\326\377\157\240\311\377\134\223\302\377\140\226\303\377\172\247\315\377\254\310\340\377\355\363\370\377" + + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\374\375\376\377\265\316\343\377\132\222\301\377" + + "\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\105\205\271\377" + + "\241\301\334\377\374\375\376\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\374\374\374\377\342\352\361\377\270\317\343\377\256\311\340\377" + + "\243\302\334\377\230\272\330\377\214\263\323\377\201\254\317\377\156\237\310\377\075\177\266\377\072\175\265\377\072\175\265\377" + + "\072\175\265\377\162\242\312\377\365\370\373\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + + "\377\377\377\377\377\377\377\377\377\377\377\377\330\330\330\377\061\061\061\377\044\044\044\377\061\061\061\377\100\100\100\377" + + "\122\122\122\377\145\145\145\377\164\164\164\377\217\217\217\377\367\370\370\377\254\310\337\377\073\175\265\377\072\175\265\377" + + "\072\175\265\377\072\175\265\377\171\247\315\377\374\375\376\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + + "\377\377\377\377\377\377\377\377\376\376\376\377\150\150\150\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" + + "\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\266\266\266\377\376\376\376\377\206\256\321\377\072\175\265\377" + + "\072\175\265\377\072\175\265\377\072\175\265\377\256\312\341\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + + "\377\377\377\377\323\342\356\377\341\352\362\377\050\050\050\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" + + "\000\000\000\377\000\000\000\377\000\000\000\377\002\002\002\377\336\336\336\377\377\377\377\377\365\370\373\377\133\222\301\377" + + "\072\175\265\377\072\175\265\377\072\175\265\377\110\206\272\377\364\370\373\377\377\377\377\377\377\377\377\377\377\377\377\377" + + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + + "\354\363\370\377\144\231\305\377\327\331\333\377\005\005\005\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" + + "\000\000\000\377\000\000\000\377\000\000\000\377\044\044\044\377\376\376\376\377\377\377\377\377\377\377\377\377\300\325\347\377" + + "\071\174\265\377\072\175\265\377\072\175\265\377\072\175\265\377\253\310\340\377\377\377\377\377\377\377\377\377\377\377\377\377" + + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\376\377\377\377" + + "\170\246\314\377\173\247\315\377\236\236\236\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" + + "\000\000\000\377\000\000\000\377\000\000\000\377\145\145\145\377\377\377\377\377\377\377\377\377\377\377\377\377\342\354\364\377" + + "\067\173\264\377\072\175\265\377\072\175\265\377\072\175\265\377\146\232\305\377\377\377\377\377\377\377\377\377\377\377\377\377" + + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\303\327\350\377" + + "\071\175\265\377\262\314\341\377\130\130\130\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" + + "\000\000\000\377\000\000\000\377\000\000\000\377\251\251\251\377\377\377\377\377\377\377\377\377\377\377\377\377\274\322\345\377" + + "\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\100\201\267\377\356\364\371\377\377\377\377\377\377\377\377\377" + + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\372\374\375\377\132\222\301\377" + + "\075\177\266\377\335\345\355\377\034\034\034\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" + + "\000\000\000\377\000\000\000\377\007\007\007\377\347\347\347\377\377\377\377\377\377\377\377\377\377\377\377\377\205\256\321\377" + + "\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\071\175\265\377\314\336\354\377\377\377\377\377\377\377\377\377" + + "\377\377\377\377\377\377\377\377\376\376\376\377\377\377\377\377\377\377\377\377\377\377\377\377\272\322\345\377\072\175\265\377" + + "\127\220\277\377\320\321\321\377\003\003\003\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" + + "\000\000\000\377\000\000\000\377\063\063\063\377\375\375\375\377\377\377\377\377\377\377\377\377\373\374\375\377\120\213\275\377" + + "\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\071\175\265\377\261\314\342\377\377\377\377\377\377\377\377\377" + + "\377\377\377\377\312\312\312\377\067\067\067\377\141\141\141\377\242\242\242\377\335\335\335\377\344\354\363\377\261\313\341\377" + + "\264\315\342\377\346\346\346\377\043\043\043\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" + + "\000\000\000\377\000\000\000\377\162\162\162\377\377\377\377\377\377\377\377\377\377\377\377\377\330\345\360\377\072\175\265\377" + + "\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\240\300\333\377\377\377\377\377\377\377\377\377" + + "\377\377\377\377\146\146\146\377\000\000\000\377\000\000\000\377\000\000\000\377\006\006\006\377\047\047\047\377\146\146\146\377" + + "\324\324\324\377\377\377\377\377\366\366\366\377\320\320\320\377\227\227\227\377\136\136\136\377\047\047\047\377\004\004\004\377" + + "\000\000\000\377\003\003\003\377\300\300\300\377\377\377\377\377\377\377\377\377\377\377\377\377\242\301\333\377\072\175\265\377" + + "\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\236\277\332\377\377\377\377\377\377\377\377\377" + + "\373\373\373\377\045\045\045\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" + + "\134\134\134\377\377\377\377\377\352\352\352\377\217\217\217\377\265\265\265\377\351\351\351\377\375\375\375\377\347\347\347\377" + + "\262\262\262\377\275\275\275\377\376\376\376\377\377\377\377\377\377\377\377\377\377\377\377\377\153\235\307\377\072\175\265\377" + + "\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\241\301\334\377\377\377\377\377\377\377\377\377" + + "\333\333\333\377\003\003\003\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" + + "\203\203\203\377\377\377\377\377\137\137\137\377\000\000\000\377\000\000\000\377\013\013\013\377\067\067\067\377\166\166\166\377" + + "\267\267\267\377\360\360\360\377\377\377\377\377\377\377\377\377\377\377\377\377\360\365\371\377\113\210\273\377\075\177\266\377" + + "\071\174\265\377\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\262\314\342\377\377\377\377\377\377\377\377\377" + + "\232\232\232\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" + + "\305\305\305\377\367\367\367\377\035\035\035\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" + + "\000\000\000\377\007\007\007\377\074\074\074\377\337\337\337\377\377\377\377\377\373\374\375\377\374\375\376\377\363\367\372\377" + + "\314\335\353\377\236\276\332\377\162\241\311\377\114\211\273\377\072\175\265\377\311\334\353\377\377\377\377\377\377\377\377\377" + + "\126\126\126\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\017\017\017\377" + + "\371\371\371\377\321\321\321\377\003\003\003\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" + + "\000\000\000\377\000\000\000\377\000\000\000\377\216\216\216\377\377\377\377\377\371\371\371\377\204\204\204\377\160\160\160\377" + + "\260\260\260\377\352\352\352\377\377\377\377\377\371\373\374\377\334\350\362\377\366\371\374\377\377\377\377\377\377\377\377\377" + + "\025\025\025\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\116\116\116\377" + + "\377\377\377\377\221\221\221\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" + + "\000\000\000\377\000\000\000\377\000\000\000\377\273\273\273\377\377\377\377\377\236\236\236\377\000\000\000\377\000\000\000\377" + + "\000\000\000\377\004\004\004\377\057\057\057\377\160\160\160\377\260\260\260\377\346\346\346\377\376\376\376\377\377\377\377\377" + + "\071\071\071\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\220\220\220\377" + + "\377\377\377\377\115\115\115\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" + + "\000\000\000\377\000\000\000\377\020\020\020\377\360\360\360\377\377\377\377\377\132\132\132\377\000\000\000\377\000\000\000\377" + + "\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\011\011\011\377\062\062\062\377\261\261\261\377" + + "\366\366\366\377\241\241\241\377\065\065\065\377\002\002\002\377\000\000\000\377\000\000\000\377\002\002\002\377\321\321\321\377" + + "\365\365\365\377\023\023\023\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" + + "\000\000\000\377\000\000\000\377\105\105\105\377\376\376\376\377\370\370\370\377\035\035\035\377\000\000\000\377\000\000\000\377" + + "\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\053\053\053\377" + + "\377\377\377\377\377\377\377\377\374\374\374\377\276\276\276\377\120\120\120\377\005\005\005\377\045\045\045\377\371\371\371\377" + + "\302\302\302\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" + + "\000\000\000\377\000\000\000\377\206\206\206\377\377\377\377\377\322\322\322\377\001\001\001\377\000\000\000\377\000\000\000\377" + + "\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\103\103\103\377" + + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\376\376\376\377\334\334\334\377\340\340\340\377\377\377\377\377" + + "\225\225\225\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" + + "\000\000\000\377\001\001\001\377\310\310\310\377\377\377\377\377\216\216\216\377\000\000\000\377\000\000\000\377\000\000\000\377" + + "\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\210\210\210\377" + + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + + "\337\337\337\377\051\051\051\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" + + "\000\000\000\377\030\030\030\377\365\365\365\377\377\377\377\377\112\112\112\377\000\000\000\377\000\000\000\377\000\000\000\377" + + "\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\317\317\317\377" + + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\361\366\372\377\377\377\377\377\377\377\377\377" + + "\377\377\377\377\371\371\371\377\265\265\265\377\113\113\113\377\006\006\006\377\000\000\000\377\000\000\000\377\000\000\000\377" + + "\000\000\000\377\122\122\122\377\377\377\377\377\370\370\370\377\020\020\020\377\000\000\000\377\000\000\000\377\000\000\000\377" + + "\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\034\034\034\377\370\370\370\377" + + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\206\257\321\377\220\265\325\377\352\361\367\377" + + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\333\333\333\377\170\170\170\377\033\033\033\377\000\000\000\377" + + "\000\000\000\377\226\226\226\377\377\377\377\377\306\306\306\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" + + "\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\132\132\132\377\377\377\377\377" + + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\303\330\351\377\072\175\265\377\103\203\270\377" + + "\224\270\326\377\355\363\370\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\364\364\364\377\247\247\247\377" + + "\205\205\205\377\364\364\364\377\377\377\377\377\206\206\206\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" + + "\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\235\235\235\377\377\377\377\377" + + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\372\373\375\377\135\224\302\377\072\175\265\377" + + "\072\175\265\377\106\205\271\377\230\273\330\377\357\364\371\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + + "\377\377\377\377\377\377\377\377\377\377\377\377\233\233\233\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" + + "\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\005\005\005\377\335\335\335\377\377\377\377\377" + + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\305\331\351\377\073\176\266\377" + + "\072\175\265\377\072\175\265\377\072\175\265\377\110\206\272\377\236\276\332\377\362\366\372\377\377\377\377\377\377\377\377\377" + + "\377\377\377\377\377\377\377\377\377\377\377\377\373\373\373\377\216\216\216\377\045\045\045\377\001\001\001\377\000\000\000\377" + + "\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\054\054\054\377\374\374\374\377\377\377\377\377" + + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\217\265\325\377" + + "\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\112\207\273\377\243\302\334\377\363\367\372\377" + + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\372\372\372\377\260\260\260\377\105\105\105\377" + + "\004\004\004\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\156\156\156\377\377\377\377\377\377\377\377\377" + + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\374\375\376\377" + + "\205\257\321\377\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\115\211\274\377" + + "\250\305\336\377\366\371\374\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\376\376\376\377" + + "\322\322\322\377\150\150\150\377\016\016\016\377\000\000\000\377\001\001\001\377\270\270\270\377\377\377\377\377\377\377\377\377" + + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + + "\376\376\377\377\261\313\342\377\114\211\274\377\071\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377" + + "\072\175\265\377\115\211\274\377\277\324\347\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + + "\377\377\377\377\377\377\377\377\354\354\354\377\223\223\223\377\233\233\233\377\375\375\375\377\377\377\377\377\377\377\377\377" + + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + + "\377\377\377\377\377\377\377\377\363\367\372\377\265\316\343\377\201\254\320\377\145\231\305\377\141\227\304\377\154\236\310\377" + + "\217\265\325\377\305\331\351\377\367\372\374\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"; + + private LWJGLIconData() {} +} diff --git a/src/java/org/lwjgl/LWJGLUtil.java b/src/java/org/lwjgl/LWJGLUtil.java index a11730a3..faa99d58 100644 --- a/src/java/org/lwjgl/LWJGLUtil.java +++ b/src/java/org/lwjgl/LWJGLUtil.java @@ -32,12 +32,18 @@ package org.lwjgl; import java.io.File; +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.nio.ByteBuffer; import java.util.*; +import dev.pfaff.unfettered.UnsafeUtil; + +import static java.lang.invoke.MethodType.methodType; + /** *

* Internal library methods @@ -55,207 +61,22 @@ public class LWJGLUtil { public static final String PLATFORM_MACOSX_NAME = "macosx"; public static final String PLATFORM_WINDOWS_NAME = "windows"; - private static final String LWJGL_ICON_DATA_16x16 = - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + - "\377\377\377\377\377\377\377\377\376\377\377\377\302\327\350\377" + - "\164\244\313\377\120\213\275\377\124\216\277\377\206\257\322\377" + - "\347\357\366\377\377\377\377\377\377\377\377\377\377\377\377\377" + - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + - "\377\377\377\377\365\365\365\377\215\217\221\377\166\202\215\377" + - "\175\215\233\377\204\231\252\377\224\267\325\377\072\175\265\377" + - "\110\206\272\377\332\347\361\377\377\377\377\377\377\377\377\377" + - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + - "\364\370\373\377\234\236\240\377\000\000\000\377\000\000\000\377" + - "\000\000\000\377\000\000\000\377\344\344\344\377\204\255\320\377" + - "\072\175\265\377\133\222\301\377\374\375\376\377\377\377\377\377" + - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + - "\221\266\325\377\137\137\137\377\000\000\000\377\000\000\000\377" + - "\000\000\000\377\042\042\042\377\377\377\377\377\350\360\366\377" + - "\071\174\265\377\072\175\265\377\304\330\351\377\377\377\377\377" + - "\377\377\377\377\377\377\377\377\377\377\377\377\306\331\351\377" + - "\201\253\316\377\035\035\035\377\000\000\000\377\000\000\000\377" + - "\000\000\000\377\146\146\146\377\377\377\377\377\320\340\355\377" + - "\072\175\265\377\072\175\265\377\215\264\324\377\377\377\377\377" + - "\362\362\362\377\245\245\245\377\337\337\337\377\242\301\334\377" + - "\260\305\326\377\012\012\012\377\000\000\000\377\000\000\000\377" + - "\000\000\000\377\250\250\250\377\377\377\377\377\227\272\330\377" + - "\072\175\265\377\072\175\265\377\161\241\312\377\377\377\377\377" + - "\241\241\241\377\000\000\000\377\001\001\001\377\043\043\043\377" + - "\314\314\314\377\320\320\320\377\245\245\245\377\204\204\204\377" + - "\134\134\134\377\357\357\357\377\377\377\377\377\140\226\303\377" + - "\072\175\265\377\072\175\265\377\155\236\310\377\377\377\377\377" + - "\136\136\136\377\000\000\000\377\000\000\000\377\000\000\000\377" + - "\317\317\317\377\037\037\037\377\003\003\003\377\053\053\053\377" + - "\154\154\154\377\306\306\306\377\372\374\375\377\236\277\332\377" + - "\167\245\314\377\114\211\274\377\174\250\316\377\377\377\377\377" + - "\033\033\033\377\000\000\000\377\000\000\000\377\027\027\027\377" + - "\326\326\326\377\001\001\001\377\000\000\000\377\000\000\000\377" + - "\000\000\000\377\122\122\122\377\345\345\345\377\075\075\075\377" + - "\150\150\150\377\246\246\247\377\332\336\341\377\377\377\377\377" + - "\164\164\164\377\016\016\016\377\000\000\000\377\131\131\131\377" + - "\225\225\225\377\000\000\000\377\000\000\000\377\000\000\000\377" + - "\000\000\000\377\221\221\221\377\233\233\233\377\000\000\000\377" + - "\000\000\000\377\000\000\000\377\002\002\002\377\103\103\103\377" + - "\377\377\377\377\356\356\356\377\214\214\214\377\277\277\277\377" + - "\126\126\126\377\000\000\000\377\000\000\000\377\000\000\000\377" + - "\000\000\000\377\323\323\323\377\130\130\130\377\000\000\000\377" + - "\000\000\000\377\000\000\000\377\000\000\000\377\063\063\063\377" + - "\377\377\377\377\377\377\377\377\374\375\376\377\377\377\377\377" + - "\300\300\300\377\100\100\100\377\002\002\002\377\000\000\000\377" + - "\033\033\033\377\373\373\373\377\027\027\027\377\000\000\000\377" + - "\000\000\000\377\000\000\000\377\000\000\000\377\170\170\170\377" + - "\377\377\377\377\377\377\377\377\322\341\356\377\176\251\316\377" + - "\340\352\363\377\377\377\377\377\324\324\324\377\155\155\155\377" + - "\204\204\204\377\323\323\323\377\000\000\000\377\000\000\000\377" + - "\000\000\000\377\000\000\000\377\000\000\000\377\275\275\275\377" + - "\377\377\377\377\377\377\377\377\376\376\376\377\146\232\305\377" + - "\075\177\266\377\202\254\320\377\344\355\365\377\377\377\377\377" + - "\377\377\377\377\345\345\345\377\055\055\055\377\000\000\000\377" + - "\000\000\000\377\000\000\000\377\014\014\014\377\366\366\366\377" + - "\377\377\377\377\377\377\377\377\377\377\377\377\342\354\364\377" + - "\115\211\274\377\072\175\265\377\076\200\266\377\207\260\322\377" + - "\347\357\366\377\377\377\377\377\376\376\376\377\274\274\274\377" + - "\117\117\117\377\003\003\003\377\112\112\112\377\377\377\377\377" + - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + - "\353\362\370\377\214\263\324\377\126\220\300\377\120\214\275\377" + - "\167\245\314\377\355\363\370\377\377\377\377\377\377\377\377\377" + - "\377\377\377\377\337\337\337\377\346\346\346\377\377\377\377\377"; + private static final MethodHandle MH_findLibrary; - private static final String LWJGL_ICON_DATA_32x32 = - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\372\374\375\377" + - "\313\335\354\377\223\267\326\377\157\240\311\377\134\223\302\377\140\226\303\377\172\247\315\377\254\310\340\377\355\363\370\377" + - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\374\375\376\377\265\316\343\377\132\222\301\377" + - "\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\105\205\271\377" + - "\241\301\334\377\374\375\376\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\374\374\374\377\342\352\361\377\270\317\343\377\256\311\340\377" + - "\243\302\334\377\230\272\330\377\214\263\323\377\201\254\317\377\156\237\310\377\075\177\266\377\072\175\265\377\072\175\265\377" + - "\072\175\265\377\162\242\312\377\365\370\373\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + - "\377\377\377\377\377\377\377\377\377\377\377\377\330\330\330\377\061\061\061\377\044\044\044\377\061\061\061\377\100\100\100\377" + - "\122\122\122\377\145\145\145\377\164\164\164\377\217\217\217\377\367\370\370\377\254\310\337\377\073\175\265\377\072\175\265\377" + - "\072\175\265\377\072\175\265\377\171\247\315\377\374\375\376\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + - "\377\377\377\377\377\377\377\377\376\376\376\377\150\150\150\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" + - "\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\266\266\266\377\376\376\376\377\206\256\321\377\072\175\265\377" + - "\072\175\265\377\072\175\265\377\072\175\265\377\256\312\341\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + - "\377\377\377\377\323\342\356\377\341\352\362\377\050\050\050\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" + - "\000\000\000\377\000\000\000\377\000\000\000\377\002\002\002\377\336\336\336\377\377\377\377\377\365\370\373\377\133\222\301\377" + - "\072\175\265\377\072\175\265\377\072\175\265\377\110\206\272\377\364\370\373\377\377\377\377\377\377\377\377\377\377\377\377\377" + - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + - "\354\363\370\377\144\231\305\377\327\331\333\377\005\005\005\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" + - "\000\000\000\377\000\000\000\377\000\000\000\377\044\044\044\377\376\376\376\377\377\377\377\377\377\377\377\377\300\325\347\377" + - "\071\174\265\377\072\175\265\377\072\175\265\377\072\175\265\377\253\310\340\377\377\377\377\377\377\377\377\377\377\377\377\377" + - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\376\377\377\377" + - "\170\246\314\377\173\247\315\377\236\236\236\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" + - "\000\000\000\377\000\000\000\377\000\000\000\377\145\145\145\377\377\377\377\377\377\377\377\377\377\377\377\377\342\354\364\377" + - "\067\173\264\377\072\175\265\377\072\175\265\377\072\175\265\377\146\232\305\377\377\377\377\377\377\377\377\377\377\377\377\377" + - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\303\327\350\377" + - "\071\175\265\377\262\314\341\377\130\130\130\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" + - "\000\000\000\377\000\000\000\377\000\000\000\377\251\251\251\377\377\377\377\377\377\377\377\377\377\377\377\377\274\322\345\377" + - "\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\100\201\267\377\356\364\371\377\377\377\377\377\377\377\377\377" + - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\372\374\375\377\132\222\301\377" + - "\075\177\266\377\335\345\355\377\034\034\034\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" + - "\000\000\000\377\000\000\000\377\007\007\007\377\347\347\347\377\377\377\377\377\377\377\377\377\377\377\377\377\205\256\321\377" + - "\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\071\175\265\377\314\336\354\377\377\377\377\377\377\377\377\377" + - "\377\377\377\377\377\377\377\377\376\376\376\377\377\377\377\377\377\377\377\377\377\377\377\377\272\322\345\377\072\175\265\377" + - "\127\220\277\377\320\321\321\377\003\003\003\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" + - "\000\000\000\377\000\000\000\377\063\063\063\377\375\375\375\377\377\377\377\377\377\377\377\377\373\374\375\377\120\213\275\377" + - "\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\071\175\265\377\261\314\342\377\377\377\377\377\377\377\377\377" + - "\377\377\377\377\312\312\312\377\067\067\067\377\141\141\141\377\242\242\242\377\335\335\335\377\344\354\363\377\261\313\341\377" + - "\264\315\342\377\346\346\346\377\043\043\043\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" + - "\000\000\000\377\000\000\000\377\162\162\162\377\377\377\377\377\377\377\377\377\377\377\377\377\330\345\360\377\072\175\265\377" + - "\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\240\300\333\377\377\377\377\377\377\377\377\377" + - "\377\377\377\377\146\146\146\377\000\000\000\377\000\000\000\377\000\000\000\377\006\006\006\377\047\047\047\377\146\146\146\377" + - "\324\324\324\377\377\377\377\377\366\366\366\377\320\320\320\377\227\227\227\377\136\136\136\377\047\047\047\377\004\004\004\377" + - "\000\000\000\377\003\003\003\377\300\300\300\377\377\377\377\377\377\377\377\377\377\377\377\377\242\301\333\377\072\175\265\377" + - "\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\236\277\332\377\377\377\377\377\377\377\377\377" + - "\373\373\373\377\045\045\045\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" + - "\134\134\134\377\377\377\377\377\352\352\352\377\217\217\217\377\265\265\265\377\351\351\351\377\375\375\375\377\347\347\347\377" + - "\262\262\262\377\275\275\275\377\376\376\376\377\377\377\377\377\377\377\377\377\377\377\377\377\153\235\307\377\072\175\265\377" + - "\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\241\301\334\377\377\377\377\377\377\377\377\377" + - "\333\333\333\377\003\003\003\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" + - "\203\203\203\377\377\377\377\377\137\137\137\377\000\000\000\377\000\000\000\377\013\013\013\377\067\067\067\377\166\166\166\377" + - "\267\267\267\377\360\360\360\377\377\377\377\377\377\377\377\377\377\377\377\377\360\365\371\377\113\210\273\377\075\177\266\377" + - "\071\174\265\377\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\262\314\342\377\377\377\377\377\377\377\377\377" + - "\232\232\232\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" + - "\305\305\305\377\367\367\367\377\035\035\035\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" + - "\000\000\000\377\007\007\007\377\074\074\074\377\337\337\337\377\377\377\377\377\373\374\375\377\374\375\376\377\363\367\372\377" + - "\314\335\353\377\236\276\332\377\162\241\311\377\114\211\273\377\072\175\265\377\311\334\353\377\377\377\377\377\377\377\377\377" + - "\126\126\126\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\017\017\017\377" + - "\371\371\371\377\321\321\321\377\003\003\003\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" + - "\000\000\000\377\000\000\000\377\000\000\000\377\216\216\216\377\377\377\377\377\371\371\371\377\204\204\204\377\160\160\160\377" + - "\260\260\260\377\352\352\352\377\377\377\377\377\371\373\374\377\334\350\362\377\366\371\374\377\377\377\377\377\377\377\377\377" + - "\025\025\025\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\116\116\116\377" + - "\377\377\377\377\221\221\221\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" + - "\000\000\000\377\000\000\000\377\000\000\000\377\273\273\273\377\377\377\377\377\236\236\236\377\000\000\000\377\000\000\000\377" + - "\000\000\000\377\004\004\004\377\057\057\057\377\160\160\160\377\260\260\260\377\346\346\346\377\376\376\376\377\377\377\377\377" + - "\071\071\071\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\220\220\220\377" + - "\377\377\377\377\115\115\115\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" + - "\000\000\000\377\000\000\000\377\020\020\020\377\360\360\360\377\377\377\377\377\132\132\132\377\000\000\000\377\000\000\000\377" + - "\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\011\011\011\377\062\062\062\377\261\261\261\377" + - "\366\366\366\377\241\241\241\377\065\065\065\377\002\002\002\377\000\000\000\377\000\000\000\377\002\002\002\377\321\321\321\377" + - "\365\365\365\377\023\023\023\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" + - "\000\000\000\377\000\000\000\377\105\105\105\377\376\376\376\377\370\370\370\377\035\035\035\377\000\000\000\377\000\000\000\377" + - "\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\053\053\053\377" + - "\377\377\377\377\377\377\377\377\374\374\374\377\276\276\276\377\120\120\120\377\005\005\005\377\045\045\045\377\371\371\371\377" + - "\302\302\302\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" + - "\000\000\000\377\000\000\000\377\206\206\206\377\377\377\377\377\322\322\322\377\001\001\001\377\000\000\000\377\000\000\000\377" + - "\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\103\103\103\377" + - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\376\376\376\377\334\334\334\377\340\340\340\377\377\377\377\377" + - "\225\225\225\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" + - "\000\000\000\377\001\001\001\377\310\310\310\377\377\377\377\377\216\216\216\377\000\000\000\377\000\000\000\377\000\000\000\377" + - "\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\210\210\210\377" + - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + - "\337\337\337\377\051\051\051\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" + - "\000\000\000\377\030\030\030\377\365\365\365\377\377\377\377\377\112\112\112\377\000\000\000\377\000\000\000\377\000\000\000\377" + - "\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\317\317\317\377" + - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\361\366\372\377\377\377\377\377\377\377\377\377" + - "\377\377\377\377\371\371\371\377\265\265\265\377\113\113\113\377\006\006\006\377\000\000\000\377\000\000\000\377\000\000\000\377" + - "\000\000\000\377\122\122\122\377\377\377\377\377\370\370\370\377\020\020\020\377\000\000\000\377\000\000\000\377\000\000\000\377" + - "\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\034\034\034\377\370\370\370\377" + - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\206\257\321\377\220\265\325\377\352\361\367\377" + - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\333\333\333\377\170\170\170\377\033\033\033\377\000\000\000\377" + - "\000\000\000\377\226\226\226\377\377\377\377\377\306\306\306\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" + - "\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\132\132\132\377\377\377\377\377" + - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\303\330\351\377\072\175\265\377\103\203\270\377" + - "\224\270\326\377\355\363\370\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\364\364\364\377\247\247\247\377" + - "\205\205\205\377\364\364\364\377\377\377\377\377\206\206\206\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" + - "\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\235\235\235\377\377\377\377\377" + - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\372\373\375\377\135\224\302\377\072\175\265\377" + - "\072\175\265\377\106\205\271\377\230\273\330\377\357\364\371\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + - "\377\377\377\377\377\377\377\377\377\377\377\377\233\233\233\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" + - "\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\005\005\005\377\335\335\335\377\377\377\377\377" + - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\305\331\351\377\073\176\266\377" + - "\072\175\265\377\072\175\265\377\072\175\265\377\110\206\272\377\236\276\332\377\362\366\372\377\377\377\377\377\377\377\377\377" + - "\377\377\377\377\377\377\377\377\377\377\377\377\373\373\373\377\216\216\216\377\045\045\045\377\001\001\001\377\000\000\000\377" + - "\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\054\054\054\377\374\374\374\377\377\377\377\377" + - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\217\265\325\377" + - "\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\112\207\273\377\243\302\334\377\363\367\372\377" + - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\372\372\372\377\260\260\260\377\105\105\105\377" + - "\004\004\004\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\156\156\156\377\377\377\377\377\377\377\377\377" + - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\374\375\376\377" + - "\205\257\321\377\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\115\211\274\377" + - "\250\305\336\377\366\371\374\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\376\376\376\377" + - "\322\322\322\377\150\150\150\377\016\016\016\377\000\000\000\377\001\001\001\377\270\270\270\377\377\377\377\377\377\377\377\377" + - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + - "\376\376\377\377\261\313\342\377\114\211\274\377\071\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377" + - "\072\175\265\377\115\211\274\377\277\324\347\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + - "\377\377\377\377\377\377\377\377\354\354\354\377\223\223\223\377\233\233\233\377\375\375\375\377\377\377\377\377\377\377\377\377" + - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + - "\377\377\377\377\377\377\377\377\363\367\372\377\265\316\343\377\201\254\320\377\145\231\305\377\141\227\304\377\154\236\310\377" + - "\217\265\325\377\305\331\351\377\367\372\374\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"; + static { + MethodHandles.Lookup l = UnsafeUtil.getTrustedLookup(); + try { + MH_findLibrary = l.findVirtual(ClassLoader.class, "findLibrary", methodType(String.class, String.class)); + } catch (ReflectiveOperationException e) { + throw new RuntimeException("Failed to get a MethodHandle for the findLibrary method", e); + } + } /** LWJGL Logo - 16 by 16 pixels */ - public static final ByteBuffer LWJGLIcon16x16 = loadIcon(LWJGL_ICON_DATA_16x16); + public static final ByteBuffer LWJGLIcon16x16 = loadIcon(LWJGLIconData.ICON_16x16); /** LWJGL Logo - 32 by 32 pixels */ - public static final ByteBuffer LWJGLIcon32x32 = loadIcon(LWJGL_ICON_DATA_32x32); + public static final ByteBuffer LWJGLIcon32x32 = loadIcon(LWJGLIconData.ICON_32x32); /** Debug flag. */ public static final boolean DEBUG = getPrivilegedBoolean("org.lwjgl.util.Debug"); @@ -382,14 +203,19 @@ public class LWJGLUtil { String classloader_path = getPathFromClassLoader(libname, classloader); if (classloader_path != null) { - logger().log(() -> "getPathFromClassLoader: Path found: " + classloader_path); + if (DEBUG) { + logger().log(() -> "getPathFromClassLoader: Path found: " + classloader_path); + } possible_paths.add(classloader_path); } for ( String platform_lib_name : platform_lib_names ) { String lwjgl_classloader_path = getPathFromClassLoader("lwjgl", classloader); + if ( lwjgl_classloader_path != null ) { - logger().log(() -> "getPathFromClassLoader: Path found: " + lwjgl_classloader_path); + if ( DEBUG ) { + logger().log(() -> "getPathFromClassLoader: Path found: " + lwjgl_classloader_path); + } possible_paths.add(lwjgl_classloader_path.substring(0, lwjgl_classloader_path.lastIndexOf(File.separator)) + File.separator + platform_lib_name); } @@ -438,9 +264,9 @@ public class LWJGLUtil { public static boolean getPrivilegedBoolean(String property_name) { String s = getPrivilegedProperty(property_name); if (s == null || s.equals("false")) return false; - if (LWJGLUtil.DEBUG) { + if (DEBUG) { if (!s.equals("true")) { - LWJGLUtil.logger().log(() -> "Value of boolean property " + property_name + " is not one of [true, false]: " + s); + logger().log(() -> "Value of boolean property " + property_name + " is not one of [true, false]: " + s); } } return true; @@ -486,40 +312,19 @@ public class LWJGLUtil { * locate it. * * @param libname Name of library to search for - * @param classloader Classloader to use + * @param classLoader Classloader to use * @return Absolute path to library if found, otherwise null */ - private static String getPathFromClassLoader(final String libname, final ClassLoader classloader) { - Class clazz = null; - - try { - if (LWJGLUtil.DEBUG) { - logger().log(() -> "getPathFromClassLoader: searching for: " + libname); - } - clazz = classloader.getClass(); - Method findLibrary = null; - while (clazz != null) { - Class clazz1 = clazz; - try { - findLibrary = clazz.getDeclaredMethod("findLibrary", String.class); - findLibrary.setAccessible(true); - logger().log(() -> "Found findLibrary method on " + clazz1.getName()); - break; - } catch (Exception e) { - if (DEBUG) { - logger().log(() -> "Failed to locate findLibrary method on " + clazz1.getName(), e); - } - clazz = clazz.getSuperclass(); - } - } - if (findLibrary != null) { - String path = (String)findLibrary.invoke(classloader, libname); - return path; - } - } catch (Exception e) { - logger().log(() -> "Failure locating using classloader " + classloader, e); + private static String getPathFromClassLoader(final String libname, final ClassLoader classLoader) { + if (DEBUG) { + logger().log(() -> "getPathFromClassLoader: Searching for '" + libname + '\''); + } + try { + return (String) MH_findLibrary.invokeExact(classLoader, libname); + } catch (Throwable e) { + logger().log(() -> "getPathFromClassLoader: Failure locating using classloader '" + classLoader + '\'', e); + return null; } - return null; } /** @@ -529,16 +334,20 @@ public class LWJGLUtil { */ public static boolean isMacOSXEqualsOrBetterThan(int major_required, int minor_required) { String os_version = getPrivilegedProperty("os.version"); - StringTokenizer version_tokenizer = new StringTokenizer(os_version, "."); + int dotI = os_version.indexOf('.'); + if (dotI == -1) { + if (DEBUG) { + logger().log("No '.' delimiter was found in value of 'os.version'"); + } + return false; + } int major; int minor; try { - String major_str = version_tokenizer.nextToken(); - String minor_str = version_tokenizer.nextToken(); - major = Integer.parseInt(major_str); - minor = Integer.parseInt(minor_str); + major = Integer.parseInt(os_version, 0, dotI, 10); + minor = Integer.parseInt(os_version, dotI + 1, os_version.length(), 10); } catch (Exception e) { - LWJGLUtil.log("Exception occurred while trying to determine OS version: " + e); + logger().log("Exception occurred while trying to determine OS version", e); // Best guess, no return false; } @@ -619,8 +428,8 @@ public class LWJGLUtil { } /** Simple interface for Field filtering. */ + @FunctionalInterface public interface TokenFilter { - /** * Should return true if the specified Field passes the filter. * @@ -630,7 +439,5 @@ public class LWJGLUtil { * @return true if the Field is accepted */ boolean accept(Field field, int value); - } - } diff --git a/src/java/org/lwjgl/opencl/Util.java b/src/java/org/lwjgl/opencl/Util.java index acb03800..b76253f9 100644 --- a/src/java/org/lwjgl/opencl/Util.java +++ b/src/java/org/lwjgl/opencl/Util.java @@ -44,11 +44,8 @@ import java.util.Map; public final class Util { /** Maps OpenCL error token values to their String representations. */ - private static final Map CL_ERROR_TOKENS = LWJGLUtil.getClassTokens(new LWJGLUtil.TokenFilter() { - public boolean accept(final Field field, final int value) { - return value < 0; // Currently, all OpenCL errors have negative values. - } - }, null, CL10.class, CL11.class, KHRGLSharing.class, KHRICD.class, APPLEGLSharing.class, EXTDeviceFission.class); + // Currently, all OpenCL errors have negative values. + private static final Map CL_ERROR_TOKENS = LWJGLUtil.getClassTokens((_field, value) -> value < 0, null, CL10.class, CL11.class, KHRGLSharing.class, KHRICD.class, APPLEGLSharing.class, EXTDeviceFission.class); private Util() { } @@ -65,4 +62,4 @@ public final class Util { throw new OpenCLException("Error Code: " + errname + " (" + LWJGLUtil.toHexString(errcode) + ")"); } -} \ No newline at end of file +} diff --git a/src/stubs/dev/pfaff/unfettered/UnsafeUtil.java b/src/stubs/dev/pfaff/unfettered/UnsafeUtil.java new file mode 100644 index 00000000..0906d9b6 --- /dev/null +++ b/src/stubs/dev/pfaff/unfettered/UnsafeUtil.java @@ -0,0 +1,9 @@ +package dev.pfaff.unfettered; + +import java.lang.invoke.MethodHandles; + +public final class UnsafeUtil { + public static MethodHandles.Lookup getTrustedLookup() { + throw new RuntimeException("This is a stub"); + } +}