From 4f7d8a59df48d43a5b7da8bcc7dd406357474eb1 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 22 Apr 2011 05:39:21 +0200 Subject: reflect GLContext changes a5430cf16727fdc7bcfb17ef251018cc479d5f5d --- src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderUtil.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderUtil.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderUtil.java index c7e845953..3a5a24116 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderUtil.java +++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderUtil.java @@ -182,9 +182,7 @@ public class ShaderUtil { public Set getShaderBinaryFormats(GL _gl) { GL2ES2 gl = _gl.getGL2ES2(); if(null==shaderBinaryFormats) { - if(gl.getContext()!=GLContext.getCurrent()) { - return new HashSet(0); // bail out - } + gl.getContext().validateCurrent(); int[] param = new int[1]; shaderBinaryFormats = new HashSet(); @@ -208,9 +206,7 @@ public class ShaderUtil { public boolean isShaderCompilerAvailable(GL _gl) { GL2ES2 gl = _gl.getGL2ES2(); if(null==shaderCompilerAvailable) { - if(gl.getContext()!=GLContext.getCurrent()) { - return false; // bail out - } + gl.getContext().validateCurrent(); Set bfs = getShaderBinaryFormats(gl); if(gl.isGLES2()) { byte[] param = new byte[1]; @@ -469,7 +465,7 @@ public class ShaderUtil { Impl impl = (Impl) context.getAttachedObject(ShaderUtil.class.getName()); if (impl == null) { impl = new GL2ES2Impl(); - context.putAttachedObject(ShaderUtil.class.getName(), impl); + context.attachObject(ShaderUtil.class.getName(), impl); } return impl; } -- cgit v1.2.3