From b6d75cac68340878b20d35b23c8449c97ad9d819 Mon Sep 17 00:00:00 2001 From: Morris Meyer Date: Tue, 28 Jul 2009 17:34:20 -0400 Subject: EGL changes for device --- src/jogl/classes/javax/media/opengl/GLProfile.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/jogl/classes/javax/media') diff --git a/src/jogl/classes/javax/media/opengl/GLProfile.java b/src/jogl/classes/javax/media/opengl/GLProfile.java index ead5f6396..83a9b0098 100644 --- a/src/jogl/classes/javax/media/opengl/GLProfile.java +++ b/src/jogl/classes/javax/media/opengl/GLProfile.java @@ -54,7 +54,7 @@ import com.sun.nativewindow.impl.jvm.JVMUtil; * or more specialized versions using the other static GetProfile methods. */ public class GLProfile implements Cloneable { - public static final boolean DEBUG = Debug.debug("GLProfile"); + public static final boolean DEBUG = true; /* Debug.debug("GLProfile"); */ // // Public (user-visible) profiles @@ -736,8 +736,8 @@ public class GLProfile implements Cloneable { } } mappedProfiles = _mappedProfiles; // final .. - if(null==defaultGLProfile) { - throw new GLException("No profile available: "+list2String(GL_PROFILE_LIST_ALL)); + if (null==defaultGLProfile) { + System.out.println("No profile available: "+list2String(GL_PROFILE_LIST_ALL)); } } -- cgit v1.2.3 From 4b5e1a0f826597d8cdcf81865194ee8d67511b70 Mon Sep 17 00:00:00 2001 From: sg215889 Date: Tue, 28 Jul 2009 19:03:32 -0700 Subject: Cleanup .. --- make/build-jogl.xml | 24 ++++------------- make/build-nativewindow.xml | 31 +++++++--------------- make/build-newt.xml | 28 ++++++------------- make/make.jogl.all.linux-x86.sh | 2 +- .../com/sun/opengl/impl/GLDrawableImpl.java | 19 +------------ .../sun/opengl/impl/egl/EGLDrawableFactory.java | 6 +---- .../opengl/impl/egl/EGLDynamicLookupHelper.java | 14 +++------- src/jogl/classes/javax/media/opengl/GLProfile.java | 6 ++--- .../com/sun/nativewindow/impl/NWReflection.java | 11 ++------ .../javafx/newt/opengl/broadcom/BCEGLWindow.java | 3 +++ src/newt/native/BroadcomEGL.c | 2 +- 11 files changed, 38 insertions(+), 108 deletions(-) (limited to 'src/jogl/classes/javax/media') diff --git a/make/build-jogl.xml b/make/build-jogl.xml index fda65c5b2..6a065a8e4 100644 --- a/make/build-jogl.xml +++ b/make/build-jogl.xml @@ -51,8 +51,8 @@ - - Some environment defs affecting compilation - - setup.noAWT is set iff: - !isWindows && !isOSX && !noX11 + - setup.nodesktop is set iff: + !isWindows && !isOSX && !isX11 - Internal settings, may not be necessary to set them manually, since all JAR archives are orthogonal. @@ -77,7 +77,7 @@ --> - + @@ -86,25 +86,11 @@ - - - - - - - - - - - - - - + - @@ -1769,7 +1755,7 @@ includes="${java.part.util.fixedfunc.shaders}"/> - + - + @@ -77,21 +77,13 @@ - - - - - - - - - + + - @@ -108,17 +100,12 @@ - - - - - + @@ -842,13 +829,13 @@ - + - + @@ -865,7 +852,7 @@ - + diff --git a/make/build-newt.xml b/make/build-newt.xml index 1ed039a57..be9547684 100644 --- a/make/build-newt.xml +++ b/make/build-newt.xml @@ -50,8 +50,8 @@ setup.noAWT setup.noOpenGL - - setup.noAWT is set iff: - !isWindows && !isOSX && !noX11 + - setup.nodesktop is set iff: + !isWindows && !isOSX && !isX11 --> @@ -73,28 +73,16 @@ - + + - - - - - - - - - - - - - - + @@ -110,7 +98,6 @@ - @@ -764,10 +751,11 @@ - + + includes="com/sun/javafx/newt/**" + excludes="${java.excludes.cdcfp}" /> diff --git a/make/make.jogl.all.linux-x86.sh b/make/make.jogl.all.linux-x86.sh index 8842cbc0c..0f764b360 100644 --- a/make/make.jogl.all.linux-x86.sh +++ b/make/make.jogl.all.linux-x86.sh @@ -13,13 +13,13 @@ fi # -DisUnix=true \ # -DisLinux=true \ # -DisLinuxX86=true \ +# -DisX11=true \ ant \ -Dbuild.noarchives=true \ -Djogl.cg=1 -Dx11.cg.lib=../../lib-linux-x86 \ -Drootrel.build=build-x86 \ -Dos.arch=x86 \ - -DisX11=true \ -DuseKD=true \ -DuseOpenMAX=true \ $* 2>&1 | tee make.jogl.all.linux-x86.log diff --git a/src/jogl/classes/com/sun/opengl/impl/GLDrawableImpl.java b/src/jogl/classes/com/sun/opengl/impl/GLDrawableImpl.java index e71cf33a0..c381f68f5 100644 --- a/src/jogl/classes/com/sun/opengl/impl/GLDrawableImpl.java +++ b/src/jogl/classes/com/sun/opengl/impl/GLDrawableImpl.java @@ -52,24 +52,7 @@ public abstract class GLDrawableImpl implements GLDrawable { this.factory = factory; this.component = comp; this.realized = realized; - - AbstractGraphicsConfiguration agc = component.getGraphicsConfiguration(); - if (agc == null) { - System.out.println("GLDrawableImpl no AbstractGraphicsConfiguration"); - System.out.println(component.getClass().getName()); - return; - } - AbstractGraphicsConfiguration ngc = agc.getNativeGraphicsConfiguration(); - if (ngc == null) { - System.out.println("GLDrawableImpl no native AbstractGraphicsConfiguration"); - return; - } - Capabilities caps = ngc.getRequestedCapabilities(); - if (caps == null) { - System.out.println("GLDrawableImpl no native Capabilities"); - return; - } - this.requestedCapabilities = (GLCapabilities)caps; // a copy .. + this.requestedCapabilities = (GLCapabilities)component.getGraphicsConfiguration().getNativeGraphicsConfiguration().getRequestedCapabilities(); // a copy .. } /** diff --git a/src/jogl/classes/com/sun/opengl/impl/egl/EGLDrawableFactory.java b/src/jogl/classes/com/sun/opengl/impl/egl/EGLDrawableFactory.java index e2ee65d27..396580c1d 100755 --- a/src/jogl/classes/com/sun/opengl/impl/egl/EGLDrawableFactory.java +++ b/src/jogl/classes/com/sun/opengl/impl/egl/EGLDrawableFactory.java @@ -45,19 +45,15 @@ import com.sun.gluegen.runtime.NativeLibrary; public class EGLDrawableFactory extends GLDrawableFactoryImpl { static { - try { // Register our GraphicsConfigurationFactory implementations // The act of constructing them causes them to be registered new EGLGraphicsConfigurationFactory(); // Check for other underlying stuff .. - /* if(NativeWindowFactory.TYPE_X11.equals(NativeWindowFactory.getNativeWindowType(false))) { + if(NativeWindowFactory.TYPE_X11.equals(NativeWindowFactory.getNativeWindowType(false))) { try { NWReflection.createInstance("com.sun.opengl.impl.x11.glx.X11GLXGraphicsConfigurationFactory"); } catch (Throwable t) {} - } */ - } catch (Throwable th) { - th.printStackTrace(); } } diff --git a/src/jogl/classes/com/sun/opengl/impl/egl/EGLDynamicLookupHelper.java b/src/jogl/classes/com/sun/opengl/impl/egl/EGLDynamicLookupHelper.java index 99f163ca1..8bed0eb35 100755 --- a/src/jogl/classes/com/sun/opengl/impl/egl/EGLDynamicLookupHelper.java +++ b/src/jogl/classes/com/sun/opengl/impl/egl/EGLDynamicLookupHelper.java @@ -50,7 +50,7 @@ import com.sun.gluegen.runtime.DynamicLookupHelper; * Currently two implementations exist, one for ES1 and one for ES2. */ public abstract class EGLDynamicLookupHelper implements DynamicLookupHelper { - protected static final boolean DEBUG = true; /* com.sun.opengl.impl.Debug.debug("EGL"); */ + protected static final boolean DEBUG = com.sun.opengl.impl.Debug.debug("EGL"); private static final EGLDynamicLookupHelper eglES1DynamicLookupHelper; private static final EGLDynamicLookupHelper eglES2DynamicLookupHelper; @@ -136,13 +136,9 @@ public abstract class EGLDynamicLookupHelper implements DynamicLookupHelper { private NativeLibrary loadFirstAvailable(List/**/ libNames, ClassLoader loader) { for (Iterator iter = libNames.iterator(); iter.hasNext(); ) { - String libname = (String) iter.next(); - NativeLibrary lib = NativeLibrary.open(libname, loader, false /*global*/); + NativeLibrary lib = NativeLibrary.open((String) iter.next(), loader, false /*global*/); if (lib != null) { - System.out.println("found: " + libname); return lib; - } else { - System.out.println("looked for: " + libname); } } return null; @@ -168,11 +164,9 @@ public abstract class EGLDynamicLookupHelper implements DynamicLookupHelper { // EGL libraries .. lib = loadFirstAvailable(eglLibNames, loader); if (lib == null) { - // throw new GLException("Unable to dynamically load EGL library for profile ES" + esProfile); - System.out.println("Unable to dynamically load EGL library for profile ES" + esProfile); - } else { - glesLibraries.add(lib); + throw new GLException("Unable to dynamically load EGL library for profile ES" + esProfile); } + glesLibraries.add(lib); } if (esProfile==2) { diff --git a/src/jogl/classes/javax/media/opengl/GLProfile.java b/src/jogl/classes/javax/media/opengl/GLProfile.java index 83a9b0098..ead5f6396 100644 --- a/src/jogl/classes/javax/media/opengl/GLProfile.java +++ b/src/jogl/classes/javax/media/opengl/GLProfile.java @@ -54,7 +54,7 @@ import com.sun.nativewindow.impl.jvm.JVMUtil; * or more specialized versions using the other static GetProfile methods. */ public class GLProfile implements Cloneable { - public static final boolean DEBUG = true; /* Debug.debug("GLProfile"); */ + public static final boolean DEBUG = Debug.debug("GLProfile"); // // Public (user-visible) profiles @@ -736,8 +736,8 @@ public class GLProfile implements Cloneable { } } mappedProfiles = _mappedProfiles; // final .. - if (null==defaultGLProfile) { - System.out.println("No profile available: "+list2String(GL_PROFILE_LIST_ALL)); + if(null==defaultGLProfile) { + throw new GLException("No profile available: "+list2String(GL_PROFILE_LIST_ALL)); } } diff --git a/src/nativewindow/classes/com/sun/nativewindow/impl/NWReflection.java b/src/nativewindow/classes/com/sun/nativewindow/impl/NWReflection.java index d054c205b..b13cf4317 100644 --- a/src/nativewindow/classes/com/sun/nativewindow/impl/NWReflection.java +++ b/src/nativewindow/classes/com/sun/nativewindow/impl/NWReflection.java @@ -40,7 +40,7 @@ import java.lang.reflect.*; import javax.media.nativewindow.*; public final class NWReflection { - public static final boolean DEBUG = true; /* Debug.debug("NWReflection"); */ + public static final boolean DEBUG = Debug.debug("NWReflection"); public static final boolean isClassAvailable(String clazzName) { try { @@ -69,11 +69,7 @@ public final class NWReflection { try { factory = factoryClass.getDeclaredConstructor( cstrArgTypes ); } catch(NoSuchMethodException nsme) { - nsme.printStackTrace(); - throw new NativeWindowException("Constructor: '" + clazzName + "("+cstrArgTypes+")' not found"); - } catch (Throwable th) { - th.printStackTrace(); - throw new NativeWindowException(th); + throw new NativeWindowException("Constructor: '" + clazzName + "("+cstrArgTypes+")' not found"); } return factory; } catch (Throwable e) { @@ -95,9 +91,6 @@ public final class NWReflection { factory = getConstructor(clazzName, cstrArgTypes); return factory.newInstance( cstrArgs ) ; } catch (Exception e) { - if (DEBUG) { - e.printStackTrace(); - } throw new NativeWindowException(e); } } diff --git a/src/newt/classes/com/sun/javafx/newt/opengl/broadcom/BCEGLWindow.java b/src/newt/classes/com/sun/javafx/newt/opengl/broadcom/BCEGLWindow.java index 9b790bd1f..29b92bc8f 100755 --- a/src/newt/classes/com/sun/javafx/newt/opengl/broadcom/BCEGLWindow.java +++ b/src/newt/classes/com/sun/javafx/newt/opengl/broadcom/BCEGLWindow.java @@ -124,6 +124,9 @@ public class BCEGLWindow extends Window { if (config == null) { throw new NativeWindowException("Error creating EGLGraphicsConfiguration from id: "+cfgID+", "+this); } + if(DEBUG_IMPLEMENTATION) { + System.out.println("BCEGLWindow.windowCreated: 0x"+Integer.toHexString(cfgID)+", "+width+"x"+height+", "+config); + } } private long windowHandleClose; diff --git a/src/newt/native/BroadcomEGL.c b/src/newt/native/BroadcomEGL.c index 55ca5f155..716f7d9ee 100755 --- a/src/newt/native/BroadcomEGL.c +++ b/src/newt/native/BroadcomEGL.c @@ -58,7 +58,7 @@ EGLSurface EGLUtil_CreateWindow( EGLDisplay eglDisplay, /* bool */ GLuint bChrom void EGLUtil_DestroyWindow( EGLDisplay eglDisplay, EGLSurface eglSurface ); void EGLUtil_SwapWindow( EGLDisplay eglDisplay, EGLSurface eglSurface ); -#define VERBOSE_ON 1 +// #define VERBOSE_ON 1 #ifdef VERBOSE_ON #define DBG_PRINT(...) fprintf(stdout, __VA_ARGS__) -- cgit v1.2.3 From ce34e2286a1ef4f8be874144e25c0268a1abf90f Mon Sep 17 00:00:00 2001 From: sg215889 Date: Tue, 28 Jul 2009 20:20:02 -0700 Subject: Use getNativeWindowType(custom=true) for factory selection; Don't fail is non native OS factory is available --- .../com/sun/opengl/impl/egl/EGLDrawableFactory.java | 2 +- src/jogl/classes/javax/media/opengl/GLDrawableFactory.java | 14 +++++++++----- .../com/sun/nativewindow/impl/NativeWindowFactoryImpl.java | 2 +- .../media/nativewindow/GraphicsConfigurationFactory.java | 2 +- 4 files changed, 12 insertions(+), 8 deletions(-) (limited to 'src/jogl/classes/javax/media') diff --git a/src/jogl/classes/com/sun/opengl/impl/egl/EGLDrawableFactory.java b/src/jogl/classes/com/sun/opengl/impl/egl/EGLDrawableFactory.java index 396580c1d..7af45d683 100755 --- a/src/jogl/classes/com/sun/opengl/impl/egl/EGLDrawableFactory.java +++ b/src/jogl/classes/com/sun/opengl/impl/egl/EGLDrawableFactory.java @@ -50,7 +50,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl { new EGLGraphicsConfigurationFactory(); // Check for other underlying stuff .. - if(NativeWindowFactory.TYPE_X11.equals(NativeWindowFactory.getNativeWindowType(false))) { + if(NativeWindowFactory.TYPE_X11.equals(NativeWindowFactory.getNativeWindowType(true))) { try { NWReflection.createInstance("com.sun.opengl.impl.x11.glx.X11GLXGraphicsConfigurationFactory"); } catch (Throwable t) {} diff --git a/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java b/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java index cee721fa6..5a761119f 100644 --- a/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java +++ b/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java @@ -106,16 +106,14 @@ public abstract class GLDrawableFactory { } eglFactory = tmp; - nativeOSType = NativeWindowFactory.getNativeWindowType(false); + nativeOSType = NativeWindowFactory.getNativeWindowType(true); String factoryClassName = null; tmp = null; try { factoryClassName = Debug.getProperty("jogl.gldrawablefactory.class.name", true, AccessController.getContext()); if (null == factoryClassName) { - if ( nativeOSType.equals(NativeWindowFactory.TYPE_EGL) ) { - // use egl*Factory .. - } else if ( nativeOSType.equals(NativeWindowFactory.TYPE_X11) ) { + if ( nativeOSType.equals(NativeWindowFactory.TYPE_X11) ) { factoryClassName = "com.sun.opengl.impl.x11.glx.X11GLXDrawableFactory"; } else if ( nativeOSType.equals(NativeWindowFactory.TYPE_WINDOWS) ) { factoryClassName = "com.sun.opengl.impl.windows.wgl.WindowsWGLDrawableFactory"; @@ -126,10 +124,16 @@ public abstract class GLDrawableFactory { factoryClassName = macosxFactoryClassNameCGL; } } else { - throw new GLException("Unsupported NativeWindow type: "+nativeOSType); + // may use egl*Factory .. + if (GLProfile.DEBUG) { + System.err.println("GLDrawableFactory.static - No Native OS Factory for: "+nativeOSType); + } } } if (null != factoryClassName) { + if (GLProfile.DEBUG) { + System.err.println("GLDrawableFactory.static - Native OS Factory for: "+nativeOSType+": "+factoryClassName); + } tmp = (GLDrawableFactory) NWReflection.createInstance(factoryClassName); } } catch (Throwable t) { diff --git a/src/nativewindow/classes/com/sun/nativewindow/impl/NativeWindowFactoryImpl.java b/src/nativewindow/classes/com/sun/nativewindow/impl/NativeWindowFactoryImpl.java index 424b44c8c..c94dab2f6 100644 --- a/src/nativewindow/classes/com/sun/nativewindow/impl/NativeWindowFactoryImpl.java +++ b/src/nativewindow/classes/com/sun/nativewindow/impl/NativeWindowFactoryImpl.java @@ -69,7 +69,7 @@ public class NativeWindowFactoryImpl extends NativeWindowFactory { private NativeWindow getAWTNativeWindow(Object winObj, AbstractGraphicsConfiguration config) { if (nativeWindowConstructor == null) { try { - String osType = getNativeWindowType(false); + String osType = getNativeWindowType(true); String windowClassName = null; // We break compile-time dependencies on the AWT here to diff --git a/src/nativewindow/classes/javax/media/nativewindow/GraphicsConfigurationFactory.java b/src/nativewindow/classes/javax/media/nativewindow/GraphicsConfigurationFactory.java index 1a9d4ac55..881499bec 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/GraphicsConfigurationFactory.java +++ b/src/nativewindow/classes/javax/media/nativewindow/GraphicsConfigurationFactory.java @@ -74,7 +74,7 @@ public abstract class GraphicsConfigurationFactory { abstractGraphicsDeviceClass = javax.media.nativewindow.AbstractGraphicsDevice.class; - if (NativeWindowFactory.TYPE_X11.equals(NativeWindowFactory.getNativeWindowType(false))) { + if (NativeWindowFactory.TYPE_X11.equals(NativeWindowFactory.getNativeWindowType(true))) { try { GraphicsConfigurationFactory factory = (GraphicsConfigurationFactory) NWReflection.createInstance("com.sun.nativewindow.impl.x11.X11GraphicsConfigurationFactory", new Object[] {}); -- cgit v1.2.3 From b00c6b4d36d60bc3a29a4458e42fb29c9a9ca941 Mon Sep 17 00:00:00 2001 From: sg215889 Date: Wed, 29 Jul 2009 02:49:40 -0700 Subject: Refine debug message --- .../classes/com/sun/opengl/impl/egl/EGLDynamicLookupHelper.java | 9 +++++++-- src/jogl/classes/javax/media/opengl/GLProfile.java | 2 ++ 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'src/jogl/classes/javax/media') diff --git a/src/jogl/classes/com/sun/opengl/impl/egl/EGLDynamicLookupHelper.java b/src/jogl/classes/com/sun/opengl/impl/egl/EGLDynamicLookupHelper.java index 8bed0eb35..02aed9788 100755 --- a/src/jogl/classes/com/sun/opengl/impl/egl/EGLDynamicLookupHelper.java +++ b/src/jogl/classes/com/sun/opengl/impl/egl/EGLDynamicLookupHelper.java @@ -42,6 +42,7 @@ import com.sun.opengl.impl.*; import com.sun.nativewindow.impl.*; import com.sun.gluegen.runtime.NativeLibrary; import com.sun.gluegen.runtime.DynamicLookupHelper; +import java.security.*; /** * Abstract implementation of the DynamicLookupHelper for EGL, @@ -51,12 +52,16 @@ import com.sun.gluegen.runtime.DynamicLookupHelper; */ public abstract class EGLDynamicLookupHelper implements DynamicLookupHelper { protected static final boolean DEBUG = com.sun.opengl.impl.Debug.debug("EGL"); + protected static final boolean DEBUG_LOOKUP; private static final EGLDynamicLookupHelper eglES1DynamicLookupHelper; private static final EGLDynamicLookupHelper eglES2DynamicLookupHelper; private List/**/ glesLibraries; static { + AccessControlContext localACC=AccessController.getContext(); + DEBUG_LOOKUP = com.sun.opengl.impl.Debug.isPropertyDefined("jogl.debug.DynamicLookup", true, localACC); + EGLDynamicLookupHelper tmp=null; try { tmp = new EGLES1DynamicLookupHelper(); @@ -190,7 +195,7 @@ public abstract class EGLDynamicLookupHelper implements DynamicLookupHelper { addr = dynamicLookupFunctionOnLibsImpl(funcName); } } - if(DEBUG) { + if(DEBUG_LOOKUP) { if(0!=addr) { System.err.println("Lookup-Native: "+glFuncName+" / "+funcName+" 0x"+Long.toHexString(addr)); } else { @@ -236,7 +241,7 @@ public abstract class EGLDynamicLookupHelper implements DynamicLookupHelper { } long addr = EGL.eglGetProcAddress(eglGetProcAddressHandle, glFuncName); - if(DEBUG) { + if(DEBUG_LOOKUP) { if(0!=addr) { System.err.println("Lookup-EGL: <"+glFuncName+"> 0x"+Long.toHexString(addr)); } diff --git a/src/jogl/classes/javax/media/opengl/GLProfile.java b/src/jogl/classes/javax/media/opengl/GLProfile.java index ead5f6396..6dab57469 100644 --- a/src/jogl/classes/javax/media/opengl/GLProfile.java +++ b/src/jogl/classes/javax/media/opengl/GLProfile.java @@ -709,6 +709,8 @@ public class GLProfile implements Cloneable { System.err.println("GLProfile.static hasGL3Impl "+hasGL3Impl); System.err.println("GLProfile.static hasGL2Impl "+hasGL2Impl); System.err.println("GLProfile.static hasGL2ES12Impl "+hasGL2ES12Impl); + System.err.println("GLProfile.static hasEGLDynLookup "+hasEGLDynLookup); + System.err.println("GLProfile.static hasEGLDrawableFactory "+hasEGLDrawableFactory); System.err.println("GLProfile.static hasGLES2Impl "+hasGLES2Impl); System.err.println("GLProfile.static hasGLES1Impl "+hasGLES1Impl); } -- cgit v1.2.3 From b5ce9cce6223810c6df7b66cf1a51318309fdc90 Mon Sep 17 00:00:00 2001 From: sg215889 Date: Wed, 29 Jul 2009 06:27:46 -0700 Subject: Fixed GL* documentation. Moved common GL functions to GLBase. Moved glAllocateMemoryNV to GL2GL3 only. Add GL2GL3 interface. Fix some GL2 signatures. BroadcomEGL disable custom setSize(). --- make/build-jogl.xml | 38 +++- make/config/jogl/eglext.cfg | 2 +- make/config/jogl/gl-common.cfg | 204 ++++++++------------- make/config/jogl/gl-es1.cfg | 12 +- make/config/jogl/gl-es2.cfg | 6 +- make/config/jogl/gl-gl2-set.cfg | 13 ++ make/config/jogl/gl-gl2.cfg | 17 +- make/config/jogl/gl-gl3.cfg | 9 +- make/config/jogl/gl-if-gl.cfg | 2 +- make/config/jogl/gl-if-gl2_es1.cfg | 10 +- make/config/jogl/gl-if-gl2_es2.cfg | 4 +- make/config/jogl/gl-if-gl2_gl3.cfg | 39 ++++ make/config/jogl/gl-impl-CustomJavaCode-gl2.java | 8 + .../jogl/gl-impl-CustomJavaCode-gl2es12.java | 16 +- make/config/jogl/gl-impl-CustomJavaCode-gl3.java | 8 + make/config/jogl/gl-impl-CustomJavaCode-gles1.java | 16 +- make/config/jogl/gl-impl-CustomJavaCode-gles2.java | 16 +- make/config/jogl/glxext.cfg | 2 +- make/doc/jogl/spec-overview.html | 13 +- make/lsGL2toGL3_commons.sh | 4 +- make/lsGL2toGL3_unique.sh | 16 ++ make/stub_includes/opengl/GL/glext.h | 8 +- src/jogl/classes/javax/media/opengl/GLBase.java | 148 ++++++++++++++- src/jogl/classes/javax/media/opengl/GLProfile.java | 14 +- .../classes/javax/media/opengl/awt/GLJPanel.java | 30 +-- .../javafx/newt/opengl/broadcom/BCEGLWindow.java | 6 +- 26 files changed, 435 insertions(+), 226 deletions(-) create mode 100644 make/config/jogl/gl-gl2-set.cfg create mode 100644 make/config/jogl/gl-if-gl2_gl3.cfg create mode 100644 make/lsGL2toGL3_unique.sh (limited to 'src/jogl/classes/javax/media') diff --git a/make/build-jogl.xml b/make/build-jogl.xml index 6a065a8e4..0f9a230a2 100644 --- a/make/build-jogl.xml +++ b/make/build-jogl.xml @@ -143,7 +143,7 @@ value="com/sun/opengl/impl/**/gl2/**"/> + value="javax/media/opengl/TraceGL2.* javax/media/opengl/DebugGL2.* javax/media/opengl/TraceGL2GL3.* javax/media/opengl/DebugGL2GL3.*"/> @@ -637,6 +637,25 @@ + + + + + + + + + + + @@ -697,7 +716,7 @@ - + @@ -1797,17 +1821,17 @@ + excludes="${java.part.gl2.dbg}, ${java.part.gl3.dbg}, ${java.part.glugl2}"/> + excludes="${java.part.gl2.dbg}, ${java.part.gl3.dbg}, ${java.part.glugl2}"/> + excludes="${java.part.gl2.dbg}, ${java.part.gl3.dbg}, ${java.part.glugl2}"/> The basic interface to OpenGL, providing access to core -ClassJavadoc GL * functionality up through the OpenGL 2.0 specification as well as -ClassJavadoc GL * all vendor extensions.

-ClassJavadoc GL * -ClassJavadoc GL *

While the APIs for vendor extensions are unconditionally -ClassJavadoc GL * exposed, the underlying functions may not be present. The method -ClassJavadoc GL * {@link #isFunctionAvailable} should be used to query the -ClassJavadoc GL * availability of any non-core function before it is used for the -ClassJavadoc GL * first time; for example, -ClassJavadoc GL * gl.isFunctionAvailable("glProgramStringARB"). On -ClassJavadoc GL * certain platforms (Windows in particular), the most "core" -ClassJavadoc GL * functionality is only OpenGL 1.1, so in theory any routines first -ClassJavadoc GL * exposed in OpenGL 1.2, 1.3, and 1.4, 1.5, or 2.0 as well as vendor -ClassJavadoc GL * extensions should all be queried. Calling an unavailable function -ClassJavadoc GL * will cause a {@link GLException} to be raised.

-ClassJavadoc GL * -ClassJavadoc GL * {@link #isExtensionAvailable} may also be used to determine whether -ClassJavadoc GL * a specific extension is available before calling the routines or -ClassJavadoc GL * using the functionality it exposes: for example, -ClassJavadoc GL * gl.isExtensionAvailable("GL_ARB_vertex_program");. -ClassJavadoc GL * However, in this case it is up to the end user to know which -ClassJavadoc GL * routines or functionality are associated with which OpenGL -ClassJavadoc GL * extensions. It may also be used to test for the availability of a -ClassJavadoc GL * particular version of OpenGL: for example, -ClassJavadoc GL * gl.isExtensionAvailable("GL_VERSION_1_5");. -ClassJavadoc GL * -ClassJavadoc GL *

Exceptions to the window system extension naming rules: -ClassJavadoc GL * -ClassJavadoc GL *

    -ClassJavadoc GL * -ClassJavadoc GL *
  • The memory allocators for the NVidia vertex_array_range (VAR) -ClassJavadoc GL * extension, in particular wglAllocateMemoryNV / -ClassJavadoc GL * glXAllocateMemoryNV and associated routines. {@link -ClassJavadoc GL * #glAllocateMemoryNV} has been provided for window system-independent -ClassJavadoc GL * access to VAR. {@link #isFunctionAvailable} will translate an argument -ClassJavadoc GL * of "glAllocateMemoryNV" or "glFreeMemoryNV" into the appropriate -ClassJavadoc GL * window system-specific name.

    -ClassJavadoc GL * -ClassJavadoc GL *
  • WGL_ARB_pbuffer, WGL_ARB_pixel_format, and other -ClassJavadoc GL * platform-specific pbuffer functionality; the availability of -ClassJavadoc GL * pbuffers can be queried on Windows, X11 and Mac OS X platforms by -ClassJavadoc GL * querying {@link #isExtensionAvailable} with an argument of -ClassJavadoc GL * "GL_ARB_pbuffer" or "GL_ARB_pixel_format". -ClassJavadoc GL * -ClassJavadoc GL *

-ClassJavadoc GL * +ClassJavadoc GL *

Common interface containing the subset of all profiles, GL3, GL2, GLES1 and GLES2.
+ClassJavadoc GL * This interface reflects common data types, texture and framebuffer functionality.

ClassJavadoc GL */ +ClassJavadoc GL2ES1 /** +ClassJavadoc GL2ES1 *

+ClassJavadoc GL2ES1 * Interface containing the common subset of GL2 and GLES1.
+ClassJavadoc GL2ES1 * This interface reflects only the fixed functionality of OpenGL
+ClassJavadoc GL2ES1 *

+ClassJavadoc GL2ES1 */ + +ClassJavadoc GL2ES2 /** +ClassJavadoc GL2ES2 *

+ClassJavadoc GL2ES2 * Interface containing the common subset of GL3, GL2 and GLES2.
+ClassJavadoc GL2ES2 * This interface reflects only the programmable shader functionality of desktop and embedded OpenGL
+ClassJavadoc GL2ES2 *

+ClassJavadoc GL2ES2 */ + +ClassJavadoc GL2GL3 /** +ClassJavadoc GL2GL3 *

+ClassJavadoc GL2GL3 * Interface containing the common subset of GL3 and GL2.
+ClassJavadoc GL2GL3 * This interface reflects only the programmable shader functionality of desktop OpenGL
+ClassJavadoc GL2GL3 *

+ClassJavadoc GL2GL3 */ + +ClassJavadoc GL2 /** +ClassJavadoc GL2 *

+ClassJavadoc GL2 * This interface contains all core desktop OpenGL methods through +ClassJavadoc GL2 * version 3.0, inclusive, as well as most of it's extensions defined at the +ClassJavadoc GL2 * time of this specification. Early OpenGL extensions whose functionality +ClassJavadoc GL2 * was incorporated into core OpenGL by version 2.0, inclusive, are specifically +ClassJavadoc GL2 * excluded. +ClassJavadoc GL2 *

+ClassJavadoc GL2 */ + +ClassJavadoc GL3 /** +ClassJavadoc GL3 *

+ClassJavadoc GL3 * This interface contains all core desktop OpenGL methods starting from 3.1, +ClassJavadoc GL3 * inclusive - forward compatible only, as well as most of it's extensions defined at the +ClassJavadoc GL3 * time of this specification.
+ClassJavadoc GL3 *

+ClassJavadoc GL3 */ + +ClassJavadoc GLES1 /** +ClassJavadoc GLES1 *

+ClassJavadoc GLES1 * This interface contains all core embedded OpenGL methods of ES 1.x, with x >= 0, +ClassJavadoc GLES1 * inclusive, as well as most of it's extensions defined at the +ClassJavadoc GLES1 * time of this specification. +ClassJavadoc GLES1 *

+ClassJavadoc GLES1 */ + +ClassJavadoc GLES2 /** +ClassJavadoc GLES2 *

+ClassJavadoc GLES2 * This interface contains all core embedded OpenGL methods of ES 2.x, with x >= 0, +ClassJavadoc GLES2 * inclusive, as well as most of it's extensions defined at the +ClassJavadoc GLES2 * time of this specification. +ClassJavadoc GLES2 *

+ClassJavadoc GLES2 */ + +# Javadoc for the EGL class +ClassJavadoc EGL /** +ClassJavadoc EGL * Provides access to the embedded-specific OpenGL vendor extensions. +ClassJavadoc EGL * See {@link GLBase} for more information. +ClassJavadoc EGL */ + # Javadoc for the WGL class ClassJavadoc WGL /** ClassJavadoc WGL * Provides access to the Windows-specific OpenGL vendor extensions. -ClassJavadoc WGL * See {@link GL} for more information. +ClassJavadoc WGL * See {@link GLBase} for more information. ClassJavadoc WGL */ # Javadoc for the GLX class ClassJavadoc GLX /** ClassJavadoc GLX * Provides access to the X11-specific OpenGL vendor extensions. -ClassJavadoc GLX * See {@link GL} for more information. +ClassJavadoc GLX * See {@link GLBase} for more information. ClassJavadoc GLX */ # Javadoc for the CGL class ClassJavadoc CGL /** ClassJavadoc CGL * Provides access to the MacOSX-specific OpenGL vendor extensions. -ClassJavadoc CGL * See {@link GL} for more information. +ClassJavadoc CGL * See {@link GLBase} for more information. ClassJavadoc CGL */ # Javadoc for the XVisualInfo class @@ -556,86 +573,9 @@ ClassJavadoc XVisualInfo */ # Custom code for querying extensions and exposing # wglAllocateMemoryNV/glXAllocateMemoryNV -CustomJavaCode GL /** -CustomJavaCode GL * Returns true if the specified OpenGL core- or extension-function can be -CustomJavaCode GL * used successfully through this GL instance given the current host (OpenGL -CustomJavaCode GL * client) and display (OpenGL server) configuration.

-CustomJavaCode GL * By "successfully" we mean that the function is both callable -CustomJavaCode GL * on the machine running the program and available on the current -CustomJavaCode GL * display.

-CustomJavaCode GL * -CustomJavaCode GL * In order to call a function successfully, the function must be both -CustomJavaCode GL * callable on the machine running the program and available on -CustomJavaCode GL * the display device that is rendering the output (note: on non-networked, -CustomJavaCode GL * single-display machines these two conditions are identical; on networked and/or -CustomJavaCode GL * multi-display machines this becomes more complicated). These conditions are -CustomJavaCode GL * met if the function is either part of the core OpenGL version supported by -CustomJavaCode GL * both the host and display, or it is an OpenGL extension function that both -CustomJavaCode GL * the host and display support.

-CustomJavaCode GL * -CustomJavaCode GL * A GL function is callable if it is successfully linked at runtime, -CustomJavaCode GL * hence the GLContext must be made current at least once. -CustomJavaCode GL * -CustomJavaCode GL * @param glFunctionName the name of the OpenGL function (e.g., use -CustomJavaCode GL * "glBindRenderbufferEXT" or "glBindRenderbuffer" to check if {@link -CustomJavaCode GL * #glBindRenderbuffer(int,int)} is available). -CustomJavaCode GL */ -CustomJavaCode GL public boolean isFunctionAvailable(String glFunctionName); - -CustomJavaCode GL /** -CustomJavaCode GL * Returns true if the specified OpenGL extension can be -CustomJavaCode GL * used successfully through this GL instance given the current host (OpenGL -CustomJavaCode GL * client) and display (OpenGL server) configuration.

-CustomJavaCode GL * -CustomJavaCode GL * @param glExtensionName the name of the OpenGL extension (e.g., -CustomJavaCode GL * "GL_ARB_vertex_program"). -CustomJavaCode GL */ -CustomJavaCode GL public boolean isExtensionAvailable(String glExtensionName); - -CustomJavaCode GL /** -CustomJavaCode GL * Provides platform-independent access to the wglAllocateMemoryNV / -CustomJavaCode GL * glXAllocateMemoryNV extension. -CustomJavaCode GL */ -CustomJavaCode GL public java.nio.ByteBuffer glAllocateMemoryNV(int arg0, float arg1, float arg2, float arg3); - -CustomJavaCode GL /** Provides a platform-independent way to specify the minimum swap -CustomJavaCode GL interval for buffer swaps. An argument of 0 disables -CustomJavaCode GL sync-to-vertical-refresh completely, while an argument of 1 -CustomJavaCode GL causes the application to wait until the next vertical refresh -CustomJavaCode GL until swapping buffers. The default, which is platform-specific, -CustomJavaCode GL is usually either 0 or 1. This function is not guaranteed to -CustomJavaCode GL have an effect, and in particular only affects heavyweight -CustomJavaCode GL onscreen components. */ -CustomJavaCode GL public void setSwapInterval(int interval); - -CustomJavaCode GL /** -CustomJavaCode GL * Returns an object through which platform-specific OpenGL extensions -CustomJavaCode GL * (WGL, GLX, etc.) may be accessed. The data type of the returned -CustomJavaCode GL * object and its associated capabilities are undefined. Most -CustomJavaCode GL * applications will never need to call this method. It is highly -CustomJavaCode GL * recommended that any applications which do call this method perform -CustomJavaCode GL * all accesses on the returned object reflectively to guard -CustomJavaCode GL * themselves against changes to the implementation. -CustomJavaCode GL */ -CustomJavaCode GL public Object getPlatformGLExtensions(); - -CustomJavaCode GL /** -CustomJavaCode GL * Returns an object providing access to the specified OpenGL -CustomJavaCode GL * extension. This is intended to provide a mechanism for vendors who -CustomJavaCode GL * which to provide access to new OpenGL extensions without changing -CustomJavaCode GL * the public API of the core package. For example, a user may request -CustomJavaCode GL * access to extension "GL_VENDOR_foo" and receive back an object -CustomJavaCode GL * which implements a vendor-specified interface which can call the -CustomJavaCode GL * OpenGL extension functions corresponding to that extension. It is -CustomJavaCode GL * up to the vendor to specify both the extension name and Java API -CustomJavaCode GL * for accessing it, including which class or interface contains the -CustomJavaCode GL * functions. -CustomJavaCode GL * -CustomJavaCode GL *

-CustomJavaCode GL * -CustomJavaCode GL * Note: it is the intent to add new extensions as quickly as possible -CustomJavaCode GL * to the core GL API. Therefore it is unlikely that most vendors will -CustomJavaCode GL * use this extension mechanism, but it is being provided for -CustomJavaCode GL * completeness. -CustomJavaCode GL */ -CustomJavaCode GL public Object getExtension(String extensionName); +CustomJavaCode GL2GL3 /** +CustomJavaCode GL2GL3 * Provides platform-independent access to the wglAllocateMemoryNV / +CustomJavaCode GL2GL3 * glXAllocateMemoryNV extension. +CustomJavaCode GL2GL3 */ +CustomJavaCode GL2GL3 public java.nio.ByteBuffer glAllocateMemoryNV(int arg0, float arg1, float arg2, float arg3); + diff --git a/make/config/jogl/gl-es1.cfg b/make/config/jogl/gl-es1.cfg index 02aae2860..35ea7f0ce 100755 --- a/make/config/jogl/gl-es1.cfg +++ b/make/config/jogl/gl-es1.cfg @@ -2,12 +2,12 @@ JavaOutputDir gensrc/classes NativeOutputDir gensrc/native/jogl/es1 -ExtendedInterfaceSymbols ../build-temp/gensrc/classes/javax/media/opengl/GL.java -ExtendedInterfaceSymbols ../build-temp/gensrc/classes/javax/media/opengl/GL2ES1.java -ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/GLBase.java -ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/fixedfunc/GLMatrixFunc.java -ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/fixedfunc/GLPointerFunc.java -ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/fixedfunc/GLLightingFunc.java +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL.java +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL2ES1.java +ExtendedInterfaceSymbolsIgnore ../src/jogl/classes/javax/media/opengl/GLBase.java +ExtendedInterfaceSymbolsIgnore ../src/jogl/classes/javax/media/opengl/fixedfunc/GLMatrixFunc.java +ExtendedInterfaceSymbolsIgnore ../src/jogl/classes/javax/media/opengl/fixedfunc/GLPointerFunc.java +ExtendedInterfaceSymbolsIgnore ../src/jogl/classes/javax/media/opengl/fixedfunc/GLLightingFunc.java # There are a few routines we don't handle yet Ignore glGetBufferPointervOES diff --git a/make/config/jogl/gl-es2.cfg b/make/config/jogl/gl-es2.cfg index 244f1944f..6a81c9376 100755 --- a/make/config/jogl/gl-es2.cfg +++ b/make/config/jogl/gl-es2.cfg @@ -2,9 +2,9 @@ JavaOutputDir gensrc/classes NativeOutputDir gensrc/native/jogl/es2 -ExtendedInterfaceSymbols ../build-temp/gensrc/classes/javax/media/opengl/GL.java -ExtendedInterfaceSymbols ../build-temp/gensrc/classes/javax/media/opengl/GL2ES2.java -ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/GLBase.java +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL.java +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL2ES2.java +ExtendedInterfaceSymbolsIgnore ../src/jogl/classes/javax/media/opengl/GLBase.java Package javax.media.opengl Style InterfaceAndImpl diff --git a/make/config/jogl/gl-gl2-set.cfg b/make/config/jogl/gl-gl2-set.cfg new file mode 100644 index 000000000..bce9cc731 --- /dev/null +++ b/make/config/jogl/gl-gl2-set.cfg @@ -0,0 +1,13 @@ +# This .cfg file is used to generate the GL interface and implementing class. +JavaOutputDir ../../build-temp/gluegen-set + +Package javax.media.opengl +Style InterfaceOnly +JavaClass GL2Set +Include gl-common-gl2.cfg +Include gl-common-extensions.cfg +Include gl-desktop.cfg + +EmitProcAddressTable false +ProcAddressTableClassName DontGenerateProcAddressTableStuff +GetProcAddressTableExpr DontGenerateProcAddressTableStuff diff --git a/make/config/jogl/gl-gl2.cfg b/make/config/jogl/gl-gl2.cfg index 8dfe76758..55f5b9781 100644 --- a/make/config/jogl/gl-gl2.cfg +++ b/make/config/jogl/gl-gl2.cfg @@ -2,13 +2,14 @@ JavaOutputDir gensrc/classes NativeOutputDir gensrc/native/jogl/gl2 -ExtendedInterfaceSymbols ../build-temp/gensrc/classes/javax/media/opengl/GL.java -ExtendedInterfaceSymbols ../build-temp/gensrc/classes/javax/media/opengl/GL2ES1.java -ExtendedInterfaceSymbols ../build-temp/gensrc/classes/javax/media/opengl/GL2ES2.java -ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/GLBase.java -ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/fixedfunc/GLMatrixFunc.java -ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/fixedfunc/GLPointerFunc.java -ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/fixedfunc/GLLightingFunc.java +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL.java +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL2ES1.java +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL2ES2.java +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL2GL3.java +ExtendedInterfaceSymbolsIgnore ../src/jogl/classes/javax/media/opengl/GLBase.java +ExtendedInterfaceSymbolsIgnore ../src/jogl/classes/javax/media/opengl/fixedfunc/GLMatrixFunc.java +ExtendedInterfaceSymbolsIgnore ../src/jogl/classes/javax/media/opengl/fixedfunc/GLPointerFunc.java +ExtendedInterfaceSymbolsIgnore ../src/jogl/classes/javax/media/opengl/fixedfunc/GLLightingFunc.java Package javax.media.opengl Style InterfaceAndImpl @@ -17,12 +18,14 @@ Extends GL2 GLBase Extends GL2 GL Extends GL2 GL2ES1 Extends GL2 GL2ES2 +Extends GL2 GL2GL3 ImplPackage com.sun.opengl.impl.gl2 ImplJavaClass GL2Impl Implements GL2Impl GLBase Implements GL2Impl GL Implements GL2Impl GL2ES1 Implements GL2Impl GL2ES2 +Implements GL2Impl GL2GL3 Include gl-common-gl2.cfg Include gl-common-extensions.cfg Include gl-desktop.cfg diff --git a/make/config/jogl/gl-gl3.cfg b/make/config/jogl/gl-gl3.cfg index 2b521e30a..c5354cba4 100644 --- a/make/config/jogl/gl-gl3.cfg +++ b/make/config/jogl/gl-gl3.cfg @@ -2,9 +2,10 @@ JavaOutputDir gensrc/classes NativeOutputDir gensrc/native/jogl/gl3 -ExtendedInterfaceSymbols ../build-temp/gensrc/classes/javax/media/opengl/GL.java -ExtendedInterfaceSymbols ../build-temp/gensrc/classes/javax/media/opengl/GL2ES2.java -ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/GLBase.java +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL.java +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL2ES2.java +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL2GL3.java +ExtendedInterfaceSymbolsIgnore ../src/jogl/classes/javax/media/opengl/GLBase.java Package javax.media.opengl Style InterfaceAndImpl @@ -12,11 +13,13 @@ JavaClass GL3 Extends GL3 GLBase Extends GL3 GL Extends GL3 GL2ES2 +Extends GL3 GL2GL3 ImplPackage com.sun.opengl.impl.gl3 ImplJavaClass GL3Impl Implements GL3Impl GLBase Implements GL3Impl GL Implements GL3Impl GL2ES2 +Implements GL3Impl GL2GL3 Include gl-common-gl2.cfg Include gl-common-extensions.cfg Include gl3-desktop.cfg diff --git a/make/config/jogl/gl-if-gl.cfg b/make/config/jogl/gl-if-gl.cfg index 46e11fdd4..1bba846e7 100755 --- a/make/config/jogl/gl-if-gl.cfg +++ b/make/config/jogl/gl-if-gl.cfg @@ -4,7 +4,7 @@ Style InterfaceOnly JavaClass GL Extends GL GLBase -ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/GLBase.java +ExtendedInterfaceSymbolsIgnore ../src/jogl/classes/javax/media/opengl/GLBase.java HierarchicalNativeOutput false Include gl-common.cfg diff --git a/make/config/jogl/gl-if-gl2_es1.cfg b/make/config/jogl/gl-if-gl2_es1.cfg index d09ebcb30..6fe6b4b90 100755 --- a/make/config/jogl/gl-if-gl2_es1.cfg +++ b/make/config/jogl/gl-if-gl2_es1.cfg @@ -8,11 +8,11 @@ Extends GL2ES1 GLMatrixFunc Extends GL2ES1 GLPointerFunc Extends GL2ES1 GLLightingFunc -ExtendedInterfaceSymbols ../build-temp/gensrc/classes/javax/media/opengl/GL.java -ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/GLBase.java -ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/fixedfunc/GLMatrixFunc.java -ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/fixedfunc/GLPointerFunc.java -ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/fixedfunc/GLLightingFunc.java +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL.java +ExtendedInterfaceSymbolsIgnore ../src/jogl/classes/javax/media/opengl/GLBase.java +ExtendedInterfaceSymbolsIgnore ../src/jogl/classes/javax/media/opengl/fixedfunc/GLMatrixFunc.java +ExtendedInterfaceSymbolsIgnore ../src/jogl/classes/javax/media/opengl/fixedfunc/GLPointerFunc.java +ExtendedInterfaceSymbolsIgnore ../src/jogl/classes/javax/media/opengl/fixedfunc/GLLightingFunc.java HierarchicalNativeOutput false Include gl-common.cfg diff --git a/make/config/jogl/gl-if-gl2_es2.cfg b/make/config/jogl/gl-if-gl2_es2.cfg index 5345c3ba1..63f96d906 100755 --- a/make/config/jogl/gl-if-gl2_es2.cfg +++ b/make/config/jogl/gl-if-gl2_es2.cfg @@ -5,8 +5,8 @@ JavaClass GL2ES2 Extends GL2ES2 GLBase Extends GL2ES2 GL -ExtendedInterfaceSymbols ../build-temp/gensrc/classes/javax/media/opengl/GL.java -ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/GLBase.java +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL.java +ExtendedInterfaceSymbolsIgnore ../src/jogl/classes/javax/media/opengl/GLBase.java HierarchicalNativeOutput false Include gl-common.cfg Include gl-common-extensions.cfg diff --git a/make/config/jogl/gl-if-gl2_gl3.cfg b/make/config/jogl/gl-if-gl2_gl3.cfg new file mode 100644 index 000000000..0afe5d5b5 --- /dev/null +++ b/make/config/jogl/gl-if-gl2_gl3.cfg @@ -0,0 +1,39 @@ +# This .cfg file is used to generate the GL interface and implementing class. +Package javax.media.opengl +Style InterfaceOnly +JavaClass GL2GL3 +Extends GL2GL3 GLBase +Extends GL2GL3 GL +Extends GL2GL3 GL2ES2 + +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL.java +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL2ES2.java +ExtendedInterfaceSymbolsIgnore ../src/jogl/classes/javax/media/opengl/GLBase.java + +ExtendedInterfaceSymbolsOnly ../build-temp/gluegen-set/javax/media/opengl/GL2Set.java + +HierarchicalNativeOutput false +Include gl-common.cfg +Include gl-common-extensions.cfg + +JavaOutputDir gensrc/classes +NativeOutputDir gensrc/native/jogl + +# +# Same name but different signature .. +# +# No collisions found .. good! + +EmitProcAddressTable false +ProcAddressTableClassName DontGenerateProcAddressTableStuff +GetProcAddressTableExpr DontGenerateProcAddressTableStuff + +# Inform the glue code generator of the association between #defines +# and functions and the extensions in which they are defined +GLHeader GL3/gl3.h +GLHeader GL3/gl3ext.h + +# Pick up on-line OpenGL javadoc thanks to user cylab on javagaming.org forums +TagNativeBinding true + +Import java.io.PrintStream diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gl2.java b/make/config/jogl/gl-impl-CustomJavaCode-gl2.java index b3410040b..5aec51fc7 100644 --- a/make/config/jogl/gl-impl-CustomJavaCode-gl2.java +++ b/make/config/jogl/gl-impl-CustomJavaCode-gl2.java @@ -53,6 +53,10 @@ public final boolean isGL2ES2() { return true; } +public final boolean isGL2GL3() { + return true; +} + public final boolean hasGLSL() { return true; } @@ -85,6 +89,10 @@ public final GL2ES2 getGL2ES2() throws GLException { return this; } +public final GL2GL3 getGL2GL3() throws GLException { + return this; +} + public boolean isFunctionAvailable(String glFunctionName) { return _context.isFunctionAvailable(glFunctionName); } diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gl2es12.java b/make/config/jogl/gl-impl-CustomJavaCode-gl2es12.java index d7b3de789..cb4cab175 100644 --- a/make/config/jogl/gl-impl-CustomJavaCode-gl2es12.java +++ b/make/config/jogl/gl-impl-CustomJavaCode-gl2es12.java @@ -56,6 +56,10 @@ public final boolean isGL2ES2() { return isGL2ES2; } +public final boolean isGL2GL3() { + return false; +} + public final boolean hasGLSL() { return isGL2ES2; } @@ -94,6 +98,10 @@ public final GL2ES2 getGL2ES2() throws GLException { throw new GLException("Not a GL2ES2 implementation"); } +public final GL2GL3 getGL2GL3() throws GLException { + throw new GLException("Not a GL2GL3 implementation"); +} + public boolean isFunctionAvailable(String glFunctionName) { return _context.isFunctionAvailable(glFunctionName); } @@ -115,14 +123,6 @@ public GLContext getContext() { private GLContextImpl _context; -/** - * Provides platform-independent access to the wglAllocateMemoryNV / - * glXAllocateMemoryNV extension. - */ -public java.nio.ByteBuffer glAllocateMemoryNV(int arg0, float arg1, float arg2, float arg3) { - return _context.glAllocateMemoryNV(arg0, arg1, arg2, arg3); -} - public void setSwapInterval(int interval) { _context.setSwapInterval(interval); } diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gl3.java b/make/config/jogl/gl-impl-CustomJavaCode-gl3.java index aa1ef6575..a15964bcc 100644 --- a/make/config/jogl/gl-impl-CustomJavaCode-gl3.java +++ b/make/config/jogl/gl-impl-CustomJavaCode-gl3.java @@ -53,6 +53,10 @@ public final boolean isGL2ES2() { return true; } +public final boolean isGL2GL3() { + return true; +} + public final boolean hasGLSL() { return true; } @@ -85,6 +89,10 @@ public final GL2ES2 getGL2ES2() throws GLException { return this; } +public final GL2GL3 getGL2GL3() throws GLException { + return this; +} + public boolean isFunctionAvailable(String glFunctionName) { return _context.isFunctionAvailable(glFunctionName); } diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gles1.java b/make/config/jogl/gl-impl-CustomJavaCode-gles1.java index d349f8018..5141376df 100755 --- a/make/config/jogl/gl-impl-CustomJavaCode-gles1.java +++ b/make/config/jogl/gl-impl-CustomJavaCode-gles1.java @@ -36,6 +36,10 @@ public final boolean isGL2ES2() { return false; } +public final boolean isGL2GL3() { + return false; +} + public final boolean hasGLSL() { return false; } @@ -68,6 +72,10 @@ public final GL2ES2 getGL2ES2() throws GLException { throw new GLException("Not a GL2ES2 implementation"); } +public final GL2GL3 getGL2GL3() throws GLException { + throw new GLException("Not a GL2GL3 implementation"); +} + public boolean isFunctionAvailable(String glFunctionName) { return _context.isFunctionAvailable(glFunctionName); } @@ -89,14 +97,6 @@ public GLContext getContext() { private GLContextImpl _context; -/** - * Provides platform-independent access to the wglAllocateMemoryNV / - * glXAllocateMemoryNV extension. - */ -public java.nio.ByteBuffer glAllocateMemoryNV(int arg0, float arg1, float arg2, float arg3) { - return _context.glAllocateMemoryNV(arg0, arg1, arg2, arg3); -} - public void setSwapInterval(int interval) { _context.setSwapInterval(interval); } diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gles2.java b/make/config/jogl/gl-impl-CustomJavaCode-gles2.java index 28edd7a63..b53715ae0 100755 --- a/make/config/jogl/gl-impl-CustomJavaCode-gles2.java +++ b/make/config/jogl/gl-impl-CustomJavaCode-gles2.java @@ -40,6 +40,10 @@ public final boolean isGL2ES2() { return true; } +public final boolean isGL2GL3() { + return false; +} + public final boolean hasGLSL() { return true; } @@ -72,6 +76,10 @@ public final GL2ES2 getGL2ES2() throws GLException { return this; } +public final GL2GL3 getGL2GL3() throws GLException { + throw new GLException("Not a GL2GL3 implementation"); +} + public boolean isFunctionAvailable(String glFunctionName) { return _context.isFunctionAvailable(glFunctionName); } @@ -93,14 +101,6 @@ public GLContext getContext() { private GLContextImpl _context; -/** - * Provides platform-independent access to the wglAllocateMemoryNV / - * glXAllocateMemoryNV extension. - */ -public java.nio.ByteBuffer glAllocateMemoryNV(int arg0, float arg1, float arg2, float arg3) { - return _context.glAllocateMemoryNV(arg0, arg1, arg2, arg3); -} - public void setSwapInterval(int interval) { _context.setSwapInterval(interval); } diff --git a/make/config/jogl/glxext.cfg b/make/config/jogl/glxext.cfg index 9688a9436..ea4b6fe47 100755 --- a/make/config/jogl/glxext.cfg +++ b/make/config/jogl/glxext.cfg @@ -9,7 +9,7 @@ JavaClass GLXExt ImplPackage com.sun.opengl.impl.x11.glx ImplJavaClass GLXExtImpl -ExtendedInterfaceSymbols ../build-temp/gensrc/classes/com/sun/opengl/impl/x11/glx/GLX.java +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/com/sun/opengl/impl/x11/glx/GLX.java Include gl-common-gl2.cfg Include gl-desktop.cfg diff --git a/make/doc/jogl/spec-overview.html b/make/doc/jogl/spec-overview.html index 11074e601..4ee902719 100644 --- a/make/doc/jogl/spec-overview.html +++ b/make/doc/jogl/spec-overview.html @@ -11,7 +11,7 @@ This specification, an optional set of packages, describes the Java(TM) bindings to the native OpenGL(R) 3D graphics library profiles:

    -
  • Desktop OpenGL 1.x, 2.y and 3.0, with x >= 5 and y >= 0
  • +
  • Desktop OpenGL 1.x, 2.y and 3.0, with x >= 3 and y >= 0
  • Desktop OpenGL 3.x, with x >= 1
  • Embedded OpenGL ES 1.x, with x >= 0
  • Embedded OpenGL ES 2.x, with x >= 0
  • @@ -60,7 +60,7 @@ excluded.
  • {@link javax.media.opengl.GL3 javax.media.opengl.GL3} interface

    This interface contains all core desktop OpenGL methods starting from 3.1, -inclusive, as well as most of it's extensions defined at the +inclusive - forward compatible only, as well as most of it's extensions defined at the time of this specification.
    Future extensions will be added with a maintenance update

  • @@ -101,7 +101,12 @@ time of this specification.
  • {@link javax.media.opengl.GL2ES2 javax.media.opengl.GL2ES2} interface

    Interface containing the common subset of GL3, GL2 and GLES2.
    - This interface reflects only the programmable shader functionality of OpenGL

  • + This interface reflects only the programmable shader functionality of desktop and embedded OpenGL
    + +
  • {@link javax.media.opengl.GL2GL3 javax.media.opengl.GL2GL3} interface
    +
    + Interface containing the common subset of GL3 and GL2.
    + This interface reflects only the programmable shader functionality of desktop OpenGL


@@ -500,7 +505,7 @@ http://www.khronos.org/registry/gles/
  • Proposed Final Draft Review, February/March 2006
  • 1.0.0 Final Release, September 2006
  • 1.1.0 Maintenance Release, April 2007 -
  • 1.2.0 Maintenance Release, June 2009 +
  • 2.0.0 Maintenance Release, July 2009

    diff --git a/make/lsGL2toGL3_commons.sh b/make/lsGL2toGL3_commons.sh index cccfa734c..7f2a276de 100644 --- a/make/lsGL2toGL3_commons.sh +++ b/make/lsGL2toGL3_commons.sh @@ -10,7 +10,7 @@ fi idir=$BUILDDIR/jogl/gensrc/classes/javax/media/opengl echo GL2 to GL3 enums -sort $idir/GL2.java $idir/GL3.java $idir/GL2ES2.java | uniq -d | grep GL_ | awk ' { print $5 } ' +sort $idir/GL2.java $idir/GL3.java $idir/GL2ES2.java $idir/GL2GL3.java | uniq -d | grep GL_ | awk ' { print $5 } ' echo GL2 to GL3 functions -sort $idir/GL2.java $idir/GL3.java $idir/GL2ES2.java | uniq -d | grep "public [a-z0-9_]* gl" +sort $idir/GL2.java $idir/GL3.java $idir/GL2ES2.java $idir/GL2GL3.java | uniq -d | grep "public [a-z0-9_]* gl" diff --git a/make/lsGL2toGL3_unique.sh b/make/lsGL2toGL3_unique.sh new file mode 100644 index 000000000..20d821332 --- /dev/null +++ b/make/lsGL2toGL3_unique.sh @@ -0,0 +1,16 @@ +#! /bin/sh + +BUILDDIR=$1 +shift +if [ -z "$BUILDDIR" ] ; then + echo "usage $0 " + exit 1 +fi + +idir=$BUILDDIR/jogl/gensrc/classes/javax/media/opengl + +echo GL2 to GL3 enums +sort $idir/GL2.java $idir/GL3.java $idir/GL2ES2.java $idir/GL2GL3.java | uniq -u | grep GL_ | awk ' { print $5 } ' + +echo GL2 to GL3 functions +sort $idir/GL2.java $idir/GL3.java $idir/GL2ES2.java $idir/GL2GL3.java | uniq -u | grep "public [a-z0-9_]* gl" diff --git a/make/stub_includes/opengl/GL/glext.h b/make/stub_includes/opengl/GL/glext.h index e6c6fab40..1016638dd 100644 --- a/make/stub_includes/opengl/GL/glext.h +++ b/make/stub_includes/opengl/GL/glext.h @@ -4475,7 +4475,7 @@ GLAPI void APIENTRY glEndTransformFeedback (void); GLAPI void APIENTRY glBindBufferRange (GLenum, GLuint, GLuint, GLintptr, GLsizeiptr); GLAPI void APIENTRY glBindBufferBase (GLenum, GLuint, GLuint); GLAPI void APIENTRY glTransformFeedbackVaryings (GLuint, GLsizei, const GLchar **, GLenum); -GLAPI void APIENTRY glGetTransformFeedbackVarying (GLuint, GLuint, GLint *); +GLAPI void APIENTRY glGetTransformFeedbackVarying (GLuint, GLuint, GLsizei, GLsizei *, GLsizei *, GLenum *, GLchar *); GLAPI void APIENTRY glClampColor (GLenum, GLenum); GLAPI void APIENTRY glBeginConditionalRender (GLuint, GLenum); GLAPI void APIENTRY glEndConditionalRender (void); @@ -4534,7 +4534,7 @@ typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKPROC) (void); typedef void (APIENTRYP PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); typedef void (APIENTRYP PFNGLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer); typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode); -typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint program, GLuint index, GLint *location); +typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); typedef void (APIENTRYP PFNGLCLAMPCOLORPROC) (GLenum target, GLenum clamp); typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERPROC) (GLuint id, GLenum mode); typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERPROC) (void); @@ -5255,10 +5255,10 @@ typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divi #ifndef GL_ARB_map_buffer_range #define GL_ARB_map_buffer_range 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMapBufferRange (GLenum, GLintptr, GLsizeiptr, GLbitfield); +GLAPI GLvoid* APIENTRY glMapBufferRange (GLenum, GLintptr, GLsizeiptr, GLbitfield); GLAPI void APIENTRY glFlushMappedBufferRange (GLenum, GLintptr, GLsizeiptr); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); +typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length); #endif diff --git a/src/jogl/classes/javax/media/opengl/GLBase.java b/src/jogl/classes/javax/media/opengl/GLBase.java index efd2eedd1..7b59344cc 100644 --- a/src/jogl/classes/javax/media/opengl/GLBase.java +++ b/src/jogl/classes/javax/media/opengl/GLBase.java @@ -7,9 +7,53 @@ package javax.media.opengl; import java.nio.*; /** - * The base interface from which all GL profiles derive, providing - * checked conversion down to concrete profiles, and access to the - * OpenGL context associated with the GL. + *

    The base interface from which all GL profiles derive, providing + * checked conversion down to concrete profiles, access to the + * OpenGL context associated with the GL and extension/function + * availability queries as described below.

    + * + *

    While the APIs for vendor extensions are unconditionally + * exposed, the underlying functions may not be present. The method + * {@link #isFunctionAvailable} should be used to query the + * availability of any non-core function before it is used for the + * first time; for example, + * gl.isFunctionAvailable("glProgramStringARB"). On + * certain platforms (Windows in particular), the most "core" + * functionality is only OpenGL 1.1, so in theory any routines first + * exposed in OpenGL 1.2, 1.3, and 1.4, 1.5, or 2.0 as well as vendor + * extensions should all be queried. Calling an unavailable function + * will cause a {@link GLException} to be raised.

    + * + * {@link #isExtensionAvailable} may also be used to determine whether + * a specific extension is available before calling the routines or + * using the functionality it exposes: for example, + * gl.isExtensionAvailable("GL_ARB_vertex_program");. + * However, in this case it is up to the end user to know which + * routines or functionality are associated with which OpenGL + * extensions. It may also be used to test for the availability of a + * particular version of OpenGL: for example, + * gl.isExtensionAvailable("GL_VERSION_1_5");. + * + *

    Exceptions to the window system extension naming rules: + * + *

      + * + *
    • The memory allocators for the NVidia vertex_array_range (VAR) + * extension, in particular wglAllocateMemoryNV / + * glXAllocateMemoryNV and associated routines. {@link + * #glAllocateMemoryNV} has been provided for window system-independent + * access to VAR. {@link #isFunctionAvailable} will translate an argument + * of "glAllocateMemoryNV" or "glFreeMemoryNV" into the appropriate + * window system-specific name.

      + * + *
    • WGL_ARB_pbuffer, WGL_ARB_pixel_format, and other + * platform-specific pbuffer functionality; the availability of + * pbuffers can be queried on Windows, X11 and Mac OS X platforms by + * querying {@link #isExtensionAvailable} with an argument of + * "GL_ARB_pbuffer" or "GL_ARB_pixel_format". + * + *

    + * */ public interface GLBase { @@ -63,6 +107,12 @@ public interface GLBase { */ public boolean isGL2ES2(); + /** + * Indicates whether this GL object conforms to the GL2GL3 compatible profile. + * @return whether this GL object conforms to the GL2GL3 profile + */ + public boolean isGL2GL3(); + /** Indicates whether this GL object supports GLSL. */ public boolean hasGLSL(); @@ -116,14 +166,100 @@ public interface GLBase { public GL2ES2 getGL2ES2() throws GLException; /** - * Returns the GLContext with which this GL object is associated. - * @return the GLContext with which this GL object is associated + * Casts this object to the GL2GL3 interface. + * @return this object cast to the GL2GL3 interface + * @throws GLException if this GLObject is not a GL2GL3 implementation */ - public GLContext getContext(); + public GL2GL3 getGL2GL3() throws GLException; /** * Returns the GLProfile with which this GL object is associated. * @return the GLProfile with which this GL object is associated */ public GLProfile getGLProfile(); + + /** + * Returns the GLContext with which this GL object is associated. + * @return the GLContext with which this GL object is associated + */ + public GLContext getContext(); + + /** + * Returns true if the specified OpenGL core- or extension-function can be + * used successfully through this GL instance given the current host (OpenGL + * client) and display (OpenGL server) configuration.

    + * By "successfully" we mean that the function is both callable + * on the machine running the program and available on the current + * display.

    + * + * In order to call a function successfully, the function must be both + * callable on the machine running the program and available on + * the display device that is rendering the output (note: on non-networked, + * single-display machines these two conditions are identical; on networked and/or + * multi-display machines this becomes more complicated). These conditions are + * met if the function is either part of the core OpenGL version supported by + * both the host and display, or it is an OpenGL extension function that both + * the host and display support.

    + * + * A GL function is callable if it is successfully linked at runtime, + * hence the GLContext must be made current at least once. + * + * @param glFunctionName the name of the OpenGL function (e.g., use + * "glBindRenderbufferEXT" or "glBindRenderbuffer" to check if {@link + * #glBindRenderbuffer(int,int)} is available). + */ + public boolean isFunctionAvailable(String glFunctionName); + + /** + * Returns true if the specified OpenGL extension can be + * used successfully through this GL instance given the current host (OpenGL + * client) and display (OpenGL server) configuration.

    + * + * @param glExtensionName the name of the OpenGL extension (e.g., + * "GL_ARB_vertex_program"). + */ + public boolean isExtensionAvailable(String glExtensionName); + + /** Provides a platform-independent way to specify the minimum swap + interval for buffer swaps. An argument of 0 disables + sync-to-vertical-refresh completely, while an argument of 1 + causes the application to wait until the next vertical refresh + until swapping buffers. The default, which is platform-specific, + is usually either 0 or 1. This function is not guaranteed to + have an effect, and in particular only affects heavyweight + onscreen components. */ + public void setSwapInterval(int interval); + + /** + * Returns an object through which platform-specific OpenGL extensions + * (EGL, GLX, WGL, etc.) may be accessed. The data type of the returned + * object and its associated capabilities are undefined. Most + * applications will never need to call this method. It is highly + * recommended that any applications which do call this method perform + * all accesses on the returned object reflectively to guard + * themselves against changes to the implementation. + */ + public Object getPlatformGLExtensions(); + + /** + * Returns an object providing access to the specified OpenGL + * extension. This is intended to provide a mechanism for vendors who + * wish to provide access to new OpenGL extensions without changing + * the public API of the core package. For example, a user may request + * access to extension "GL_VENDOR_foo" and receive back an object + * which implements a vendor-specified interface which can call the + * OpenGL extension functions corresponding to that extension. It is + * up to the vendor to specify both the extension name and Java API + * for accessing it, including which class or interface contains the + * functions. + * + *

    + * + * Note: it is the intent to add new extensions as quickly as possible + * to the core GL API. Therefore it is unlikely that most vendors will + * use this extension mechanism, but it is being provided for + * completeness. + */ + public Object getExtension(String extensionName); } + diff --git a/src/jogl/classes/javax/media/opengl/GLProfile.java b/src/jogl/classes/javax/media/opengl/GLProfile.java index 6dab57469..8b23bed04 100644 --- a/src/jogl/classes/javax/media/opengl/GLProfile.java +++ b/src/jogl/classes/javax/media/opengl/GLProfile.java @@ -78,10 +78,13 @@ public class GLProfile implements Cloneable { /** The intersection of the desktop GL3, GL2 and embedded ES2 profile */ public static final String GL2ES2 = "GL2ES2"; + /** The intersection of the desktop GL3 and GL2 profile */ + public static final String GL2GL3 = "GL2GL3"; + /** - * All GL Profiles in the order of default detection: GL2, GL2ES2, GL2ES1, GLES2, GLES1, GL3 + * All GL Profiles in the order of default detection: GL2, GL2ES2, GL2ES1, GLES2, GLES1, GL2GL3, GL3 */ - public static final String[] GL_PROFILE_LIST_ALL = new String[] { GL2, GL2ES2, GL2ES1, GLES2, GLES1, GL3 }; + public static final String[] GL_PROFILE_LIST_ALL = new String[] { GL2, GL2ES2, GL2ES1, GLES2, GLES1, GL2GL3, GL3 }; /** * All GL2ES2 Profiles in the order of default detection: GL2ES2, GL2, GLES2, GL3 @@ -273,6 +276,11 @@ public class GLProfile implements Cloneable { return GL2ES2.equals(profile) || isGL2() || isGL3() || isGLES2() ; } + /** Indicates whether this profile is capable os GL2GL3. */ + public final boolean isGL2GL3() { + return GL2GL3.equals(profile) || isGL2() || isGL3() ; + } + /** Indicates whether this profile uses the native OpenGL ES1 implementations. */ public final boolean usesNativeGLES1() { return GLES1.equals(profileImpl) || GL2ES1.equals(profileImpl) ; @@ -781,6 +789,8 @@ public class GLProfile implements Cloneable { return GL3; } else if(GL2.equals(profile) && hasGL2Impl) { return GL2; + } else if(GL2GL3.equals(profile) && hasGL2Impl) { + return GL2; } else if(GLES2.equals(profile) && hasGLES2Impl) { return GLES2; } else if(GLES1.equals(profile) && hasGLES1Impl) { diff --git a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java index dd2a487e7..7b942b358 100644 --- a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java +++ b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java @@ -1322,16 +1322,16 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable { " with width " + width[0] + ", height " + height[0]); } - gl.glBindRenderbuffer(GL2.GL_RENDERBUFFER, frameBufferDepthBuffer[0]); + gl.glBindRenderbuffer(GL.GL_RENDERBUFFER, frameBufferDepthBuffer[0]); // FIXME: may need a loop here like in Java2D - gl.glRenderbufferStorage(GL2.GL_RENDERBUFFER, GL2.GL_DEPTH_COMPONENT24, width[0], height[0]); + gl.glRenderbufferStorage(GL.GL_RENDERBUFFER, GL2GL3.GL_DEPTH_COMPONENT24, width[0], height[0]); gl.glBindRenderbuffer(GL2.GL_RENDERBUFFER, 0); createNewDepthBuffer = false; } gl.glBindTexture(fboTextureTarget, 0); - gl.glBindFramebuffer(GL2.GL_FRAMEBUFFER, frameBuffer[0]); + gl.glBindFramebuffer(GL.GL_FRAMEBUFFER, frameBuffer[0]); if (fbObjectWorkarounds) { // Hook up the color and depth buffer attachment points for this framebuffer @@ -1435,29 +1435,29 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable { j2dContext.makeCurrent(); GL gl = j2dContext.getGL(); - if ((getGLInteger(gl, GL2.GL_RED_BITS) < offscreenCaps.getRedBits()) || - (getGLInteger(gl, GL2.GL_GREEN_BITS) < offscreenCaps.getGreenBits()) || - (getGLInteger(gl, GL2.GL_BLUE_BITS) < offscreenCaps.getBlueBits()) || - // (getGLInteger(gl, GL2.GL_ALPHA_BITS) < offscreenCaps.getAlphaBits()) || + if ((getGLInteger(gl, GL.GL_RED_BITS) < offscreenCaps.getRedBits()) || + (getGLInteger(gl, GL.GL_GREEN_BITS) < offscreenCaps.getGreenBits()) || + (getGLInteger(gl, GL.GL_BLUE_BITS) < offscreenCaps.getBlueBits()) || + // (getGLInteger(gl, GL.GL_ALPHA_BITS) < offscreenCaps.getAlphaBits()) || (getGLInteger(gl, GL2.GL_ACCUM_RED_BITS) < offscreenCaps.getAccumRedBits()) || (getGLInteger(gl, GL2.GL_ACCUM_GREEN_BITS) < offscreenCaps.getAccumGreenBits()) || (getGLInteger(gl, GL2.GL_ACCUM_BLUE_BITS) < offscreenCaps.getAccumBlueBits()) || (getGLInteger(gl, GL2.GL_ACCUM_ALPHA_BITS) < offscreenCaps.getAccumAlphaBits()) || // (getGLInteger(gl, GL2.GL_DEPTH_BITS) < offscreenCaps.getDepthBits()) || - (getGLInteger(gl, GL2.GL_STENCIL_BITS) < offscreenCaps.getStencilBits())) { + (getGLInteger(gl, GL.GL_STENCIL_BITS) < offscreenCaps.getStencilBits())) { if (DEBUG) { System.err.println("GLJPanel: Falling back to pbuffer-based support because Java2D context insufficient"); System.err.println(" Available Required"); - System.err.println("GL_RED_BITS " + getGLInteger(gl, GL2.GL_RED_BITS) + " " + offscreenCaps.getRedBits()); - System.err.println("GL_GREEN_BITS " + getGLInteger(gl, GL2.GL_GREEN_BITS) + " " + offscreenCaps.getGreenBits()); - System.err.println("GL_BLUE_BITS " + getGLInteger(gl, GL2.GL_BLUE_BITS) + " " + offscreenCaps.getBlueBits()); - System.err.println("GL_ALPHA_BITS " + getGLInteger(gl, GL2.GL_ALPHA_BITS) + " " + offscreenCaps.getAlphaBits()); + System.err.println("GL_RED_BITS " + getGLInteger(gl, GL.GL_RED_BITS) + " " + offscreenCaps.getRedBits()); + System.err.println("GL_GREEN_BITS " + getGLInteger(gl, GL.GL_GREEN_BITS) + " " + offscreenCaps.getGreenBits()); + System.err.println("GL_BLUE_BITS " + getGLInteger(gl, GL.GL_BLUE_BITS) + " " + offscreenCaps.getBlueBits()); + System.err.println("GL_ALPHA_BITS " + getGLInteger(gl, GL.GL_ALPHA_BITS) + " " + offscreenCaps.getAlphaBits()); System.err.println("GL_ACCUM_RED_BITS " + getGLInteger(gl, GL2.GL_ACCUM_RED_BITS) + " " + offscreenCaps.getAccumRedBits()); System.err.println("GL_ACCUM_GREEN_BITS " + getGLInteger(gl, GL2.GL_ACCUM_GREEN_BITS) + " " + offscreenCaps.getAccumGreenBits()); System.err.println("GL_ACCUM_BLUE_BITS " + getGLInteger(gl, GL2.GL_ACCUM_BLUE_BITS) + " " + offscreenCaps.getAccumBlueBits()); System.err.println("GL_ACCUM_ALPHA_BITS " + getGLInteger(gl, GL2.GL_ACCUM_ALPHA_BITS) + " " + offscreenCaps.getAccumAlphaBits()); - System.err.println("GL_DEPTH_BITS " + getGLInteger(gl, GL2.GL_DEPTH_BITS) + " " + offscreenCaps.getDepthBits()); - System.err.println("GL_STENCIL_BITS " + getGLInteger(gl, GL2.GL_STENCIL_BITS) + " " + offscreenCaps.getStencilBits()); + System.err.println("GL_DEPTH_BITS " + getGLInteger(gl, GL.GL_DEPTH_BITS) + " " + offscreenCaps.getDepthBits()); + System.err.println("GL_STENCIL_BITS " + getGLInteger(gl, GL.GL_STENCIL_BITS) + " " + offscreenCaps.getStencilBits()); } isInitialized = false; backend = null; @@ -1587,7 +1587,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable { if (!checkedGLVendor) { checkedGLVendor = true; - String vendor = gl.glGetString(GL2.GL_VENDOR); + String vendor = gl.glGetString(GL.GL_VENDOR); if ((vendor != null) && vendor.startsWith("ATI")) { diff --git a/src/newt/classes/com/sun/javafx/newt/opengl/broadcom/BCEGLWindow.java b/src/newt/classes/com/sun/javafx/newt/opengl/broadcom/BCEGLWindow.java index c8436b928..10e70baa0 100755 --- a/src/newt/classes/com/sun/javafx/newt/opengl/broadcom/BCEGLWindow.java +++ b/src/newt/classes/com/sun/javafx/newt/opengl/broadcom/BCEGLWindow.java @@ -56,7 +56,7 @@ public class BCEGLWindow extends Window { if (config == null) { throw new NativeWindowException("Error choosing GraphicsConfiguration creating window: "+this); } - setSize(getScreen().getWidth(), getScreen().getHeight()); + setSizeImpl(getScreen().getWidth(), getScreen().getHeight()); } protected void closeNative() { @@ -79,6 +79,10 @@ public class BCEGLWindow extends Window { } public void setSize(int width, int height) { + System.err.println("setSize "+width+"x"+height+" n/a in BroadcomEGL"); + } + + void setSizeImpl(int width, int height) { if(0!=windowHandle) { // n/a in BroadcomEGL System.err.println("setSize n/a in BroadcomEGL with realized window"); -- cgit v1.2.3 From 9a4619d5ab1c0441dfb273d057e288b4bf4c6dbc Mon Sep 17 00:00:00 2001 From: sg215889 Date: Thu, 30 Jul 2009 22:09:24 -0700 Subject: Fix SwapInterval (return value, check ctx current, egl), add getSwapInterval. --- make/config/jogl/gl-impl-CustomJavaCode-gl2.java | 4 ++++ .../jogl/gl-impl-CustomJavaCode-gl2es12.java | 4 ++++ make/config/jogl/gl-impl-CustomJavaCode-gl3.java | 4 ++++ make/config/jogl/gl-impl-CustomJavaCode-gles1.java | 4 ++++ make/config/jogl/gl-impl-CustomJavaCode-gles2.java | 4 ++++ .../classes/com/sun/opengl/impl/GLContextImpl.java | 20 +++++++++++++---- .../com/sun/opengl/impl/egl/EGLContext.java | 6 ++++++ .../opengl/impl/macosx/cgl/MacOSXCGLContext.java | 3 ++- .../impl/macosx/cgl/MacOSXPbufferCGLContext.java | 13 ++++++++++- .../macosx/cgl/awt/MacOSXJava2DCGLContext.java | 4 ---- .../opengl/impl/windows/wgl/WindowsWGLContext.java | 25 ++++------------------ .../com/sun/opengl/impl/x11/glx/X11GLXContext.java | 8 +++---- src/jogl/classes/javax/media/opengl/GLBase.java | 17 ++++++++++++++- 13 files changed, 80 insertions(+), 36 deletions(-) (limited to 'src/jogl/classes/javax/media') diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gl2.java b/make/config/jogl/gl-impl-CustomJavaCode-gl2.java index 5aec51fc7..061830cb4 100644 --- a/make/config/jogl/gl-impl-CustomJavaCode-gl2.java +++ b/make/config/jogl/gl-impl-CustomJavaCode-gl2.java @@ -126,6 +126,10 @@ public void setSwapInterval(int interval) { _context.setSwapInterval(interval); } +public int getSwapInterval() { + return _context.getSwapInterval(); +} + public Object getPlatformGLExtensions() { return _context.getPlatformGLExtensions(); } diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gl2es12.java b/make/config/jogl/gl-impl-CustomJavaCode-gl2es12.java index cb4cab175..3dfcf5908 100644 --- a/make/config/jogl/gl-impl-CustomJavaCode-gl2es12.java +++ b/make/config/jogl/gl-impl-CustomJavaCode-gl2es12.java @@ -127,6 +127,10 @@ public void setSwapInterval(int interval) { _context.setSwapInterval(interval); } +public int getSwapInterval() { + return _context.getSwapInterval(); +} + public Object getPlatformGLExtensions() { return _context.getPlatformGLExtensions(); } diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gl3.java b/make/config/jogl/gl-impl-CustomJavaCode-gl3.java index a15964bcc..9123f35c8 100644 --- a/make/config/jogl/gl-impl-CustomJavaCode-gl3.java +++ b/make/config/jogl/gl-impl-CustomJavaCode-gl3.java @@ -126,6 +126,10 @@ public void setSwapInterval(int interval) { _context.setSwapInterval(interval); } +public int getSwapInterval() { + return _context.getSwapInterval(); +} + public Object getPlatformGLExtensions() { return _context.getPlatformGLExtensions(); } diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gles1.java b/make/config/jogl/gl-impl-CustomJavaCode-gles1.java index 5141376df..65236676a 100755 --- a/make/config/jogl/gl-impl-CustomJavaCode-gles1.java +++ b/make/config/jogl/gl-impl-CustomJavaCode-gles1.java @@ -101,6 +101,10 @@ public void setSwapInterval(int interval) { _context.setSwapInterval(interval); } +public int getSwapInterval() { + return _context.getSwapInterval(); +} + public Object getPlatformGLExtensions() { return _context.getPlatformGLExtensions(); } diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gles2.java b/make/config/jogl/gl-impl-CustomJavaCode-gles2.java index b53715ae0..2f69905a9 100755 --- a/make/config/jogl/gl-impl-CustomJavaCode-gles2.java +++ b/make/config/jogl/gl-impl-CustomJavaCode-gles2.java @@ -105,6 +105,10 @@ public void setSwapInterval(int interval) { _context.setSwapInterval(interval); } +public int getSwapInterval() { + return _context.getSwapInterval(); +} + public Object getPlatformGLExtensions() { return _context.getPlatformGLExtensions(); } diff --git a/src/jogl/classes/com/sun/opengl/impl/GLContextImpl.java b/src/jogl/classes/com/sun/opengl/impl/GLContextImpl.java index c60cccec6..fa7e1ade7 100644 --- a/src/jogl/classes/com/sun/opengl/impl/GLContextImpl.java +++ b/src/jogl/classes/com/sun/opengl/impl/GLContextImpl.java @@ -284,11 +284,23 @@ public abstract class GLContextImpl extends GLContext { public abstract ByteBuffer glAllocateMemoryNV(int arg0, float arg1, float arg2, float arg3); - /* - * Sets the swap interval for onscreen OpenGL contexts. Has no - * effect for offscreen contexts. - */ public void setSwapInterval(final int interval) { + GLContext current = getCurrent(); + if (current != this) { + throw new GLException("This context is not current. Current context: "+current+ + ", this context "+this); + } + setSwapIntervalImpl(interval); + } + + protected int currentSwapInterval = -1; // default: not set yet .. + + public int getSwapInterval() { + return currentSwapInterval; + } + + protected void setSwapIntervalImpl(final int interval) { + // nop per default .. } /** Maps the given "platform-independent" function name to a real function diff --git a/src/jogl/classes/com/sun/opengl/impl/egl/EGLContext.java b/src/jogl/classes/com/sun/opengl/impl/egl/EGLContext.java index 45fe0fcd3..1a75f03a9 100755 --- a/src/jogl/classes/com/sun/opengl/impl/egl/EGLContext.java +++ b/src/jogl/classes/com/sun/opengl/impl/egl/EGLContext.java @@ -261,6 +261,12 @@ public abstract class EGLContext extends GLContextImpl { } } + protected void setSwapIntervalImpl(int interval) { + if (EGL.eglSwapInterval(drawable.getDisplay(), interval)) { + currentSwapInterval = interval ; + } + } + public abstract void bindPbufferToTexture(); public abstract void releasePbufferFromTexture(); diff --git a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLContext.java b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLContext.java index b424e9516..f60dd1645 100644 --- a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLContext.java +++ b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLContext.java @@ -337,11 +337,12 @@ public abstract class MacOSXCGLContext extends GLContextImpl return ""; } - public void setSwapInterval(int interval) { + protected void setSwapIntervalImpl(int interval) { if (nsContext == 0) { throw new GLException("OpenGL context not current"); } CGL.setSwapInterval(nsContext, interval); + currentSwapInterval = interval ; } public ByteBuffer glAllocateMemoryNV(int arg0, float arg1, float arg2, float arg3) { diff --git a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLContext.java b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLContext.java index d702150d3..4ea3519bf 100644 --- a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLContext.java +++ b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLContext.java @@ -121,11 +121,12 @@ public class MacOSXPbufferCGLContext extends MacOSXCGLContext { } } - public void setSwapInterval(int interval) { + protected void setSwapIntervalImpl(int interval) { if (nsContext == 0) { throw new GLException("OpenGL context not current"); } impl.setSwapInterval(nsContext, interval); + currentSwapInterval = impl.getSwapInterval() ; } public int getFloatingPointMode() { @@ -210,6 +211,7 @@ public class MacOSXPbufferCGLContext extends MacOSXCGLContext { public boolean makeCurrent(long ctx); public boolean release(long ctx); public void setSwapInterval(long ctx, int interval); + public int getSwapInterval(); } // NSOpenGLContext-based implementation @@ -241,8 +243,14 @@ public class MacOSXPbufferCGLContext extends MacOSXCGLContext { return CGL.clearCurrentContext(ctx); } + private int currentSwapInterval = 0 ; + public void setSwapInterval(long ctx, int interval) { CGL.setSwapInterval(ctx, interval); + currentSwapInterval = interval ; + } + public int getSwapInterval() { + return currentSwapInterval; } } @@ -344,5 +352,8 @@ public class MacOSXPbufferCGLContext extends MacOSXCGLContext { public void setSwapInterval(long ctx, int interval) { // For now not supported (not really relevant for off-screen contexts anyway) } + public int getSwapInterval() { + return 0; + } } } diff --git a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/awt/MacOSXJava2DCGLContext.java b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/awt/MacOSXJava2DCGLContext.java index 4423f8da5..22b0ffe55 100644 --- a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/awt/MacOSXJava2DCGLContext.java +++ b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/awt/MacOSXJava2DCGLContext.java @@ -144,10 +144,6 @@ public class MacOSXJava2DCGLContext extends MacOSXCGLContext implements Java2DGL } } - public void setSwapInterval(int interval) { - // Not supported in this context implementation - } - public void setOpenGLMode(int mode) { if (mode != MacOSXCGLDrawable.CGL_MODE) throw new GLException("OpenGL mode switching not supported for Java2D GLContexts"); diff --git a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLContext.java b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLContext.java index 1bc3acada..92a563445 100644 --- a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLContext.java +++ b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLContext.java @@ -332,29 +332,12 @@ public class WindowsWGLContext extends GLContextImpl { } } - public boolean isFunctionAvailable(String glFunctionName) - { - boolean available = super.isFunctionAvailable(glFunctionName); - - // Sanity check for implementations that use proc addresses for run-time - // linking: if the function IS available, then make sure there's a proc - // address for it if it's an extension or not part of the OpenGL 1.1 core - // (post GL 1.1 functions are run-time linked on windows). - /* FIXME: - assert(!available || - (getGLProcAddressTable().getAddressFor(mapToRealGLFunctionName(glFunctionName)) != 0 || - FunctionAvailabilityCache.isPartOfGLCore("1.1", mapToRealGLFunctionName(glFunctionName))) - ); */ - - return available; - } - - public void setSwapInterval(int interval) { - // FIXME: make the context current first? Currently assumes that - // will not be necessary. Make the caller do this? + protected void setSwapIntervalImpl(int interval) { WGLExt wglExt = getWGLExt(); if (wglExt.isExtensionAvailable("WGL_EXT_swap_control")) { - wglExt.wglSwapIntervalEXT(interval); + if ( wglExt.wglSwapIntervalEXT(interval) ) { + currentSwapInterval = interval ; + } } } diff --git a/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11GLXContext.java b/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11GLXContext.java index 57abcf588..718d55aa0 100644 --- a/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11GLXContext.java +++ b/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11GLXContext.java @@ -396,11 +396,9 @@ public abstract class X11GLXContext extends GLContextImpl { private int hasSwapIntervalSGI = 0; - public void setSwapInterval(int interval) { + protected void setSwapIntervalImpl(int interval) { getDrawableImpl().getFactoryImpl().lockToolkit(); try { - // FIXME: make the context current first? Currently assumes that - // will not be necessary. Make the caller do this? GLXExt glXExt = getGLXExt(); if(0==hasSwapIntervalSGI) { try { @@ -409,7 +407,9 @@ public abstract class X11GLXContext extends GLContextImpl { } if (hasSwapIntervalSGI>0) { try { - glXExt.glXSwapIntervalSGI(interval); + if( 0 == glXExt.glXSwapIntervalSGI(interval) ) { + currentSwapInterval = interval; + } } catch (Throwable t) { hasSwapIntervalSGI=-1; } } } finally { diff --git a/src/jogl/classes/javax/media/opengl/GLBase.java b/src/jogl/classes/javax/media/opengl/GLBase.java index 7b59344cc..92498077b 100644 --- a/src/jogl/classes/javax/media/opengl/GLBase.java +++ b/src/jogl/classes/javax/media/opengl/GLBase.java @@ -227,9 +227,24 @@ public interface GLBase { until swapping buffers. The default, which is platform-specific, is usually either 0 or 1. This function is not guaranteed to have an effect, and in particular only affects heavyweight - onscreen components. */ + onscreen components. + + @see #getSwapInterval + @throws GLException if this context is not the current + */ public void setSwapInterval(int interval); + /** Provides a platform-independent way to get the swap + interval set by {@link #setSwapInterval}.
    + + If the interval is not set by {@link #setSwapInterval} yet, + -1 is returned, indicating that the platforms default + is being used. + + @see #setSwapInterval + */ + public int getSwapInterval(); + /** * Returns an object through which platform-specific OpenGL extensions * (EGL, GLX, WGL, etc.) may be accessed. The data type of the returned -- cgit v1.2.3 From a9439fa3ecd366c419815959daedc030f4b8b4e1 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 31 Jul 2009 20:47:32 -0700 Subject: Fix: GL2ES1 mapping to GL2ES12 if available --- src/jogl/classes/javax/media/opengl/GLProfile.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/jogl/classes/javax/media') diff --git a/src/jogl/classes/javax/media/opengl/GLProfile.java b/src/jogl/classes/javax/media/opengl/GLProfile.java index 8b23bed04..756c80009 100644 --- a/src/jogl/classes/javax/media/opengl/GLProfile.java +++ b/src/jogl/classes/javax/media/opengl/GLProfile.java @@ -768,10 +768,10 @@ public class GLProfile implements Cloneable { */ private static String computeProfileImpl(String profile) { if (GL2ES1.equals(profile)) { - if(hasGL2Impl) { - return GL2; - } else if(hasGL2ES12Impl) { + if(hasGL2ES12Impl) { return GL2ES12; + } else if(hasGL2Impl) { + return GL2; } else if(hasGLES1Impl) { return GLES1; } -- cgit v1.2.3 From 4e0a5af0b359b98b26ea3e961d023c658650be6c Mon Sep 17 00:00:00 2001 From: Sven Gothel 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. --- make/config/jogl/gl-common.cfg | 9 + make/config/jogl/gl-gl2es12.cfg | 2 +- .../opengl/impl/ExtensionAvailabilityCache.java | 178 +++++++++++++++---- .../classes/com/sun/opengl/impl/GLContextImpl.java | 26 ++- .../classes/com/sun/opengl/impl/GLPbufferImpl.java | 4 +- .../opengl/util/glsl/fixedfunc/FixedFuncUtil.java | 15 +- .../classes/javax/media/opengl/GLAutoDrawable.java | 5 +- src/jogl/classes/javax/media/opengl/GLContext.java | 4 +- .../javax/media/opengl/GLPipelineFactory.java | 195 +++++++++++++++++++++ .../classes/javax/media/opengl/awt/GLCanvas.java | 4 +- .../classes/javax/media/opengl/awt/GLJPanel.java | 4 +- .../com/sun/javafx/newt/opengl/GLWindow.java | 4 +- 12 files changed, 405 insertions(+), 45 deletions(-) create mode 100644 src/jogl/classes/javax/media/opengl/GLPipelineFactory.java (limited to 'src/jogl/classes/javax/media') diff --git a/make/config/jogl/gl-common.cfg b/make/config/jogl/gl-common.cfg index a26c6a6b3..269ea68a7 100644 --- a/make/config/jogl/gl-common.cfg +++ b/make/config/jogl/gl-common.cfg @@ -230,6 +230,7 @@ IgnoreExtension GL_EXT_texture_rectangle Opaque boolean GLboolean ReturnsString glGetString +ReturnsString glGetStringi # Experimental: Only NIO function, no arrays .. # NIOOnly __ALL__ @@ -323,6 +324,14 @@ ArgumentIsString glTransformFeedbackVaryings 2 # ArgumentIsString glGetShaderSource 3 # ArgumentIsString glGetTransformFeedbackVarying 6 +# +# Use cached GL_EXTENSION if possible, +# which also allows GL3 compatibility. +# +JavaPrologue glGetString if(GL.GL_EXTENSIONS==name && _context.isExtensionCacheInitialized()) { +JavaPrologue glGetString return _context.getGLExtensions(); +JavaPrologue glGetString } + # # Directives for Vertex Buffer Object and Pixel Buffer Object checking # diff --git a/make/config/jogl/gl-gl2es12.cfg b/make/config/jogl/gl-gl2es12.cfg index 27fa138d4..36bab82ed 100644 --- a/make/config/jogl/gl-gl2es12.cfg +++ b/make/config/jogl/gl-gl2es12.cfg @@ -13,10 +13,10 @@ ExtendedInterfaceSymbolsOnly ../src/jogl/classes/javax/media/opengl/fixedfunc/GL Style ImplOnly ImplPackage com.sun.opengl.impl.gl2es12 ImplJavaClass GL2ES12Impl +Implements GL2ES12Impl GLBase Implements GL2ES12Impl GL Implements GL2ES12Impl GL2ES1 Implements GL2ES12Impl GL2ES2 -Implements GL2ES12Impl GLBase Include gl-common-gl2.cfg Include gl-common-extensions.cfg diff --git a/src/jogl/classes/com/sun/opengl/impl/ExtensionAvailabilityCache.java b/src/jogl/classes/com/sun/opengl/impl/ExtensionAvailabilityCache.java index eee308088..7931f791b 100644 --- a/src/jogl/classes/com/sun/opengl/impl/ExtensionAvailabilityCache.java +++ b/src/jogl/classes/com/sun/opengl/impl/ExtensionAvailabilityCache.java @@ -65,7 +65,25 @@ public final class ExtensionAvailabilityCache { */ public void flush() { + if(DEBUG) { + System.out.println("ExtensionAvailabilityCache: Flush availability OpenGL "+majorVersion+"."+minorVersion); + } availableExtensionCache.clear(); + initialized = false; + majorVersion = 1; + minorVersion = 0; + } + + /** + * Flush the cache and rebuild the cache. + */ + public void reset() { + flush(); + initAvailableExtensions(); + } + + public boolean isInitialized() { + return initialized && !availableExtensionCache.isEmpty() ; } public boolean isExtensionAvailable(String glExtensionName) { @@ -73,19 +91,101 @@ public final class ExtensionAvailabilityCache { return availableExtensionCache.contains(mapGLExtensionName(glExtensionName)); } - protected void initAvailableExtensions() { + public String getPlatformExtensionsString() { + initAvailableExtensions(); + return glXExtensions; + } + + public String getGLExtensions() { + initAvailableExtensions(); + if(DEBUG) { + System.err.println("ExtensionAvailabilityCache: getGLExtensions() called"); + } + return glExtensions; + } + + public int getMajorVersion() { + initAvailableExtensions(); + return majorVersion; + } + + public int getMinorVersion() { + initAvailableExtensions(); + return minorVersion; + } + + private void initAvailableExtensions() { // if hash is empty (meaning it was flushed), pre-cache it with the list // of extensions that are in the GL_EXTENSIONS string - if (availableExtensionCache.isEmpty()) { + if (availableExtensionCache.isEmpty() || !initialized) { GL gl = context.getGL(); + if (DEBUG) { - System.err.println("!!! Pre-caching extension availability"); + System.err.println("ExtensionAvailabilityCache: Pre-caching init "+gl+", GL_VERSION "+gl.glGetString(GL.GL_VERSION)); + } + + // Set version + Version version = new Version(gl.glGetString(GL.GL_VERSION)); + if (version.isValid()) { + majorVersion = version.getMajor(); + minorVersion = version.getMinor(); + + if( !gl.isGL3() && + ( majorVersion > 3 || + ( majorVersion == 3 && minorVersion >= 1 ) ) ) { + // downsize version to 3.0 in case we are not using GL3 (3.1) + majorVersion = 3; + minorVersion = 0; + } } - String allAvailableExtensions = - gl.glGetString(GL.GL_EXTENSIONS) + " " + context.getPlatformExtensionsString(); + + boolean useGetStringi = false; + + if ( majorVersion > 3 || + ( majorVersion == 3 && minorVersion >= 0 ) || + gl.isGL3() ) { + if ( ! gl.isGL2GL3() ) { + if(DEBUG) { + System.err.println("ExtensionAvailabilityCache: GL >= 3.1 usage, but no GL2GL3 interface: "+gl.getClass().getName()); + } + } else if ( ! gl.isFunctionAvailable("glGetStringi") ) { + if(DEBUG) { + System.err.println("ExtensionAvailabilityCache: GL >= 3.1 usage, but no glGetStringi"); + } + } else { + useGetStringi = true; + } + } + if (DEBUG) { - System.err.println("!!! Available extensions: " + allAvailableExtensions); - System.err.println("!!! GL vendor: " + gl.glGetString(GL.GL_VENDOR)); + System.err.println("ExtensionAvailabilityCache: Pre-caching extension availability OpenGL "+majorVersion+"."+minorVersion+ + ", use "+ ( useGetStringi ? "glGetStringi" : "glGetString" ) ); + } + + StringBuffer sb = new StringBuffer(); + if(useGetStringi) { + GL2GL3 gl2gl3 = gl.getGL2GL3(); + int[] numExtensions = { 0 } ; + gl2gl3.glGetIntegerv(gl2gl3.GL_NUM_EXTENSIONS, numExtensions, 0); + for (int i = 0; i < numExtensions[0]; i++) { + sb.append(gl2gl3.glGetStringi(gl2gl3.GL_EXTENSIONS, i)); + if(i < numExtensions[0]) { + sb.append(" "); + } + } + } else { + sb.append(gl.glGetString(GL.GL_EXTENSIONS)); + } + glExtensions = sb.toString(); + glXExtensions = context.getPlatformExtensionsString(); + + sb.append(" "); + sb.append(glXExtensions); + + String allAvailableExtensions = sb.toString(); + if (DEBUG_AVAILABILITY) { + System.err.println("ExtensionAvailabilityCache: Available extensions: " + allAvailableExtensions); + System.err.println("ExtensionAvailabilityCache: GL vendor: " + gl.glGetString(GL.GL_VENDOR)); } StringTokenizer tok = new StringTokenizer(allAvailableExtensions); while (tok.hasMoreTokens()) { @@ -93,42 +193,53 @@ public final class ExtensionAvailabilityCache { availableExt = availableExt.intern(); availableExtensionCache.add(availableExt); if (DEBUG_AVAILABILITY) { - System.err.println("!!! Available: " + availableExt); + System.err.println("ExtensionAvailabilityCache: Available: " + availableExt); } } // Put GL version strings in the table as well - Version version = new Version(gl.glGetString(GL.GL_VERSION)); - if (version.isValid()) { - int major = version.getMajor(); - int minor = version.getMinor(); - // FIXME: this needs to be adjusted when the major rev changes - // beyond the known ones - while (major > 0) { - while (minor >= 0) { - availableExtensionCache.add("GL_VERSION_" + major + "_" + minor); - if (DEBUG) { - System.err.println("!!! Added GL_VERSION_" + major + "_" + minor + " to known extensions"); - } - --minor; + // FIXME: this needs to be adjusted when the major rev changes + // beyond the known ones + int major = majorVersion; + int minor = minorVersion; + while (major > 0) { + while (minor >= 0) { + availableExtensionCache.add("GL_VERSION_" + major + "_" + minor); + if (DEBUG) { + System.err.println("ExtensionAvailabilityCache: Added GL_VERSION_" + major + "_" + minor + " to known extensions"); } + --minor; + } - switch (major) { - case 2: - // Restart loop at version 1.5 - minor = 5; - break; - case 1: - break; + switch (major) { + case 2: + if(gl.isGL3() && major==2) { + // GL3 is a GL 3.1 forward compatible context, + // hence no 2.0, 1.0 - 1.5 GL versions are supported. + major=0; + } else { + // make sure 2.0 is added .. + minor = 0; + availableExtensionCache.add("GL_VERSION_" + major + "_" + minor); + if (DEBUG) { + System.err.println("ExtensionAvailabilityCache: Added GL_VERSION_" + major + "_" + minor + " to known extensions"); + } } - - --major; + // Restart loop at version 1.5 + minor = 5; + break; + case 1: + break; } + + --major; } // put a dummy var in here so that the cache is no longer empty even if // no extensions are in the GL_EXTENSIONS string availableExtensionCache.add(""); + + initialized = true; } } @@ -146,6 +257,11 @@ public final class ExtensionAvailabilityCache { // Internals only below this point // + private boolean initialized = false; + private int majorVersion = 1; + private int minorVersion = 0; + private String glExtensions = null; + private String glXExtensions = null; private HashSet availableExtensionCache = new HashSet(50); private GLContextImpl context; @@ -236,7 +352,7 @@ public final class ExtensionAvailabilityCache { { // FIXME: refactor desktop OpenGL dependencies and make this // class work properly for OpenGL ES - System.err.println("FunctionAvailabilityCache.Version.: "+e); + System.err.println("ExtensionAvailabilityCache: FunctionAvailabilityCache.Version.: "+e); major = 1; minor = 0; /* diff --git a/src/jogl/classes/com/sun/opengl/impl/GLContextImpl.java b/src/jogl/classes/com/sun/opengl/impl/GLContextImpl.java index fa7e1ade7..16eb934bd 100644 --- a/src/jogl/classes/com/sun/opengl/impl/GLContextImpl.java +++ b/src/jogl/classes/com/sun/opengl/impl/GLContextImpl.java @@ -228,7 +228,7 @@ public abstract class GLContextImpl extends GLContext { return gl; } - public void setGL(GL gl) { + public GL setGL(GL gl) { if(DEBUG) { String sgl1 = (null!=this.gl)?this.gl.getClass().toString()+", "+this.gl.toString():new String(""); String sgl2 = (null!=gl)?gl.getClass().toString()+", "+gl.toString():new String(""); @@ -236,6 +236,7 @@ public abstract class GLContextImpl extends GLContext { e.printStackTrace(); } this.gl = gl; + return gl; } public abstract Object getPlatformGLExtensions(); @@ -354,7 +355,6 @@ public abstract class GLContextImpl extends GLContext { if(null==this.gl) { throw new GLException("setGLFunctionAvailability not called yet"); } - extensionAvailability.flush(); if (DEBUG) { System.err.println(getThreadName() + ": !!! Initializing OpenGL extension address table for " + this); } @@ -364,6 +364,8 @@ public abstract class GLContextImpl extends GLContext { // share them among contexts with the same capabilities } resetProcAddressTable(getGLProcAddressTable()); + + extensionAvailability.reset(); } /** @@ -426,6 +428,26 @@ public abstract class GLContextImpl extends GLContext { return extensionAvailability.isExtensionAvailable(mapToRealGLExtensionName(glExtensionName)); } + public String getPlatformExtensionsString() { + return extensionAvailability.getPlatformExtensionsString(); + } + + public String getGLExtensions() { + return extensionAvailability.getGLExtensions(); + } + + public int getMajorVersion() { + return extensionAvailability.getMajorVersion(); + } + + public int getMinorVersion() { + return extensionAvailability.getMinorVersion(); + } + + public boolean isExtensionCacheInitialized() { + return extensionAvailability.isInitialized(); + } + /** Indicates which floating-point pbuffer implementation is in use. Returns one of GLPbuffer.APPLE_FLOAT, GLPbuffer.ATI_FLOAT, or GLPbuffer.NV_FLOAT. */ diff --git a/src/jogl/classes/com/sun/opengl/impl/GLPbufferImpl.java b/src/jogl/classes/com/sun/opengl/impl/GLPbufferImpl.java index e414fbc8e..8aba26fc6 100644 --- a/src/jogl/classes/com/sun/opengl/impl/GLPbufferImpl.java +++ b/src/jogl/classes/com/sun/opengl/impl/GLPbufferImpl.java @@ -129,8 +129,8 @@ public class GLPbufferImpl implements GLPbuffer { return getContext().getGL(); } - public void setGL(GL gl) { - getContext().setGL(gl); + public GL setGL(GL gl) { + return getContext().setGL(gl); } public void setAutoSwapBufferMode(boolean onOrOff) { 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. diff --git a/src/jogl/classes/javax/media/opengl/GLAutoDrawable.java b/src/jogl/classes/javax/media/opengl/GLAutoDrawable.java index 43347c416..a94c14f33 100644 --- a/src/jogl/classes/javax/media/opengl/GLAutoDrawable.java +++ b/src/jogl/classes/javax/media/opengl/GLAutoDrawable.java @@ -208,6 +208,7 @@ public interface GLAutoDrawable extends GLDrawable { This should only be called from within the GLEventListener's callback methods, and usually only from within the init() method, in order to install a composable pipeline. See the JOGL - demos for examples. */ - public void setGL(GL gl); + demos for examples. + @return the set GL pipeline or null if not successful */ + public GL setGL(GL gl); } diff --git a/src/jogl/classes/javax/media/opengl/GLContext.java b/src/jogl/classes/javax/media/opengl/GLContext.java index a2bff729a..8ff52b6e9 100644 --- a/src/jogl/classes/javax/media/opengl/GLContext.java +++ b/src/jogl/classes/javax/media/opengl/GLContext.java @@ -205,8 +205,10 @@ public abstract class GLContext { /** * Sets the GL pipeline object for this GLContext. + * + * @return the set GL pipeline or null if not successful */ - public abstract void setGL(GL gl); + public abstract GL setGL(GL gl); /** * Returns the attached user object for the given name to this GLContext. diff --git a/src/jogl/classes/javax/media/opengl/GLPipelineFactory.java b/src/jogl/classes/javax/media/opengl/GLPipelineFactory.java new file mode 100644 index 000000000..bb9f86911 --- /dev/null +++ b/src/jogl/classes/javax/media/opengl/GLPipelineFactory.java @@ -0,0 +1,195 @@ +/* + * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * - Redistribution of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistribution in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * Neither the name of Sun Microsystems, Inc. or the names of + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * This software is provided "AS IS," without a warranty of any kind. ALL + * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, + * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN + * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR + * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR + * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR + * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR + * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE + * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, + * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF + * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + * + * You acknowledge that this software is not designed or intended for use + * in the design, construction, operation or maintenance of any nuclear + * facility. + */ + +package javax.media.opengl; + +import java.lang.reflect.*; +import java.util.StringTokenizer; + +import com.sun.opengl.impl.*; + +/** + * Factory for pipelining GL instances + */ +public class GLPipelineFactory { + public static final boolean DEBUG = Debug.debug("GLPipelineFactory"); + + /** + * Creates a pipelined GL instance using the given downstream downstream + * and optional arguments additionalArgs for the constructor.
    + * + * The upstream GL instance is determined as follows: + *

      + *
    • Use pipelineClazzBaseName as the class name's full basename, incl. package name
    • + *
    • For all downstream classes, do:
    • + *
        + *
      • For all downstream class interfaces, do:
      • + *
          + *
        • If reqInterface is not null and the interface is unequal, continue.
        • + *
        • If downstream is not instance of interface, continue.
        • + *
        • If downstream is not instance of interface, continue.
        • + *
        • If upstream class is available use it, end loop.
        • + *
        + *
      + *

    + * + * @arg pipelineClazzBaseName the basename of the pipline class name + * @arg reqInterface optional requested interface to be used, may be null, in which case the first matching one is used + * @arg downstream is always the 1st argument for the upstream constructor + * @arg additionalArgs additional arguments for the upstream constructor + */ + public static final GL create(String pipelineClazzBaseName, Class reqInterface, GL downstream, Object[] additionalArgs) { + Class downstreamClazz = downstream.getClass(); + Class upstreamClazz = null; + Class interfaceClazz = null; + + if(DEBUG) { + System.out.println("GLPipelineFactory: Start "+downstreamClazz.getName()+", req. Interface: "+reqInterface+" -> "+pipelineClazzBaseName); + } + + // For all classes: child -> parent + do { + // For all interfaces: right -> left == child -> parent + // It is important that this matches with the gluegen cfg file's 'Implements' clause ! + Class[] clazzes = downstreamClazz.getInterfaces(); + for(int i=clazzes.length-1; null==upstreamClazz && i>=0; i--) { + if(DEBUG) { + System.out.println("GLPipelineFactory: Try "+downstreamClazz.getName()+" Interface["+i+"]: "+clazzes[i].getName()); + } + if( reqInterface != null && !reqInterface.getName().equals(clazzes[i].getName()) ) { + if(DEBUG) { + System.out.println("GLPipelineFactory: requested Interface "+reqInterface+" is _not_ "+ clazzes[i].getName()); + } + continue; // not the requested one .. + } + if( ! clazzes[i].isInstance(downstream) ) { + if(DEBUG) { + System.out.println("GLPipelineFactory: "+downstream.getClass().getName() + " is _not_ instance of "+ clazzes[i].getName()); + } + continue; // not a compatible one + } else { + if(DEBUG) { + System.out.println("GLPipelineFactory: "+downstream.getClass().getName() + " _is_ instance of "+ clazzes[i].getName()); + } + } + upstreamClazz = getUpstreamClazz(clazzes[i], pipelineClazzBaseName); + if( null != upstreamClazz ) { + interfaceClazz = clazzes[i]; + } + } + + if(null==upstreamClazz) { + downstreamClazz = downstreamClazz.getSuperclass(); + } + } while (null!=downstreamClazz && null==upstreamClazz); + + + if(null==upstreamClazz) { + throw new GLException("No pipeline ("+pipelineClazzBaseName+"*) available for :"+downstream.getClass().getName()); + } + + if(DEBUG) { + System.out.println("GLPipelineFactory: Got : "+ upstreamClazz.getName()+", base interface: "+interfaceClazz.getName()); + } + + Class[] cstrArgTypes = new Class[ 1 + ( ( null==additionalArgs ) ? 0 : additionalArgs.length ) ] ; + { + int i = 0; + cstrArgTypes[i++] = interfaceClazz; + for(int j=0; null!=additionalArgs && j Date: Sun, 2 Aug 2009 03:49:31 -0700 Subject: Update OpenGL GL2 profile subsumed/promoted extensions. Base is 3.0, ignore the colission-free subsumed extensions. --- make/config/jogl/gl-common.cfg | 63 +++++++++++++++++++++- make/config/jogl/gl-gl2.cfg | 2 + make/config/jogl/gl-if-CustomJavaCode-gl2.java | 40 ++++++++++++++ make/config/jogl/gl-impl-CustomJavaCode-gl2.java | 1 + make/doc/jogl/spec-overview.html | 26 ++++++--- .../javax/media/opengl/GLPipelineFactory.java | 9 ++-- 6 files changed, 128 insertions(+), 13 deletions(-) create mode 100644 make/config/jogl/gl-if-CustomJavaCode-gl2.java (limited to 'src/jogl/classes/javax/media') diff --git a/make/config/jogl/gl-common.cfg b/make/config/jogl/gl-common.cfg index 269ea68a7..3e38aa0da 100644 --- a/make/config/jogl/gl-common.cfg +++ b/make/config/jogl/gl-common.cfg @@ -133,6 +133,7 @@ IgnoreExtension GL_EXT_coordinate_frame # Ignore discontinued extensions IgnoreExtension GL_NV_element_array +# >>> OpenGL 1.1 # Ignore extensions subsumed in OpenGL 1.1 (from OpenGL 1.1 spec, Appendix C) IgnoreExtension GL_EXT_vertex_array IgnoreExtension GL_EXT_blend_logic_op @@ -141,7 +142,9 @@ IgnoreExtension GL_EXT_polygon_offset IgnoreExtension GL_EXT_subtexture IgnoreExtension GL_EXT_texture IgnoreExtension GL_EXT_texture_object +# <<< OpenGL 1.1 +# >>> OpenGL 1.2 # Ignore extensions subsumed in OpenGL 1.2 and 1.2.1 (from OpenGL 1.2.1 spec, Appendix D) IgnoreExtension GL_EXT_bgra IgnoreExtension GL_EXT_blend_color @@ -163,7 +166,9 @@ IgnoreExtension GL_SGI_color_matrix IgnoreExtension GL_SGI_color_table IgnoreExtension GL_SGIS_texture_edge_clamp IgnoreExtension GL_SGIS_texture_lod +# <<< OpenGL 1.2 +# >>> OpenGL 1.3 # Ignore extensions subsumed in OpenGL 1.3 (from OpenGL 1.3 spec, Appendix F) IgnoreExtension GL_ARB_multisample IgnoreExtension GL_ARB_multitexture @@ -179,7 +184,9 @@ IgnoreExtension GL_EXT_texture_env_add IgnoreExtension GL_EXT_texture_env_combine IgnoreExtension GL_EXT_texture_env_dot3 IgnoreExtension GL_SGIS_texture_border_clamp +# <<< OpenGL 1.3 +# >>> OpenGL 1.4 # Ignore extensions subsumed in OpenGL 1.4 (from OpenGL 1.4 spec, Appendix G) IgnoreExtension GL_ARB_depth_texture IgnoreExtension GL_ARB_point_parameters @@ -195,29 +202,81 @@ IgnoreExtension GL_EXT_secondary_color IgnoreExtension GL_EXT_stencil_wrap IgnoreExtension GL_NV_blend_square IgnoreExtension GL_SGIS_generate_mipmap +# <<< OpenGL 1.4 +# >>> OpenGL 1.5 # Ignore extensions subsumed in OpenGL 1.5 (from OpenGL 1.5 spec, Appendix H) IgnoreExtension GL_ARB_occlusion_query IgnoreExtension GL_ARB_vertex_buffer_object IgnoreExtension GL_EXT_shadow_funcs +# <<< OpenGL 1.5 +# >>> OpenGL 2.0 # Ignore extensions subsumed in OpenGL 2.0 (from OpenGL 2.0 spec, Appendix I) # NOTE that GL_ARB_shader_objects is NOT ignored here, because the # naming convention is too different for us to pick up the entry # points automatically (e.g. glCreateShaderObjectARB was exposed as # glCreateShader) +# IgnoreExtension GL_ARB_shader_objects IgnoreExtension GL_ARB_vertex_shader IgnoreExtension GL_ARB_fragment_shader -IgnoreExtension GL_ARB_draw_buffers IgnoreExtension GL_ARB_texture_non_power_of_two IgnoreExtension GL_ARB_point_sprite +IgnoreExtension GL_ARB_draw_buffers IgnoreExtension GL_EXT_blend_equation_separate # Don't ignore the following one since the entry point is different from anything in the core # IgnoreExtension GL_EXT_stencil_two_side +# <<< OpenGL 2.0 +# >>> OpenGL 2.1 # Ignore extensions subsumed in OpenGL 2.1 (from OpenGL 2.1 spec, Appendix J) IgnoreExtension GL_ARB_pixel_buffer_object IgnoreExtension GL_EXT_texture_sRGB +# <<< OpenGL 2.1 + +# >>> OpenGL 3.0 +# Ignore extensions subsumed in OpenGL 3.0 (from OpenGL 3.0 spec, Appendix N) +IgnoreExtension GL_EXT_gpu_shader4 + +IgnoreExtension GL_NV_conditional_render + +#Not promoted in header files: GL_APPLE_flush_buffer_range + +IgnoreExtension GL_ARB_color_buffer_float +#Not promoted in header files: GL_NV_depth_buffer_float +IgnoreExtension GL_ARB_texture_float +IgnoreExtension GL_EXT_packed_float +IgnoreExtension GL_EXT_texture_shared_exponent + +IgnoreExtension GL_EXT_framebuffer_object + +# GL_NV_half_float, GL_NV_half_float_pixel: these are also not usable for Java .. +IgnoreExtension GL_NV_half_float +IgnoreExtension GL_NV_half_float_pixel + +IgnoreExtension GL_EXT_framebuffer_multisample +IgnoreExtension GL_EXT_framebuffer_blit + +#Big gap of promoted tokens and functions: GL_EXT_texture_integer + +IgnoreExtension GL_EXT_texture_array + +IgnoreExtension GL_EXT_packed_depth_stencil + +#Not promoted in header files: GL_EXT_draw_buffers2 + +IgnoreExtension GL_EXT_texture_compression_rgtc + +IgnoreExtension GL_EXT_transform_feedback +IgnoreExtension GL_NV_transform_feedback + +IgnoreExtension GL_APPLE_vertex_array_object + +IgnoreExtension GL_EXT_framebuffer_sRGB + +# <<< OpenGL 3.0 + + # Ignore a few obsolete versions of extensions that have been subsumed into the core or ARB extensions IgnoreExtension GL_EXT_multisample @@ -536,7 +595,7 @@ ClassJavadoc GL2 *

    ClassJavadoc GL2 * This interface contains all core desktop OpenGL methods through ClassJavadoc GL2 * version 3.0, inclusive, as well as most of it's extensions defined at the ClassJavadoc GL2 * time of this specification. Early OpenGL extensions whose functionality -ClassJavadoc GL2 * was incorporated into core OpenGL by version 2.0, inclusive, are specifically +ClassJavadoc GL2 * was incorporated into core OpenGL by version 3.0, inclusive, are specifically ClassJavadoc GL2 * excluded. ClassJavadoc GL2 *

    ClassJavadoc GL2 */ diff --git a/make/config/jogl/gl-gl2.cfg b/make/config/jogl/gl-gl2.cfg index 55f5b9781..7b689093a 100644 --- a/make/config/jogl/gl-gl2.cfg +++ b/make/config/jogl/gl-gl2.cfg @@ -43,6 +43,8 @@ IgnoreExtension GL_EXT_point_parameters CustomJavaCode GL2 public boolean glIsPBOPackEnabled(); CustomJavaCode GL2 public boolean glIsPBOUnpackEnabled(); +IncludeAs CustomJavaCode GL2 gl-if-CustomJavaCode-gl2.java + CustomJavaCode GL2Impl public void glFrustumf(float left, float right, float bottom, float top, float zNear, float zFar) { CustomJavaCode GL2Impl glFrustum((double)left, (double)right, (double)bottom, (double)top, (double)zNear, (double)zFar); } diff --git a/make/config/jogl/gl-if-CustomJavaCode-gl2.java b/make/config/jogl/gl-if-CustomJavaCode-gl2.java new file mode 100644 index 000000000..fe6388cbe --- /dev/null +++ b/make/config/jogl/gl-if-CustomJavaCode-gl2.java @@ -0,0 +1,40 @@ + +/** Missed in the GL_EXT_gpu_shader4 promotion to 3.0 core */ +public static final int GL_SAMPLER_BUFFER_EXT = 0x8DC2; +/** Missed in the GL_EXT_gpu_shader4 promotion to 3.0 core */ +public static final int GL_INT_SAMPLER_2D_RECT_EXT = 0x8DCD; +/** Missed in the GL_EXT_gpu_shader4 promotion to 3.0 core */ +public static final int GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT = 0x8DD5; +/** Missed in the GL_EXT_gpu_shader4 promotion to 3.0 core */ +public static final int GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT = 0x8DD8; +/** Missed in the GL_EXT_gpu_shader4 promotion to 3.0 core */ +public static final int GL_VERTEX_ATTRIB_ARRAY_INTEGER_EXT = 0x88FD; + +/** Missed in the GL_ARB_color_buffer_float promotion to 3.0 core */ +public static final int GL_RGBA_FLOAT_MODE_ARB = 0x8820; + +/** Missed in the GL_ARB_texture_float promotion to 3.0 core */ +public static final int GL_ALPHA32F_ARB = 0x8816; +/** Missed in the GL_ARB_texture_float promotion to 3.0 core */ +public static final int GL_INTENSITY32F_ARB = 0x8817; +/** Missed in the GL_ARB_texture_float promotion to 3.0 core */ +public static final int GL_LUMINANCE32F_ARB = 0x8818; +/** Missed in the GL_ARB_texture_float promotion to 3.0 core */ +public static final int GL_ALPHA16F_ARB = 0x881C; +/** Missed in the GL_ARB_texture_float promotion to 3.0 core */ +public static final int GL_INTENSITY16F_ARB = 0x881D; +/** Missed in the GL_ARB_texture_float promotion to 3.0 core */ +public static final int GL_LUMINANCE16F_ARB = 0x881E; +/** Missed in the GL_ARB_texture_float promotion to 3.0 core */ +public static final int GL_LUMINANCE_ALPHA16F_ARB = 0x881F; + +/** Missed in the GL_EXT_packed_float promotion to 3.0 core */ +public static final int GL_RGBA_SIGNED_COMPONENTS_EXT = 0x8C3C; + +/** Missed in the GL_EXT_texture_array promotion to 3.0 core */ +public static final int GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT = 0x884E; + +/** Missed in the GL_EXT_framebuffer_sRGB promotion to 3.0 core */ +public static final int GL_FRAMEBUFFER_SRGB_CAPABLE_EXT = 0x8DBA; + + diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gl2.java b/make/config/jogl/gl-impl-CustomJavaCode-gl2.java index 061830cb4..5928b3a0b 100644 --- a/make/config/jogl/gl-impl-CustomJavaCode-gl2.java +++ b/make/config/jogl/gl-impl-CustomJavaCode-gl2.java @@ -15,6 +15,7 @@ public void setObjectTracker(GLObjectTracker tracker) { */ + public GL2Impl(GLProfile glp, GLContextImpl context) { this._context = context; this.bufferSizeTracker = context.getBufferSizeTracker(); diff --git a/make/doc/jogl/spec-overview.html b/make/doc/jogl/spec-overview.html index 4ee902719..f79e5ff23 100644 --- a/make/doc/jogl/spec-overview.html +++ b/make/doc/jogl/spec-overview.html @@ -53,7 +53,7 @@ bindings to the native OpenGL(R) 3D graphics library profiles: This interface contains all core desktop OpenGL methods through version 3.0, inclusive, as well as most of it's extensions defined at the time of this specification. Early OpenGL extensions whose functionality -was incorporated into core OpenGL by version 2.0, inclusive, are specifically +was incorporated into core OpenGL by version 3.0, inclusive, are specifically excluded.
    Future extensions will be added with a maintenance update

  • @@ -304,11 +304,16 @@ according the following rules:
    • -
    • All functions in core OpenGL 2.0, inclusive, have been included.
    • +
    • All functions in core OpenGL 3.0, inclusive, have been included.
    • If the functionality of the OpenGL extension was subsumed into core -OpenGL by version 2.0, then the extension was dropped from the Java bindings. +OpenGL by version 3.0, then the extension was dropped from the Java bindings. However, if the core function name is not available in the native OpenGL implementation, - the extension named equivalent is used instead, e.g. GL_ARB_framebuffer_object.
    • + the extension named equivalent is used instead, e.g. GL_ARB_framebuffer_object. + In general the native method name will be looked up as follows +
        +
      • Try the interface name
      • +
      • Try the extension name: ARB, EXT, ..
      • +
    • Functions that deal with explicit pointer values in such a way that they cannot be properly implemented in Java have been excluded.  This includes retrieval methods with a C void ** in the OpenGL signature like glGetBufferPointerv, @@ -370,8 +375,8 @@ implementation.

      OpenGL Version on Runtime System

      Even though OpenGL extensions whose functionality was included into core -OpenGL by version 2.0, inclusive, are not included in the bindings, it should -be noted that OpenGL version 2.0 is not an absolute requirement on the runtime +OpenGL by version 3.0, inclusive, are not included in the bindings, it should +be noted that OpenGL version 3.0 is not an absolute requirement on the runtime system.  This is because a user could query whether any particular function is available before calling certain core APIs that might not be present.  Also, if the core function name is not available in the native OpenGL implementation, @@ -423,6 +428,15 @@ http://www.khronos.org/registry/cl/ href="http://www.opengl.org/registry/doc/glspec31.20090324.pdf"> http://www.opengl.org/registry/doc/glspec31.20090324.pdf +
        +
      • OpenGL 3.0 Specification
      • + +
      + +
      +http://www.opengl.org/registry/doc/glspec30.20080923.pdf
      +
      • OpenGL 2.1 Specification
      • diff --git a/src/jogl/classes/javax/media/opengl/GLPipelineFactory.java b/src/jogl/classes/javax/media/opengl/GLPipelineFactory.java index bb9f86911..9aceb2c53 100644 --- a/src/jogl/classes/javax/media/opengl/GLPipelineFactory.java +++ b/src/jogl/classes/javax/media/opengl/GLPipelineFactory.java @@ -54,13 +54,12 @@ public class GLPipelineFactory { * The upstream GL instance is determined as follows: *
          *
        • Use pipelineClazzBaseName as the class name's full basename, incl. package name
        • - *
        • For all downstream classes, do:
        • + *
        • For the downstream classe and it's superclasses, do:
        • *
            - *
          • For all downstream class interfaces, do:
          • + *
          • For all downstream class and superclass interfaces, do:
          • *
              - *
            • If reqInterface is not null and the interface is unequal, continue.
            • - *
            • If downstream is not instance of interface, continue.
            • - *
            • If downstream is not instance of interface, continue.
            • + *
            • If reqInterface is not null and the interface is unequal, continue loop.
            • + *
            • If downstream is not instance of interface, continue loop.
            • *
            • If upstream class is available use it, end loop.
            • *
            *
          -- cgit v1.2.3 From 363fe8afc173ec9bf7fda4f863ddd14cd5ceabb5 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 2 Aug 2009 04:54:41 -0700 Subject: Fix doc bug @arg -> @param --- make/config/jogl/gl-common.cfg | 2 +- make/doc/jogl/spec-overview.html | 2 +- .../classes/com/sun/opengl/impl/GLDrawableFactoryImpl.java | 2 +- src/jogl/classes/com/sun/opengl/util/GLArrayDataClient.java | 10 +++++----- src/jogl/classes/com/sun/opengl/util/GLArrayDataServer.java | 10 +++++----- src/jogl/classes/com/sun/opengl/util/glsl/ShaderState.java | 4 ++-- src/jogl/classes/javax/media/opengl/GLDrawableFactory.java | 2 +- src/jogl/classes/javax/media/opengl/GLPipelineFactory.java | 10 +++++----- src/jogl/classes/javax/media/opengl/GLUniformData.java | 12 ++++++------ 9 files changed, 27 insertions(+), 27 deletions(-) (limited to 'src/jogl/classes/javax/media') diff --git a/make/config/jogl/gl-common.cfg b/make/config/jogl/gl-common.cfg index 7cf51fda5..3df9cc852 100644 --- a/make/config/jogl/gl-common.cfg +++ b/make/config/jogl/gl-common.cfg @@ -611,7 +611,7 @@ ClassJavadoc GL3 * inclusive - forward compatible, as well as most of it's exte ClassJavadoc GL3 * time of this specification.
          ClassJavadoc GL3 * Note: OpenGL 3.0 forward compatible, non deprecated functionality is included in the ClassJavadoc GL3 * 3.1 specification, hence the {@link GL2GL3} implemented interface.
          -ClassJavadoc GL3 * Note: OpenGL 3.1 (forward compatible) no more includes fixed point functionality. +ClassJavadoc GL3 * Note: OpenGL 3.1 forward compatible no more includes fixed point functionality. ClassJavadoc GL3 *

          ClassJavadoc GL3 */ diff --git a/make/doc/jogl/spec-overview.html b/make/doc/jogl/spec-overview.html index 6557e9f7a..89b4ac7c8 100644 --- a/make/doc/jogl/spec-overview.html +++ b/make/doc/jogl/spec-overview.html @@ -67,7 +67,7 @@ inclusive - forward compatible only, as well as most of it's extensions defined time of this specification.
          Note: OpenGL 3.0 forward compatible, non deprecated functionality is included in the 3.1 specification, hence the {@link javax.media.opengl.GL2GL3} implemented interface.
          - Note: OpenGL 3.1 (forward compatible) no more includes fixed point functionality.
          + Note: OpenGL 3.1 forward compatible no more includes fixed point functionality.
          Future extensions will be added with a maintenance update
        • {@link javax.media.opengl.GLES1 javax.media.opengl.GLES1} interface
          diff --git a/src/jogl/classes/com/sun/opengl/impl/GLDrawableFactoryImpl.java b/src/jogl/classes/com/sun/opengl/impl/GLDrawableFactoryImpl.java index de911950a..0d540647a 100644 --- a/src/jogl/classes/com/sun/opengl/impl/GLDrawableFactoryImpl.java +++ b/src/jogl/classes/com/sun/opengl/impl/GLDrawableFactoryImpl.java @@ -69,7 +69,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory { /** * Returns the sole GLDrawableFactoryImpl instance. * - * @arg glProfile GLProfile to determine the factory type, ie EGLDrawableFactory, + * @param glProfile GLProfile to determine the factory type, ie EGLDrawableFactory, * or one of the native GLDrawableFactory's, ie X11/GLX, Windows/WGL or MacOSX/CGL. */ public static GLDrawableFactoryImpl getFactoryImpl(GLProfile glp) { diff --git a/src/jogl/classes/com/sun/opengl/util/GLArrayDataClient.java b/src/jogl/classes/com/sun/opengl/util/GLArrayDataClient.java index e05a77226..ec4c5e393 100644 --- a/src/jogl/classes/com/sun/opengl/util/GLArrayDataClient.java +++ b/src/jogl/classes/com/sun/opengl/util/GLArrayDataClient.java @@ -27,13 +27,13 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData }) != null; /** - * @arg index The GL array index - * @arg name The optional custom name for the GL array index, maybe null. + * @param index The GL array index + * @param name The optional custom name for the GL array index, maybe null. * If null, the default name mapping will be used, see 'getPredefinedArrayIndexName(int)'. * This name might be used as the shader attribute name. - * @arg comps The array component number - * @arg dataType The array index GL data type - * @arg normalized Wheather the data shall be normalized + * @param comps The array component number + * @param dataType The array index GL data type + * @param normalized Wheather the data shall be normalized * * @see javax.media.opengl.GLContext#getPredefinedArrayIndexName(int) */ diff --git a/src/jogl/classes/com/sun/opengl/util/GLArrayDataServer.java b/src/jogl/classes/com/sun/opengl/util/GLArrayDataServer.java index e9a5e2754..dc233ce36 100644 --- a/src/jogl/classes/com/sun/opengl/util/GLArrayDataServer.java +++ b/src/jogl/classes/com/sun/opengl/util/GLArrayDataServer.java @@ -21,13 +21,13 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE * EnableVertexAttribArray and VertexAttribPointer calls, * and a predefined vertex attribute variable name will be choosen. * - * @arg index The GL array index - * @arg name The optional custom name for the GL array index, maybe null. + * @param index The GL array index + * @param name The optional custom name for the GL array index, maybe null. * If null, the default name mapping will be used, see 'getPredefinedArrayIndexName(int)'. * This name might be used as the shader attribute name. - * @arg comps The array component number - * @arg dataType The array index GL data type - * @arg normalized Wheather the data shall be normalized + * @param comps The array component number + * @param dataType The array index GL data type + * @param normalized Wheather the data shall be normalized * * @see javax.media.opengl.GLContext#getPredefinedArrayIndexName(int) */ diff --git a/src/jogl/classes/com/sun/opengl/util/glsl/ShaderState.java b/src/jogl/classes/com/sun/opengl/util/glsl/ShaderState.java index d8f6eeea2..8712ac7e2 100644 --- a/src/jogl/classes/com/sun/opengl/util/glsl/ShaderState.java +++ b/src/jogl/classes/com/sun/opengl/util/glsl/ShaderState.java @@ -318,7 +318,7 @@ public class ShaderState { * Even if the attribute is not found in the current shader, * it is stored in this state. * - * @arg data the GLArrayData's name must match the attributes one, + * @param data the GLArrayData's name must match the attributes one, * it's index will be set with the attribute's location, * if found. * @@ -549,7 +549,7 @@ public class ShaderState { * Even if the uniform is not found in the current shader, * it is stored in this state. * - * @arg data the GLUniforms's name must match the uniform one, + * @param data the GLUniforms's name must match the uniform one, * it's index will be set with the uniforms's location, * if found. * diff --git a/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java b/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java index 5a761119f..1a18a60f8 100644 --- a/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java +++ b/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java @@ -148,7 +148,7 @@ public abstract class GLDrawableFactory { /** * Returns the sole GLDrawableFactory instance. * - * @arg glProfile GLProfile to determine the factory type, ie EGLDrawableFactory, + * @param glProfile GLProfile to determine the factory type, ie EGLDrawableFactory, * or one of the native GLDrawableFactory's, ie X11/GLX, Windows/WGL or MacOSX/CGL. */ public static GLDrawableFactory getFactory(GLProfile glProfile) throws GLException { diff --git a/src/jogl/classes/javax/media/opengl/GLPipelineFactory.java b/src/jogl/classes/javax/media/opengl/GLPipelineFactory.java index 9aceb2c53..63b50cb3c 100644 --- a/src/jogl/classes/javax/media/opengl/GLPipelineFactory.java +++ b/src/jogl/classes/javax/media/opengl/GLPipelineFactory.java @@ -54,7 +54,7 @@ public class GLPipelineFactory { * The upstream GL instance is determined as follows: *
            *
          • Use pipelineClazzBaseName as the class name's full basename, incl. package name
          • - *
          • For the downstream classe and it's superclasses, do:
          • + *
          • For the downstream class and it's superclasses, do:
          • *
              *
            • For all downstream class and superclass interfaces, do:
            • *
                @@ -65,10 +65,10 @@ public class GLPipelineFactory { *
              *

            * - * @arg pipelineClazzBaseName the basename of the pipline class name - * @arg reqInterface optional requested interface to be used, may be null, in which case the first matching one is used - * @arg downstream is always the 1st argument for the upstream constructor - * @arg additionalArgs additional arguments for the upstream constructor + * @param pipelineClazzBaseName the basename of the pipline class name + * @param reqInterface optional requested interface to be used, may be null, in which case the first matching one is used + * @param downstream is always the 1st argument for the upstream constructor + * @param additionalArgs additional arguments for the upstream constructor */ public static final GL create(String pipelineClazzBaseName, Class reqInterface, GL downstream, Object[] additionalArgs) { Class downstreamClazz = downstream.getClass(); diff --git a/src/jogl/classes/javax/media/opengl/GLUniformData.java b/src/jogl/classes/javax/media/opengl/GLUniformData.java index 8b5fb1a03..f628ce35a 100644 --- a/src/jogl/classes/javax/media/opengl/GLUniformData.java +++ b/src/jogl/classes/javax/media/opengl/GLUniformData.java @@ -10,7 +10,7 @@ public class GLUniformData { * * Number of objects is 1 * - * @arg components number of elements of one object, ie 4 for GL_FLOAT_VEC4, + * @param components number of elements of one object, ie 4 for GL_FLOAT_VEC4, */ public GLUniformData(String name, int val) { init(name, 1, new Integer(val)); @@ -21,7 +21,7 @@ public class GLUniformData { * * Number of objects is 1 * - * @arg components number of elements of one object, ie 4 for GL_FLOAT_VEC4, + * @param components number of elements of one object, ie 4 for GL_FLOAT_VEC4, */ public GLUniformData(String name, float val) { init(name, 1, new Float(val)); @@ -32,7 +32,7 @@ public class GLUniformData { * * Number of objects is calculated by data.limit()/components * - * @arg components number of elements of one object, ie 4 for GL_FLOAT_VEC4, + * @param components number of elements of one object, ie 4 for GL_FLOAT_VEC4, */ public GLUniformData(String name, int components, IntBuffer data) { init(name, components, data); @@ -43,7 +43,7 @@ public class GLUniformData { * * Number of objects is calculated by data.limit()/components * - * @arg components number of elements of one object, ie 4 for GL_FLOAT_VEC4, + * @param components number of elements of one object, ie 4 for GL_FLOAT_VEC4, */ public GLUniformData(String name, int components, FloatBuffer data) { init(name, components, data); @@ -54,8 +54,8 @@ public class GLUniformData { * * Number of objects is calculated by data.limit()/(rows*columns) * - * @arg rows the matrix rows - * @arg column the matrix column + * @param rows the matrix rows + * @param column the matrix column */ public GLUniformData(String name, int rows, int columns, FloatBuffer data) { init(name, rows, columns, data); -- cgit v1.2.3