aboutsummaryrefslogtreecommitdiffstats
path: root/src/classes/com/sun/opengl/impl
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2008-06-25 09:38:10 +0000
committerSven Gothel <[email protected]>2008-06-25 09:38:10 +0000
commit6e9438e631b9f75340c1f7e7cf06b38a358861c4 (patch)
tree9500137a98e187f5e1c09fdf037043613e333cbb /src/classes/com/sun/opengl/impl
parent16f1e768f7a9162ac50cefc811a1fce019831bdf (diff)
GLES1 NEWT X11 - RedSquare - working
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JOGL_2_SANDBOX@1683 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/classes/com/sun/opengl/impl')
-rw-r--r--src/classes/com/sun/opengl/impl/GLContextImpl.java18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/classes/com/sun/opengl/impl/GLContextImpl.java b/src/classes/com/sun/opengl/impl/GLContextImpl.java
index 13b847e51..6bec8c1e5 100644
--- a/src/classes/com/sun/opengl/impl/GLContextImpl.java
+++ b/src/classes/com/sun/opengl/impl/GLContextImpl.java
@@ -226,7 +226,7 @@ public abstract class GLContextImpl extends GLContext {
// Helpers for various context implementations
//
- private Object createObject(String suffix) {
+ private Object createObject(String suffix, Class[] cstrArgs) {
String clazzName = null;
Class factoryClass = null;
Constructor factory = null;
@@ -246,11 +246,17 @@ public abstract class GLContextImpl extends GLContext {
throw new GLException(clazzName + " not yet implemented");
}
try {
- factory = factoryClass.getDeclaredConstructor(new Class[] { GLContextImpl.class });
+ factory = factoryClass.getDeclaredConstructor( cstrArgs );
} catch(NoSuchMethodException nsme) {
- throw new GLException(clazzName + "(GLContextImpl) not yet implemented / missing cstr");
+ throw new GLException("Constructor: '" + clazzName + "("+cstrArgs+")' not found");
}
- return factory.newInstance(new Object[] { this });
+ if(cstrArgs.length==0) {
+ return factory.newInstance(null);
+ }
+ if(cstrArgs[0].equals(GLContextImpl.class)) {
+ return factory.newInstance(new Object[] { this });
+ }
+ throw new GLException("Constructor: '" + clazzName + "("+cstrArgs[0]+")' not yet supported");
} catch (Exception e) {
throw new GLException(e);
}
@@ -258,7 +264,7 @@ public abstract class GLContextImpl extends GLContext {
/** Create the GL for this context. */
protected GL createGL() {
- GL gl = (GL) createObject("Impl");
+ GL gl = (GL) createObject("Impl", new Class[] { GLContextImpl.class } );
/* FIXME: refactor dependence on Java 2D / JOGL bridge
if (tracker != null) {
@@ -338,7 +344,7 @@ public abstract class GLContextImpl extends GLContext {
System.err.println(getThreadName() + ": !!! Initializing OpenGL extension address table for " + this);
}
if (glProcAddressTable == null) {
- glProcAddressTable = (ProcAddressTable) createObject("ProcAddressTable");
+ glProcAddressTable = (ProcAddressTable) createObject("ProcAddressTable", new Class[0]);
// FIXME: cache ProcAddressTables by capability bits so we can
// share them among contexts with the same capabilities
}