summaryrefslogtreecommitdiffstats
path: root/src/newt/classes/com/jogamp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2015-10-03 05:07:46 +0200
committerSven Gothel <[email protected]>2015-10-03 05:07:46 +0200
commit731c473740e3e7ccd26ecda7ea0200382795c3a6 (patch)
tree7a363f30e85affaaea0d588abbc6087b3b582d28 /src/newt/classes/com/jogamp
parent670df25aae92079945a83401db9722d543730193 (diff)
Bug 1237: Adopt GlueGen's clarification of IOUtil.getResource(..), commit d78bb1be0a6290cb94918b21865a023c01825048
- Skip relative lookup for IOUtil.ClassResources using 'asset' only (from JAR file) - Tested w/ jar file and build-dir, see scripts/tests.sh 'USE_BUILDDIR'
Diffstat (limited to 'src/newt/classes/com/jogamp')
-rw-r--r--src/newt/classes/com/jogamp/newt/NewtFactory.java6
-rw-r--r--src/newt/classes/com/jogamp/newt/opengl/util/NEWTDemoListener.java10
2 files changed, 8 insertions, 8 deletions
diff --git a/src/newt/classes/com/jogamp/newt/NewtFactory.java b/src/newt/classes/com/jogamp/newt/NewtFactory.java
index 2ed2194d8..f7b5a1340 100644
--- a/src/newt/classes/com/jogamp/newt/NewtFactory.java
+++ b/src/newt/classes/com/jogamp/newt/NewtFactory.java
@@ -59,6 +59,7 @@ public class NewtFactory {
public static final String DRIVER_DEFAULT_ROOT_PACKAGE = "jogamp.newt.driver";
private static IOUtil.ClassResources defaultWindowIcons;
+ private static String sysPaths = "newt/data/jogamp-16x16.png newt/data/jogamp-32x32.png";
static {
AccessController.doPrivileged(new PrivilegedAction<Object>() {
@@ -67,12 +68,11 @@ public class NewtFactory {
NativeWindowFactory.initSingleton(); // last resort ..
{
/** See API Doc in {@link Window} ! */
- final String[] paths = PropertyAccess.getProperty("newt.window.icons", true, "newt/data/jogamp-16x16.png newt/data/jogamp-32x32.png").split("\\s");
+ final String[] paths = PropertyAccess.getProperty("newt.window.icons", true, sysPaths).split("\\s");
if( paths.length < 2 ) {
throw new IllegalArgumentException("Property 'newt.window.icons' did not specify at least two PNG icons, but "+Arrays.toString(paths));
}
- final Class<?> clazz = NewtFactory.class;
- defaultWindowIcons = new IOUtil.ClassResources(clazz, paths);
+ defaultWindowIcons = new IOUtil.ClassResources(paths, NewtFactory.class.getClassLoader(), null);
}
return null;
} } );
diff --git a/src/newt/classes/com/jogamp/newt/opengl/util/NEWTDemoListener.java b/src/newt/classes/com/jogamp/newt/opengl/util/NEWTDemoListener.java
index d49ddab42..84c4683db 100644
--- a/src/newt/classes/com/jogamp/newt/opengl/util/NEWTDemoListener.java
+++ b/src/newt/classes/com/jogamp/newt/opengl/util/NEWTDemoListener.java
@@ -440,7 +440,7 @@ public class NEWTDemoListener extends WindowAdapter implements KeyListener, Mous
disp.createNative();
{
PointerIcon _pointerIcon = null;
- final IOUtil.ClassResources res = new IOUtil.ClassResources(disp.getClass(), new String[] { "newt/data/cross-grey-alpha-16x16.png" } );
+ final IOUtil.ClassResources res = new IOUtil.ClassResources(new String[] { "newt/data/cross-grey-alpha-16x16.png" }, disp.getClass().getClassLoader(), null);
try {
_pointerIcon = disp.createPointerIcon(res, 8, 8);
pointerIcons.add(_pointerIcon);
@@ -451,7 +451,7 @@ public class NEWTDemoListener extends WindowAdapter implements KeyListener, Mous
}
{
PointerIcon _pointerIcon = null;
- final IOUtil.ClassResources res = new IOUtil.ClassResources(disp.getClass(), new String[] { "newt/data/pointer-grey-alpha-16x24.png" } );
+ final IOUtil.ClassResources res = new IOUtil.ClassResources(new String[] { "newt/data/pointer-grey-alpha-16x24.png" }, disp.getClass().getClassLoader(), null);
try {
_pointerIcon = disp.createPointerIcon(res, 0, 0);
pointerIcons.add(_pointerIcon);
@@ -462,7 +462,7 @@ public class NEWTDemoListener extends WindowAdapter implements KeyListener, Mous
}
{
PointerIcon _pointerIcon = null;
- final IOUtil.ClassResources res = new IOUtil.ClassResources(disp.getClass(), new String[] { "arrow-red-alpha-64x64.png" } );
+ final IOUtil.ClassResources res = new IOUtil.ClassResources(new String[] { "arrow-red-alpha-64x64.png" }, disp.getClass().getClassLoader(), null);
try {
_pointerIcon = disp.createPointerIcon(res, 0, 0);
pointerIcons.add(_pointerIcon);
@@ -473,7 +473,7 @@ public class NEWTDemoListener extends WindowAdapter implements KeyListener, Mous
}
{
PointerIcon _pointerIcon = null;
- final IOUtil.ClassResources res = new IOUtil.ClassResources(disp.getClass(), new String[] { "arrow-blue-alpha-64x64.png" } );
+ final IOUtil.ClassResources res = new IOUtil.ClassResources(new String[] { "arrow-blue-alpha-64x64.png" }, disp.getClass().getClassLoader(), null);
try {
_pointerIcon = disp.createPointerIcon(res, 0, 0);
pointerIcons.add(_pointerIcon);
@@ -484,7 +484,7 @@ public class NEWTDemoListener extends WindowAdapter implements KeyListener, Mous
}
if( PNGIcon.isAvailable() ) {
PointerIcon _pointerIcon = null;
- final IOUtil.ClassResources res = new IOUtil.ClassResources(disp.getClass(), new String[] { "jogamp-pointer-64x64.png" } );
+ final IOUtil.ClassResources res = new IOUtil.ClassResources(new String[] { "jogamp-pointer-64x64.png" }, disp.getClass().getClassLoader(), null);
try {
final URLConnection urlConn = res.resolve(0);
if( null != urlConn ) {