aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2009-03-16 14:38:27 +0000
committerSven Gothel <[email protected]>2010-04-19 00:55:57 +0200
commita270623faf11db8ff8c1382ee3d499aec00acf09 (patch)
tree7e7d9510ba6d59c5d3eb918f21022aac23051246 /src
parent5d82af18a06ce8f493cd7c90d1b9f35f9775081f (diff)
JOGL refactoring: Refactored JOGL into 3 independent components.
1 NWI - Native windowing interface Abstracts the the general NativeWindow interface and it's factory, incl the basic JAWT and Xlib toolkit. The latter was motivated to clean up the JOGL workspace, and to allow other to reuse this part. The generic core is nwi.core.jar, the AWT add-on is nwi.awt.jar. 2 JOGL - The OpenGL mapping Further cleanup of the SPEC. All non OpenGL toolkits are relocated to NWI and NEWT. There is still openmax and the windows audio layer .. Another cleanup of the fixed function pipeline emulation. Moved utilities and implementations where they belong .. Removed GLUnsupportedException. Misc .. changes 3 NEWT - The new windowing toolkit The generic NEWT, newt.core.jar. The JOGL and AWT modules are seperate, newt.ogl.jar newt.awt.jar. Their build can be switched off. The modules source and builds resides in their own directory. Because of their nature, they share the stub_includes, etc. Each module has it's own ant build script - build-nwi.xml - build-jogl.xml - build-newt.xml They can be build at once using build.xml as ususal, which just invokes the seperate build tasks. if rootrel.build=build, then the build location is jogl/build-nwi jogl/build-jogl jogl/build-newt and the sources are under jogl/src/nwi jogl/src/jogl jogl/src/newt Tested: jogl-demos, d4; Linux, MacOsX; Nvidia git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JOGL_2_SANDBOX@1868 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src')
-rw-r--r--src/nwi/classes/com/sun/nwi/impl/NWReflection.java (renamed from src/classes/com/sun/opengl/impl/GLReflection.java)24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/classes/com/sun/opengl/impl/GLReflection.java b/src/nwi/classes/com/sun/nwi/impl/NWReflection.java
index 8c89c50..51037af 100644
--- a/src/classes/com/sun/opengl/impl/GLReflection.java
+++ b/src/nwi/classes/com/sun/nwi/impl/NWReflection.java
@@ -34,12 +34,13 @@
* facility.
*/
-package com.sun.opengl.impl;
+package com.sun.nwi.impl;
import java.lang.reflect.*;
-import javax.media.opengl.*;
+import javax.media.nwi.*;
-public final class GLReflection {
+public final class NWReflection {
+ public static final boolean DEBUG = Debug.debug("NWReflection");
public static final boolean isClassAvailable(String clazzName) {
try {
@@ -49,6 +50,13 @@ public final class GLReflection {
return false;
}
+ public static final Class getClass(String clazzName) {
+ try {
+ return Class.forName(clazzName);
+ } catch (Throwable e) { }
+ return null;
+ }
+
public static final Constructor getConstructor(String clazzName, Class[] cstrArgTypes) {
Class factoryClass = null;
Constructor factory = null;
@@ -56,19 +64,19 @@ public final class GLReflection {
try {
factoryClass = Class.forName(clazzName);
if (factoryClass == null) {
- throw new GLUnsupportedException(clazzName + " not available");
+ throw new NWException(clazzName + " not available");
}
try {
factory = factoryClass.getDeclaredConstructor( cstrArgTypes );
} catch(NoSuchMethodException nsme) {
- throw new GLUnsupportedException("Constructor: '" + clazzName + "("+cstrArgTypes+")' not found");
+ throw new NWException("Constructor: '" + clazzName + "("+cstrArgTypes+")' not found");
}
return factory;
} catch (Throwable e) {
- if (Debug.debug("GLReflection")) {
+ if (DEBUG) {
e.printStackTrace();
}
- throw new GLUnsupportedException(e);
+ throw new NWException(e);
}
}
@@ -83,7 +91,7 @@ public final class GLReflection {
factory = getConstructor(clazzName, cstrArgTypes);
return factory.newInstance( cstrArgs ) ;
} catch (Exception e) {
- throw new GLUnsupportedException(e);
+ throw new NWException(e);
}
}