diff options
author | sg215889 <[email protected]> | 2009-07-29 06:27:46 -0700 |
---|---|---|
committer | sg215889 <[email protected]> | 2009-07-29 06:27:46 -0700 |
commit | b5ce9cce6223810c6df7b66cf1a51318309fdc90 (patch) | |
tree | b43116500cc26a53545d571972aa29c0711670c0 | |
parent | b00c6b4d36d60bc3a29a4458e42fb29c9a9ca941 (diff) |
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().
26 files changed, 435 insertions, 226 deletions
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/**"/> <property name="java.part.gl2.dbg" - value="javax/media/opengl/TraceGL2.* javax/media/opengl/DebugGL2.*"/> + value="javax/media/opengl/TraceGL2.* javax/media/opengl/DebugGL2.* javax/media/opengl/TraceGL2GL3.* javax/media/opengl/DebugGL2GL3.*"/> <property name="java.part.es1" value="javax/media/opengl/**/es1/** com/sun/opengl/**/es1/**"/> @@ -637,6 +637,25 @@ </gluegen> </target> + <target name="java.generate.gl2_gl3_if"> + <echo message="Generating GL2_GL3 interface" /> + <antcall target="java.generate.copy2temp" inheritRefs="true" /> + <gluegen src="${stub.includes.opengl}/gl2.c" + outputRootDir="${build}" + config="${config}/gl-gl2-set.cfg" + includeRefid="stub.includes.fileset.all.gl2" + emitter="com.sun.gluegen.opengl.GLEmitter"> + <classpath refid="gluegen.classpath" /> + </gluegen> + <gluegen src="${stub.includes.opengl}/gl3.c" + outputRootDir="${build}" + config="${config}/gl-if-gl2_gl3.cfg" + includeRefid="stub.includes.fileset.all.gl2" + emitter="com.sun.gluegen.opengl.GLEmitter"> + <classpath refid="gluegen.classpath" /> + </gluegen> + </target> + <target name="java.generate.gl2"> <echo message="Generating GL2 interface and implementation" /> <antcall target="java.generate.copy2temp" inheritRefs="true" /> @@ -697,7 +716,7 @@ </gluegen> </target> - <target name="java.generate.gl.all" depends="java.generate.gl_if, java.generate.gl2_es1_if, java.generate.gl2_es2_if, java.generate.gl2, java.generate.gl3, java.generate.gl2es12, java.generate.gles1, java.generate.gles2"/> + <target name="java.generate.gl.all" depends="java.generate.gl_if, java.generate.gl2_es1_if, java.generate.gl2_es2_if, java.generate.gl2_gl3_if, java.generate.gl2, java.generate.gl3, java.generate.gl2es12, java.generate.gles1, java.generate.gles2"/> <!-- target name="java.generate.gl.nsig" if="gluegen.nsig"> <echo message="Generating GL interface and implementation" /> @@ -1019,9 +1038,14 @@ <arg value="${src.generated.java}/javax/media/opengl" /> <classpath refid="pipeline.classpath" /> </java> + <java classname="com.sun.gluegen.opengl.BuildComposablePipeline" fork="yes" failonerror="true"> + <arg value="javax.media.opengl.GL2GL3" /> + <arg value="${src.generated.java}/javax/media/opengl" /> + <classpath refid="pipeline.classpath" /> + </java> <copy todir="${src.generated.java-cdc}"> <fileset dir="${src.generated.java}" - includes="javax/media/opengl/DebugGL2.java javax/media/opengl/TraceGL2.java" /> + includes="javax/media/opengl/DebugGL2.java javax/media/opengl/TraceGL2.java javax/media/opengl/DebugGL2GL3.java javax/media/opengl/TraceGL2GL3.java" /> </copy> </target> @@ -1084,7 +1108,7 @@ <!-- Perform the first pass Java compile. --> <javac destdir="${classes}" - includes="javax/media/opengl/fixedfunc/** javax/media/opengl/GLDrawableFactory.java javax/media/opengl/GLDrawable.java javax/media/opengl/GLContext.java javax/media/opengl/GL.java javax/media/opengl/GL2ES1.java javax/media/opengl/GL2ES2.java javax/media/opengl/GL2.java javax/media/opengl/GLES1.java javax/media/opengl/GLES2.java javax/media/opengl/GL3.java" + includes="javax/media/opengl/fixedfunc/** javax/media/opengl/GLDrawableFactory.java javax/media/opengl/GLDrawable.java javax/media/opengl/GLContext.java javax/media/opengl/GL.java javax/media/opengl/GL2ES1.java javax/media/opengl/GL2ES2.java javax/media/opengl/GL2GL3.java javax/media/opengl/GL2.java javax/media/opengl/GLES1.java javax/media/opengl/GLES2.java javax/media/opengl/GL3.java" fork="yes" memoryMaximumSize="${javac.memorymax}" source="1.4" debug="${javacdebug}" debuglevel="${javacdebuglevel}"> @@ -1797,17 +1821,17 @@ <jar manifest="${build}/tempversion" destfile="${jogl.gl2.x11.jar}"> <fileset dir="${classes}" includes="${java.part.glx}, ${java.part.gl2}, ${java.part.gl3}, ${java.part.openmax}" - excludes="${java.part.gl2.dbg}, ${java.part.glugl2}"/> + excludes="${java.part.gl2.dbg}, ${java.part.gl3.dbg}, ${java.part.glugl2}"/> </jar> <jar manifest="${build}/tempversion" destfile="${jogl.gl2.win.jar}"> <fileset dir="${classes}" includes="${java.part.wgl}, ${java.part.gl2}, $${java.part.gl3}, {java.part.openmax}" - excludes="${java.part.gl2.dbg}, ${java.part.glugl2}"/> + excludes="${java.part.gl2.dbg}, ${java.part.gl3.dbg}, ${java.part.glugl2}"/> </jar> <jar manifest="${build}/tempversion" destfile="${jogl.gl2.osx.jar}"> <fileset dir="${classes}" includes="${java.part.cgl}, ${java.part.gl2}, $${java.part.gl3}, {java.part.openmax}" - excludes="${java.part.gl2.dbg}, ${java.part.glugl2}"/> + excludes="${java.part.gl2.dbg}, ${java.part.gl3.dbg}, ${java.part.glugl2}"/> </jar> <jar manifest="${build}/tempversion" destfile="${jogl.gl2.dbg.jar}"> <fileset dir="${classes}" diff --git a/make/config/jogl/eglext.cfg b/make/config/jogl/eglext.cfg index bdd9a3655..857eb5804 100755 --- a/make/config/jogl/eglext.cfg +++ b/make/config/jogl/eglext.cfg @@ -10,7 +10,7 @@ ImplPackage com.sun.opengl.impl.egl ImplJavaClass EGLExtImpl # Shouldn't matter which one of these we pick up -ExtendedInterfaceSymbols ../build-temp/gensrc/classes/com/sun/opengl/impl/egl/EGL.java +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/com/sun/opengl/impl/egl/EGL.java HierarchicalNativeOutput false Include gl-common.cfg diff --git a/make/config/jogl/gl-common.cfg b/make/config/jogl/gl-common.cfg index 50c2ff004..19e0eb8e4 100644 --- a/make/config/jogl/gl-common.cfg +++ b/make/config/jogl/gl-common.cfg @@ -481,70 +481,87 @@ RangeCheck glDeleteVertexArraysAPPLE 1 {0} # Javadoc for the GL class ClassJavadoc GL /** -ClassJavadoc GL * <P> 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. </P> -ClassJavadoc GL * -ClassJavadoc GL * <P> 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 * <code>gl.isFunctionAvailable("glProgramStringARB")</code>. 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. </P> -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 * <code>gl.isExtensionAvailable("GL_ARB_vertex_program");</code>. -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 * <code>gl.isExtensionAvailable("GL_VERSION_1_5");</code>. -ClassJavadoc GL * -ClassJavadoc GL * <P> Exceptions to the window system extension naming rules: -ClassJavadoc GL * -ClassJavadoc GL * <UL> -ClassJavadoc GL * -ClassJavadoc GL * <LI> The memory allocators for the NVidia vertex_array_range (VAR) -ClassJavadoc GL * extension, in particular <code>wglAllocateMemoryNV</code> / -ClassJavadoc GL * <code>glXAllocateMemoryNV</code> 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. </P> -ClassJavadoc GL * -ClassJavadoc GL * <LI> 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 * </UL> <P> -ClassJavadoc GL * +ClassJavadoc GL * <P> Common interface containing the subset of all profiles, GL3, GL2, GLES1 and GLES2.<br> +ClassJavadoc GL * This interface reflects common data types, texture and framebuffer functionality.</P> ClassJavadoc GL */ +ClassJavadoc GL2ES1 /** +ClassJavadoc GL2ES1 * <P> +ClassJavadoc GL2ES1 * Interface containing the common subset of GL2 and GLES1.<br> +ClassJavadoc GL2ES1 * This interface reflects only the fixed functionality of OpenGL<br> +ClassJavadoc GL2ES1 * </P> +ClassJavadoc GL2ES1 */ + +ClassJavadoc GL2ES2 /** +ClassJavadoc GL2ES2 * <P> +ClassJavadoc GL2ES2 * Interface containing the common subset of GL3, GL2 and GLES2.<br> +ClassJavadoc GL2ES2 * This interface reflects only the programmable shader functionality of desktop and embedded OpenGL<br> +ClassJavadoc GL2ES2 * </P> +ClassJavadoc GL2ES2 */ + +ClassJavadoc GL2GL3 /** +ClassJavadoc GL2GL3 * <P> +ClassJavadoc GL2GL3 * Interface containing the common subset of GL3 and GL2.<br> +ClassJavadoc GL2GL3 * This interface reflects only the programmable shader functionality of desktop OpenGL<br> +ClassJavadoc GL2GL3 * </P> +ClassJavadoc GL2GL3 */ + +ClassJavadoc GL2 /** +ClassJavadoc GL2 * <P> +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 * </P> +ClassJavadoc GL2 */ + +ClassJavadoc GL3 /** +ClassJavadoc GL3 * <P> +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.<br> +ClassJavadoc GL3 * </P> +ClassJavadoc GL3 */ + +ClassJavadoc GLES1 /** +ClassJavadoc GLES1 * <P> +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 * </P> +ClassJavadoc GLES1 */ + +ClassJavadoc GLES2 /** +ClassJavadoc GLES2 * <P> +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 * </P> +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 * <i>client</i>) and display (OpenGL <i>server</i>) configuration.<P> -CustomJavaCode GL * By "successfully" we mean that the function is both <i>callable</i> -CustomJavaCode GL * on the machine running the program and <i>available</i> on the current -CustomJavaCode GL * display.<P> -CustomJavaCode GL * -CustomJavaCode GL * In order to call a function successfully, the function must be both -CustomJavaCode GL * <i>callable</i> on the machine running the program and <i>available</i> 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. <P> -CustomJavaCode GL * -CustomJavaCode GL * A GL function is <i>callable</i> 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 * <i>client</i>) and display (OpenGL <i>server</i>) configuration.<P> -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 <code>wglAllocateMemoryNV</code> / -CustomJavaCode GL * <code>glXAllocateMemoryNV</code> 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 * <P> -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 <code>wglAllocateMemoryNV</code> / +CustomJavaCode GL2GL3 * <code>glXAllocateMemoryNV</code> 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: <ul> - <li> Desktop OpenGL 1.x, 2.y and 3.0, with x >= 5 and y >= 0 </li> + <li> Desktop OpenGL 1.x, 2.y and 3.0, with x >= 3 and y >= 0 </li> <li> Desktop OpenGL 3.x, with x >= 1 </li> <li> Embedded OpenGL ES 1.x, with x >= 0 </li> <li> Embedded OpenGL ES 2.x, with x >= 0 </li> @@ -60,7 +60,7 @@ excluded.<br> <li> {@link javax.media.opengl.GL3 javax.media.opengl.GL3} interface<br> <br> 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. <br> Future extensions will be added with a <a href="#maintenanceupdates">maintenance update</a></li><br> @@ -101,7 +101,12 @@ time of this specification. <br> <li> {@link javax.media.opengl.GL2ES2 javax.media.opengl.GL2ES2} interface<br> <br> Interface containing the common subset of GL3, GL2 and GLES2.<br> - This interface reflects only the programmable shader functionality of OpenGL</li><br> + This interface reflects only the programmable shader functionality of desktop and embedded OpenGL</li><br> + + <li> {@link javax.media.opengl.GL2GL3 javax.media.opengl.GL2GL3} interface<br> + <br> + Interface containing the common subset of GL3 and GL2.<br> + This interface reflects only the programmable shader functionality of desktop OpenGL</li><br> </ul> </li><br> @@ -500,7 +505,7 @@ http://www.khronos.org/registry/gles/</a></blockquote> <li> Proposed Final Draft Review, February/March 2006 <li> 1.0.0 Final Release, September 2006 <li> 1.1.0 Maintenance Release, April 2007 -<li> 1.2.0 Maintenance Release, June 2009 +<li> 2.0.0 Maintenance Release, July 2009 </ul> <br> <br> 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 <BUILDDIR>" + 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. + * <P>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.</P> + * + * <P> 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, + * <code>gl.isFunctionAvailable("glProgramStringARB")</code>. 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. </P> + * + * {@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, + * <code>gl.isExtensionAvailable("GL_ARB_vertex_program");</code>. + * 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, + * <code>gl.isExtensionAvailable("GL_VERSION_1_5");</code>. + * + * <P> Exceptions to the window system extension naming rules: + * + * <UL> + * + * <LI> The memory allocators for the NVidia vertex_array_range (VAR) + * extension, in particular <code>wglAllocateMemoryNV</code> / + * <code>glXAllocateMemoryNV</code> 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. </P> + * + * <LI> 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". + * + * </UL> <P> + * */ 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 + * <i>client</i>) and display (OpenGL <i>server</i>) configuration.<P> + * By "successfully" we mean that the function is both <i>callable</i> + * on the machine running the program and <i>available</i> on the current + * display.<P> + * + * In order to call a function successfully, the function must be both + * <i>callable</i> on the machine running the program and <i>available</i> 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. <P> + * + * A GL function is <i>callable</i> 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 + * <i>client</i>) and display (OpenGL <i>server</i>) configuration.<P> + * + * @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. + * + * <P> + * + * 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"); |