aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/games/jogl/impl/GLContextImpl.java
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2005-07-19 01:53:36 +0000
committerKenneth Russel <[email protected]>2005-07-19 01:53:36 +0000
commit74adb7cc4ba59369964b562e3c84988f63025296 (patch)
tree0a850c1110afa161eeadb930c4035eb310b79f84 /src/net/java/games/jogl/impl/GLContextImpl.java
parentb01ac27a7d6ae4863490537e1ba8749795cd84de (diff)
Added workaround for problem loading JAWT library on X11 platforms
before the AWT toolkit had been loaded. Added check for jogl.gljpanel.nosw system property to diagnose problems with pbuffer support. Fixed bootstrapping problem with GLX where its function pointer table needed to be initialized before the first OpenGL context was created in the case where a pbuffer was the first thing created. Moved helper functions for resetting proc address table and dynamic function lookup to GLDrawableFactoryImpl from GLContextImpl. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JSR-231@331 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/net/java/games/jogl/impl/GLContextImpl.java')
-rwxr-xr-xsrc/net/java/games/jogl/impl/GLContextImpl.java30
1 files changed, 1 insertions, 29 deletions
diff --git a/src/net/java/games/jogl/impl/GLContextImpl.java b/src/net/java/games/jogl/impl/GLContextImpl.java
index 6094d6795..8e29633c7 100755
--- a/src/net/java/games/jogl/impl/GLContextImpl.java
+++ b/src/net/java/games/jogl/impl/GLContextImpl.java
@@ -183,37 +183,9 @@ public abstract class GLContextImpl extends GLContext {
/** Helper routine which resets a ProcAddressTable generated by the
GLEmitter by looking up anew all of its function pointers. */
protected void resetProcAddressTable(Object table) {
- Class tableClass = table.getClass();
- java.lang.reflect.Field[] fields = tableClass.getDeclaredFields();
-
- for (int i = 0; i < fields.length; ++i) {
- String addressFieldName = fields[i].getName();
- if (!addressFieldName.startsWith(ProcAddressHelper.PROCADDRESS_VAR_PREFIX)) {
- // not a proc address variable
- continue;
- }
- int startOfMethodName = ProcAddressHelper.PROCADDRESS_VAR_PREFIX.length();
- String glFuncName = addressFieldName.substring(startOfMethodName);
- try {
- java.lang.reflect.Field addressField = tableClass.getDeclaredField(addressFieldName);
- assert(addressField.getType() == Long.TYPE);
- long newProcAddress = dynamicLookupFunction(glFuncName);
- // set the current value of the proc address variable in the table object
- addressField.setLong(table, newProcAddress);
- if (DEBUG) {
- // System.err.println(glFuncName + " = 0x" + Long.toHexString(newProcAddress));
- }
- } catch (Exception e) {
- throw new GLException("Cannot get GL proc address for method \"" +
- glFuncName + "\": Couldn't set value of field \"" + addressFieldName +
- "\" in class " + tableClass.getName(), e);
- }
- }
+ GLDrawableFactoryImpl.getFactoryImpl().resetProcAddressTable(table);
}
- /** Dynamically looks up the given function. */
- protected abstract long dynamicLookupFunction(String glFuncName);
-
/** Indicates whether the underlying OpenGL context has been
created. This is used to manage sharing of display lists and
textures between contexts. */