diff options
author | Kenneth Russel <[email protected]> | 2005-07-19 01:53:36 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2005-07-19 01:53:36 +0000 |
commit | 74adb7cc4ba59369964b562e3c84988f63025296 (patch) | |
tree | 0a850c1110afa161eeadb930c4035eb310b79f84 /src/net/java/games/jogl/impl/x11/X11GLContext.java | |
parent | b01ac27a7d6ae4863490537e1ba8749795cd84de (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/x11/X11GLContext.java')
-rw-r--r-- | src/net/java/games/jogl/impl/x11/X11GLContext.java | 35 |
1 files changed, 2 insertions, 33 deletions
diff --git a/src/net/java/games/jogl/impl/x11/X11GLContext.java b/src/net/java/games/jogl/impl/x11/X11GLContext.java index 15c1c8733..97f1b3593 100644 --- a/src/net/java/games/jogl/impl/x11/X11GLContext.java +++ b/src/net/java/games/jogl/impl/x11/X11GLContext.java @@ -40,9 +40,7 @@ package net.java.games.jogl.impl.x11; import java.awt.Component; -import java.security.*; import java.util.*; -import net.java.games.gluegen.runtime.*; // for PROCADDRESS_VAR_PREFIX import net.java.games.jogl.*; import net.java.games.jogl.impl.*; @@ -55,30 +53,16 @@ public abstract class X11GLContext extends GLContextImpl { // Table that holds the addresses of the native C-language entry points for // OpenGL functions. private GLProcAddressTable glProcAddressTable; - private static boolean haveResetGLXProcAddressTable; // Cache the most recent value of the "display" variable (which we // only guarantee to be valid in between makeCurrent / free pairs) // so that we can implement displayImpl() (which must be done when // the context is not current) protected long mostRecentDisplay; - // There is currently a bug on Linux/AMD64 distributions in glXGetProcAddressARB - protected static boolean isLinuxAMD64; static { functionNameMap = new HashMap(); functionNameMap.put("glAllocateMemoryNV", "glXAllocateMemoryNV"); functionNameMap.put("glFreeMemoryNV", "glXFreeMemoryNV"); - - AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { - String os = System.getProperty("os.name").toLowerCase(); - String arch = System.getProperty("os.arch").toLowerCase(); - if (os.startsWith("linux") && arch.equals("amd64")) { - isLinuxAMD64 = true; - } - return null; - } - }); } public X11GLContext(X11GLDrawable drawable, @@ -180,18 +164,6 @@ public abstract class X11GLContext extends GLContextImpl { unlockAWT(); } - protected long dynamicLookupFunction(String glFuncName) { - long res = 0; - if (!isLinuxAMD64) { - res = GLX.glXGetProcAddressARB(glFuncName); - } - if (res == 0) { - // GLU routines aren't known to the OpenGL function lookup - res = GLX.dlsym(glFuncName); - } - return res; - } - public boolean isCreated() { return (context != 0); } @@ -202,10 +174,6 @@ public abstract class X11GLContext extends GLContextImpl { System.err.println("!!! Initializing OpenGL extension address table"); } resetProcAddressTable(getGLProcAddressTable()); - - if (!haveResetGLXProcAddressTable) { - resetProcAddressTable(GLX.getGLXProcAddressTable()); - } } public GLProcAddressTable getGLProcAddressTable() { @@ -222,7 +190,8 @@ public abstract class X11GLContext extends GLContextImpl { throw new GLException("Context not current"); } if (!glXQueryExtensionsStringInitialized) { - glXQueryExtensionsStringAvailable = (dynamicLookupFunction("glXQueryExtensionsString") != 0); + glXQueryExtensionsStringAvailable = + (GLDrawableFactoryImpl.getFactoryImpl().dynamicLookupFunction("glXQueryExtensionsString") != 0); glXQueryExtensionsStringInitialized = true; } if (glXQueryExtensionsStringAvailable) { |