From 4e0a5af0b359b98b26ea3e961d023c658650be6c Mon Sep 17 00:00:00 2001
From: Sven Gothel <sgothel@jausoft.com>
Date: Sat, 1 Aug 2009 05:37:29 -0700
Subject: GL3 Related:

- Fix glGetStringi's return type to String

- Fix ExtensionAvailabilityCache:

    GL3's glGetStringi for GL_EXTENSIONS

    Ensure to add GL_VERSION_2_0 in case version >= 3.0

    Ensure to not exceed version 3.0 for non GL3.1 context.

    In case of GL 3.1, do not include GL_VERSIONS below 3.0,
    since this is a forward compatible context.

- Add Prologue to glGetString, where the ExtensionCache is being
  used for GL_EXTENSIONS - if already initialized.
  This feature adds backward compatibility for GL3 context on GL_EXTENSION.

+++

General:

Add GLPipelineFactory, a convenient pipeline factory for Debug/Trace and custom ones ..

Change 'void setGL(GL)' to 'GL setGL(GL)', and let it return the successful set GL,
or null.
---
 .../com/sun/opengl/util/glsl/fixedfunc/FixedFuncUtil.java | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

(limited to 'src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc')

diff --git a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/FixedFuncUtil.java b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/FixedFuncUtil.java
index 9c8a65173..4149aec69 100644
--- a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/FixedFuncUtil.java
+++ b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/FixedFuncUtil.java
@@ -14,12 +14,12 @@ import com.sun.opengl.util.glsl.fixedfunc.impl.*;
  */
 public class FixedFuncUtil {
     /**
-     * @return If gl is a GL2ES1, return the type cast object,
+     * @return If gl is a GL2ES1 and force is false, return the type cast object,
      *         otherwise create a fixed function emulation pipeline with the GL2ES2 impl.
      * @throws GLException if the GL object is neither GL2ES1 nor GL2ES2
      */
-    public static final GL2ES1 getFixedFuncImpl(GL gl) {
-        if(gl.isGL2ES1()) {
+    public static final GL2ES1 getFixedFuncImpl(GL gl, boolean force) {
+        if(!force && gl.isGL2ES1()) {
             return gl.getGL2ES1();
         } else if(gl.isGL2ES2()) {
             GL2ES2 es2 = gl.getGL2ES2();
@@ -31,6 +31,15 @@ public class FixedFuncUtil {
         throw new GLException("GL Object is neither GL2ES1 nor GL2ES2");
     }
 
+    /**
+     * @return If gl is a GL2ES1, return the type cast object,
+     *         otherwise create a fixed function emulation pipeline with the GL2ES2 impl.
+     * @throws GLException if the GL object is neither GL2ES1 nor GL2ES2
+     */
+    public static final GL2ES1 getFixedFuncImpl(GL gl) {
+        return getFixedFuncImpl(gl, false);
+    }
+
     /**
      * Mapping fixed function (client) array indices to 
      * GLSL array attribute names.
-- 
cgit v1.2.3