From 6e59ac5f89bcd8cbb0b05653c56a0454963984c8 Mon Sep 17 00:00:00 2001 From: phil Date: Tue, 11 Oct 2016 12:59:29 +1300 Subject: New gl2es2 pipeline examples showing usage Imports organized Cg shader examples removed pom.xml added Resources now has brute force fall back --- src/classes/org/jdesktop/j3d/examples/Resources.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/classes/org/jdesktop/j3d/examples/Resources.java') 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; } -- cgit v1.2.3