diff options
author | phil <[email protected]> | 2016-10-11 12:59:29 +1300 |
---|---|---|
committer | phil <[email protected]> | 2016-10-11 12:59:29 +1300 |
commit | 6e59ac5f89bcd8cbb0b05653c56a0454963984c8 (patch) | |
tree | b5b7612861f7f22b812ef66d85e710b79c5b593d /src/classes/org/jdesktop/j3d/examples/Resources.java | |
parent | 78924b53370ef6fd874f858e683b226a18bb82c5 (diff) |
New gl2es2 pipeline examples showing usage
Imports organized
Cg shader examples removed
pom.xml added
Resources now has brute force fall back
Diffstat (limited to 'src/classes/org/jdesktop/j3d/examples/Resources.java')
-rw-r--r-- | src/classes/org/jdesktop/j3d/examples/Resources.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/classes/org/jdesktop/j3d/examples/Resources.java b/src/classes/org/jdesktop/j3d/examples/Resources.java index db7bddb..4010201 100644 --- a/src/classes/org/jdesktop/j3d/examples/Resources.java +++ b/src/classes/org/jdesktop/j3d/examples/Resources.java @@ -44,6 +44,8 @@ package org.jdesktop.j3d.examples; +import java.io.File; +import java.net.MalformedURLException; import java.net.URL; /** @@ -62,7 +64,19 @@ public class Resources { * Return the URL of the filename under the resources directory */ public static URL getResource(String filename) { - URL url = Resources.class.getResource(filename); + URL url = Resources.class.getClassLoader().getResource(filename); + + if(url == null) + { + try + { + url = new File(System.getProperty("user.dir") + "/src/classes/org/jdesktop/j3d/examples/"+filename).toURL(); + } + catch (MalformedURLException e) + { + e.printStackTrace(); + } + } return url; } |