From: <sp...@us...> - 2010-02-09 15:23:24
|
Revision: 3271 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3271&view=rev Author: spasi Date: 2010-02-09 15:22:58 +0000 (Tue, 09 Feb 2010) Log Message: ----------- Catch and ignore INVALID_OPERATION error when retrieving CONTEXT_PROFILE_MASK (workaround for ATI 9.12). Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/GLContext.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/GLContext.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/GLContext.java 2010-02-07 18:50:23 UTC (rev 3270) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/GLContext.java 2010-02-09 15:22:58 UTC (rev 3271) @@ -247,8 +247,18 @@ // Get the context profile mask for versions >= 3.2 if ( 3 < majorVersion || 2 <= minorVersion ) { + Util.checkGLError(); // Make sure we have no errors up to this point + GL11.glGetInteger(GL32.GL_CONTEXT_PROFILE_MASK, buffer); - profileMask = buffer.get(0); + + try { + // Retrieving GL_CONTEXT_PROFILE_MASK may generate an INVALID_OPERATION error on certain implementations, ignore. + // Happens on pre10.1 ATI drivers, when ContextAttribs.withProfileCompatibility is not used + Util.checkGLError(); + profileMask = buffer.get(0); + } catch (OpenGLException e) { + LWJGLUtil.log("Failed to retrieve CONTEXT_PROFILE_MASK"); + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |