From 03b15ec0efc5af944da7d65aadab3a4bdf2e6c68 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Mon, 13 Feb 2012 12:37:52 +0100 Subject: Fix JOGL GLContextImpl ProcAddressTable and Extension Caching Bug caused using wrong extension cache and probably the wrong procAddress table. - do not reuse local field value if not cached - issue resetState() after each createContextARBMapVersionsAvailable(..) query - remove cache entry for extension (copy/paste bug) - resetState() shall clean platform extProcAddressTable in specializations --- src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/jogl/classes/jogamp/opengl/macosx') diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java index ea30c59cf..1503aa73d 100644 --- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java +++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java @@ -142,6 +142,7 @@ public abstract class MacOSXCGLContext extends GLContextImpl @Override protected void resetStates() { // no inner state _cglExt = null; + cglExtProcAddressTable = null; super.resetStates(); } @@ -307,17 +308,15 @@ public abstract class MacOSXCGLContext extends GLContextImpl if(null != table) { cglExtProcAddressTable = (CGLExtProcAddressTable) table; if(DEBUG) { - System.err.println(getThreadName() + ": !!! GLContext CGL ProcAddressTable reusing key("+key+") -> "+table.hashCode()); + System.err.println(getThreadName() + ": !!! GLContext CGL ProcAddressTable reusing key("+key+") -> "+toHexString(table.hashCode())); } } else { - if (cglExtProcAddressTable == null) { - cglExtProcAddressTable = new CGLExtProcAddressTable(new GLProcAddressResolver()); - } + cglExtProcAddressTable = new CGLExtProcAddressTable(new GLProcAddressResolver()); resetProcAddressTable(getCGLExtProcAddressTable()); synchronized(mappedContextTypeObjectLock) { mappedGLXProcAddress.put(key, getCGLExtProcAddressTable()); if(DEBUG) { - System.err.println(getThreadName() + ": !!! GLContext CGL ProcAddressTable mapping key("+key+") -> "+getCGLExtProcAddressTable().hashCode()); + System.err.println(getThreadName() + ": !!! GLContext CGL ProcAddressTable mapping key("+key+") -> "+toHexString(getCGLExtProcAddressTable().hashCode())); } } } -- cgit v1.2.3