diff options
-rw-r--r-- | make/build-jogl.xml | 32 | ||||
-rw-r--r-- | make/config/jogl/gl-impl-CustomJavaCode-gl2.java | 12 | ||||
-rw-r--r-- | make/config/jogl/gl-impl-CustomJavaCode-gl2es12.java | 12 | ||||
-rw-r--r-- | make/config/jogl/gl-impl-CustomJavaCode-gl3.java | 12 | ||||
-rwxr-xr-x | make/config/jogl/gl-impl-CustomJavaCode-gles1.java | 12 | ||||
-rwxr-xr-x | make/config/jogl/gl-impl-CustomJavaCode-gles2.java | 12 | ||||
-rwxr-xr-x | make/stub_includes/opengl/GL3/gl3.h | 157 | ||||
-rw-r--r-- | make/stub_includes/opengl/GL3/gl3ext.h | 230 | ||||
-rw-r--r-- | src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLContext.java | 18 | ||||
-rw-r--r-- | src/jogl/classes/com/sun/opengl/impl/x11/glx/X11GLXContext.java | 18 | ||||
-rw-r--r-- | src/jogl/classes/javax/media/opengl/GLBase.java | 20 | ||||
-rw-r--r-- | src/jogl/classes/javax/media/opengl/GLProfile.java | 43 |
12 files changed, 388 insertions, 190 deletions
diff --git a/make/build-jogl.xml b/make/build-jogl.xml index bf07499a6..7151151cd 100644 --- a/make/build-jogl.xml +++ b/make/build-jogl.xml @@ -134,7 +134,7 @@ value="com/sun/opengl/impl/**/gl3/**"/> <property name="java.part.gl3.dbg" - value="javax/media/opengl/TraceGL3.* javax/media/opengl/DebugGL3.*"/> + value="javax/media/opengl/TraceGL3.* javax/media/opengl/DebugGL3.* javax/media/opengl/TraceGL3bc.* javax/media/opengl/DebugGL3bc.*"/> <property name="java.part.gl2" value="com/sun/opengl/impl/**/gl2/**"/> @@ -678,8 +678,20 @@ </gluegen> </target> + <target name="java.generate.gl3bc"> + <echo message="Generating GL3bc implementation" /> + <antcall target="java.generate.copy2temp" inheritRefs="true" /> + <gluegen src="${stub.includes.opengl}/gl3bc.c" + outputRootDir="${build}" + config="${config}/gl-gl3bc.cfg" + includeRefid="stub.includes.fileset.all.gl2" + emitter="com.sun.gluegen.opengl.GLEmitter"> + <classpath refid="gluegen.classpath" /> + </gluegen> + </target> + <target name="java.generate.gl2es12"> - <echo message="Generating GL2ES12 interface and implementation" /> + <echo message="Generating GL2ES12 implementation" /> <antcall target="java.generate.copy2temp" inheritRefs="true" /> <gluegen src="${stub.includes.opengl}/gl2es12.c" outputRootDir="${build}" @@ -714,7 +726,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_gl3_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.gl3bc, 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" /> @@ -987,7 +999,7 @@ <dependset> <srcfilelist dir="${classes}/javax/media/opengl" files="GL3.class" /> <targetfileset dir="${src.generated.java}/javax/media/opengl" - includes="DebugGL3.java,TraceGL3.java" /> + includes="DebugGL3.java,TraceGL3.java,DebugGL3bc.java,TraceGL3bc.java" /> </dependset> <!-- Now choose one of the two to test to see if we have to regenerate --> @@ -1057,6 +1069,16 @@ <fileset dir="${src.generated.java}" includes="javax/media/opengl/DebugGL3.java javax/media/opengl/TraceGL3.java" /> </copy> + + <java classname="com.sun.gluegen.opengl.BuildComposablePipeline" fork="yes" failonerror="true"> + <arg value="javax.media.opengl.GL3bc" /> + <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/DebugGL3bc.java javax/media/opengl/TraceGL3bc.java" /> + </copy> </target> <target name="java.generate.composable.pipeline" depends="java.generate.composable.pipeline.es1, java.generate.composable.pipeline.es2, java.generate.composable.pipeline.gl2, java.generate.composable.pipeline.gl3"> @@ -1106,7 +1128,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/GL2GL3.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 javax/media/opengl/GL3bc.java" fork="yes" memoryMaximumSize="${javac.memorymax}" source="1.4" debug="${javacdebug}" debuglevel="${javacdebuglevel}"> diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gl2.java b/make/config/jogl/gl-impl-CustomJavaCode-gl2.java index 587bb6738..cd1a24459 100644 --- a/make/config/jogl/gl-impl-CustomJavaCode-gl2.java +++ b/make/config/jogl/gl-impl-CustomJavaCode-gl2.java @@ -28,6 +28,10 @@ public final boolean isGL() { return true; } +public final boolean isGL3bc() { + return false; +} + public final boolean isGL3() { return false; } @@ -68,6 +72,10 @@ public final GL getGL() throws GLException { return this; } +public final GL3bc getGL3bc() throws GLException { + throw new GLException("Not a GL3bc implementation"); +} + public final GL3 getGL3() throws GLException { throw new GLException("Not a GL3 implementation"); } @@ -147,7 +155,7 @@ public Object getPlatformGLExtensions() { based on code in the SGI OpenGL sample implementation. */ private int imageSizeInBytes(int format, int type, int w, int h, int d, - int dimensions, boolean pack) { + boolean pack) { int elements = 0; int esize = 0; @@ -230,7 +238,7 @@ private int imageSizeInBytes(int format, int type, int w, int h, int d, default: return 0; } - return imageSizeInBytes(elements * esize, w, h, d, dimensions, pack); + return imageSizeInBytes(elements * esize, w, h, d, pack); } private GLBufferSizeTracker bufferSizeTracker; diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gl2es12.java b/make/config/jogl/gl-impl-CustomJavaCode-gl2es12.java index 8e9c8bf01..2eca2b6ab 100644 --- a/make/config/jogl/gl-impl-CustomJavaCode-gl2es12.java +++ b/make/config/jogl/gl-impl-CustomJavaCode-gl2es12.java @@ -30,6 +30,10 @@ public final boolean isGL() { return true; } +public final boolean isGL3bc() { + return false; +} + public final boolean isGL3() { return false; } @@ -70,6 +74,10 @@ public final GL getGL() throws GLException { return this; } +public final GL3bc getGL3bc() throws GLException { + throw new GLException("Not a GL3bc implementation"); +} + public final GL3 getGL3() throws GLException { throw new GLException("Not a GL3 implementation"); } @@ -147,7 +155,7 @@ public Object getPlatformGLExtensions() { based on code in the SGI OpenGL sample implementation. */ private int imageSizeInBytes(int format, int type, int w, int h, int d, - int dimensions, boolean pack) { + boolean pack) { int elements = 0; int esize = 0; @@ -202,7 +210,7 @@ private int imageSizeInBytes(int format, int type, int w, int h, int d, default: return 0; } - return imageSizeInBytes(elements * esize, w, h, d, dimensions, pack); + return imageSizeInBytes(elements * esize, w, h, d, pack); } private GLBufferSizeTracker bufferSizeTracker; diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gl3.java b/make/config/jogl/gl-impl-CustomJavaCode-gl3.java index b69188c73..16ff008cf 100644 --- a/make/config/jogl/gl-impl-CustomJavaCode-gl3.java +++ b/make/config/jogl/gl-impl-CustomJavaCode-gl3.java @@ -27,6 +27,10 @@ public final boolean isGL() { return true; } +public final boolean isGL3bc() { + return false; +} + public final boolean isGL3() { return true; } @@ -67,6 +71,10 @@ public final GL getGL() throws GLException { return this; } +public final GL3bc getGL3bc() throws GLException { + throw new GLException("Not a GL3bc implementation"); +} + public final GL3 getGL3() throws GLException { return this; } @@ -146,7 +154,7 @@ public Object getPlatformGLExtensions() { based on code in the SGI OpenGL sample implementation. */ private int imageSizeInBytes(int format, int type, int w, int h, int d, - int dimensions, boolean pack) { + boolean pack) { int elements = 0; int esize = 0; @@ -221,7 +229,7 @@ private int imageSizeInBytes(int format, int type, int w, int h, int d, default: return 0; } - return imageSizeInBytes(elements * esize, w, h, d, dimensions, pack); + return imageSizeInBytes(elements * esize, w, h, d, pack); } private GLBufferSizeTracker bufferSizeTracker; diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gles1.java b/make/config/jogl/gl-impl-CustomJavaCode-gles1.java index 4e46f076b..dfef10ec9 100755 --- a/make/config/jogl/gl-impl-CustomJavaCode-gles1.java +++ b/make/config/jogl/gl-impl-CustomJavaCode-gles1.java @@ -10,6 +10,10 @@ public final boolean isGL() { return true; } +public final boolean isGL3bc() { + return false; +} + public final boolean isGL3() { return false; } @@ -50,6 +54,10 @@ public final GL getGL() throws GLException { return this; } +public final GL3bc getGL3bc() throws GLException { + throw new GLException("Not a GL3bc implementation"); +} + public final GL3 getGL3() throws GLException { throw new GLException("Not a GL3 implementation"); } @@ -121,7 +129,7 @@ public Object getPlatformGLExtensions() { based on code in the SGI OpenGL sample implementation. */ private int imageSizeInBytes(int format, int type, int w, int h, int d, - int dimensions, boolean pack) { + boolean pack) { int elements = 0; int esize = 0; @@ -166,7 +174,7 @@ private int imageSizeInBytes(int format, int type, int w, int h, int d, default: return 0; } - return imageSizeInBytes(elements * esize, w, h, d, dimensions, pack); + return imageSizeInBytes(elements * esize, w, h, d, pack); } private GLBufferSizeTracker bufferSizeTracker; diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gles2.java b/make/config/jogl/gl-impl-CustomJavaCode-gles2.java index 97a0dbd27..7287408a0 100755 --- a/make/config/jogl/gl-impl-CustomJavaCode-gles2.java +++ b/make/config/jogl/gl-impl-CustomJavaCode-gles2.java @@ -14,6 +14,10 @@ public final boolean isGL() { return true; } +public final boolean isGL3bc() { + return false; +} + public final boolean isGL3() { return false; } @@ -54,6 +58,10 @@ public final GL getGL() throws GLException { return this; } +public final GL3bc getGL3bc() throws GLException { + throw new GLException("Not a GL3bc implementation"); +} + public final GL3 getGL3() throws GLException { throw new GLException("Not a GL3 implementation"); } @@ -125,7 +133,7 @@ public Object getPlatformGLExtensions() { based on code in the SGI OpenGL sample implementation. */ private int imageSizeInBytes(int format, int type, int w, int h, int d, - int dimensions, boolean pack) { + boolean pack) { int elements = 0; int esize = 0; @@ -176,7 +184,7 @@ private int imageSizeInBytes(int format, int type, int w, int h, int d, default: return 0; } - return imageSizeInBytes(elements * esize, w, h, d, dimensions, pack); + return imageSizeInBytes(elements * esize, w, h, d, pack); } private GLBufferSizeTracker bufferSizeTracker; diff --git a/make/stub_includes/opengl/GL3/gl3.h b/make/stub_includes/opengl/GL3/gl3.h index 437830dfa..8bdff4644 100755 --- a/make/stub_includes/opengl/GL3/gl3.h +++ b/make/stub_includes/opengl/GL3/gl3.h @@ -864,75 +864,6 @@ typedef void GLvoid; /* reuse GL_VERTEX_ARRAY_BINDING */ #endif -#ifndef GL_VERSION_3_1 -#define GL_SAMPLER_2D_RECT 0x8B63 -#define GL_SAMPLER_2D_RECT_SHADOW 0x8B64 -#define GL_SAMPLER_BUFFER 0x8DC2 -#define GL_INT_SAMPLER_2D_RECT 0x8DCD -#define GL_INT_SAMPLER_BUFFER 0x8DD0 -#define GL_UNSIGNED_INT_SAMPLER_2D_RECT 0x8DD5 -#define GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8 -#define GL_TEXTURE_BUFFER 0x8C2A -#define GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B -#define GL_TEXTURE_BINDING_BUFFER 0x8C2C -#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D -#define GL_TEXTURE_BUFFER_FORMAT 0x8C2E -#define GL_TEXTURE_RECTANGLE 0x84F5 -#define GL_TEXTURE_BINDING_RECTANGLE 0x84F6 -#define GL_PROXY_TEXTURE_RECTANGLE 0x84F7 -#define GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8 -#define GL_RED_SNORM 0x8F90 -#define GL_RG_SNORM 0x8F91 -#define GL_RGB_SNORM 0x8F92 -#define GL_RGBA_SNORM 0x8F93 -#define GL_R8_SNORM 0x8F94 -#define GL_RG8_SNORM 0x8F95 -#define GL_RGB8_SNORM 0x8F96 -#define GL_RGBA8_SNORM 0x8F97 -#define GL_R16_SNORM 0x8F98 -#define GL_RG16_SNORM 0x8F99 -#define GL_RGB16_SNORM 0x8F9A -#define GL_RGBA16_SNORM 0x8F9B -#define GL_SIGNED_NORMALIZED 0x8F9C -#define GL_PRIMITIVE_RESTART 0x8F9D -#define GL_PRIMITIVE_RESTART_INDEX 0x8F9E -/* Reuse tokens from ARB_copy_buffer */ -/* reuse GL_COPY_READ_BUFFER */ -/* reuse GL_COPY_WRITE_BUFFER */ -/* Would reuse tokens from ARB_draw_instanced, but it has none */ -/* Reuse tokens from ARB_uniform_buffer_object */ -/* reuse GL_UNIFORM_BUFFER */ -/* reuse GL_UNIFORM_BUFFER_BINDING */ -/* reuse GL_UNIFORM_BUFFER_START */ -/* reuse GL_UNIFORM_BUFFER_SIZE */ -/* reuse GL_MAX_VERTEX_UNIFORM_BLOCKS */ -/* reuse GL_MAX_FRAGMENT_UNIFORM_BLOCKS */ -/* reuse GL_MAX_COMBINED_UNIFORM_BLOCKS */ -/* reuse GL_MAX_UNIFORM_BUFFER_BINDINGS */ -/* reuse GL_MAX_UNIFORM_BLOCK_SIZE */ -/* reuse GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS */ -/* reuse GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS */ -/* reuse GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT */ -/* reuse GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH */ -/* reuse GL_ACTIVE_UNIFORM_BLOCKS */ -/* reuse GL_UNIFORM_TYPE */ -/* reuse GL_UNIFORM_SIZE */ -/* reuse GL_UNIFORM_NAME_LENGTH */ -/* reuse GL_UNIFORM_BLOCK_INDEX */ -/* reuse GL_UNIFORM_OFFSET */ -/* reuse GL_UNIFORM_ARRAY_STRIDE */ -/* reuse GL_UNIFORM_MATRIX_STRIDE */ -/* reuse GL_UNIFORM_IS_ROW_MAJOR */ -/* reuse GL_UNIFORM_BLOCK_BINDING */ -/* reuse GL_UNIFORM_BLOCK_DATA_SIZE */ -/* reuse GL_UNIFORM_BLOCK_NAME_LENGTH */ -/* reuse GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS */ -/* reuse GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES */ -/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER */ -/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER */ -/* reuse GL_INVALID_INDEX */ -#endif - #ifndef GL_ARB_framebuffer_object #define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 #define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210 @@ -1026,47 +957,6 @@ typedef void GLvoid; #define GL_VERTEX_ARRAY_BINDING 0x85B5 #endif -#ifndef GL_ARB_uniform_buffer_object -#define GL_UNIFORM_BUFFER 0x8A11 -#define GL_UNIFORM_BUFFER_BINDING 0x8A28 -#define GL_UNIFORM_BUFFER_START 0x8A29 -#define GL_UNIFORM_BUFFER_SIZE 0x8A2A -#define GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B -#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS 0x8A2C -#define GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D -#define GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E -#define GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F -#define GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30 -#define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31 -#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32 -#define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33 -#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34 -#define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35 -#define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36 -#define GL_UNIFORM_TYPE 0x8A37 -#define GL_UNIFORM_SIZE 0x8A38 -#define GL_UNIFORM_NAME_LENGTH 0x8A39 -#define GL_UNIFORM_BLOCK_INDEX 0x8A3A -#define GL_UNIFORM_OFFSET 0x8A3B -#define GL_UNIFORM_ARRAY_STRIDE 0x8A3C -#define GL_UNIFORM_MATRIX_STRIDE 0x8A3D -#define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E -#define GL_UNIFORM_BLOCK_BINDING 0x8A3F -#define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40 -#define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41 -#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42 -#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43 -#define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44 -#define GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45 -#define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46 -/** Manual: #define GL_INVALID_INDEX -1 == (int) 0xFFFFFFFFu */ -#endif - -#ifndef GL_ARB_copy_buffer -#define GL_COPY_READ_BUFFER 0x8F36 -#define GL_COPY_WRITE_BUFFER 0x8F37 -#endif - #ifndef GL_ARB_depth_buffer_float #define GL_DEPTH_COMPONENT32F 0x8CAC #define GL_DEPTH32F_STENCIL8 0x8CAD @@ -1687,23 +1577,6 @@ typedef void (APIENTRYP PFNGLCLEARBUFFERFIPROC) (GLenum buffer, GLint drawbuffer typedef const GLubyte * (APIENTRYP PFNGLGETSTRINGIPROC) (GLenum name, GLuint index); #endif -#ifndef GL_VERSION_3_1 -#define GL_VERSION_3_1 1 -/* OpenGL 3.1 also reuses entry points from these extensions: */ -/* ARB_copy_buffer */ -/* ARB_uniform_buffer_object */ -#ifdef GL3_PROTOTYPES -GLAPI void APIENTRY glDrawArraysInstanced (GLenum, GLint, GLsizei, GLsizei); -GLAPI void APIENTRY glDrawElementsInstanced (GLenum, GLsizei, GLenum, const GLvoid *, GLsizei); -GLAPI void APIENTRY glTexBuffer (GLenum, GLenum, GLuint); -GLAPI void APIENTRY glPrimitiveRestartIndex (GLuint); -#endif /* GL3_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); -typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); -typedef void (APIENTRYP PFNGLTEXBUFFERPROC) (GLenum target, GLenum internalformat, GLuint buffer); -typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXPROC) (GLuint index); -#endif - #ifndef GL_ARB_framebuffer_object #define GL_ARB_framebuffer_object 1 #ifdef GL3_PROTOTYPES @@ -1774,35 +1647,7 @@ typedef void (APIENTRYP PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint *arrays); typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYPROC) (GLuint array); #endif -#ifndef GL_ARB_uniform_buffer_object -#define GL_ARB_uniform_buffer_object 1 -#ifdef GL3_PROTOTYPES -GLAPI void APIENTRY glGetUniformIndices (GLuint, GLsizei, const GLchar* *, GLuint *); -GLAPI void APIENTRY glGetActiveUniformsiv (GLuint, GLsizei, const GLuint *, GLenum, GLint *); -GLAPI void APIENTRY glGetActiveUniformName (GLuint, GLuint, GLsizei, GLsizei *, GLchar *); -GLAPI GLuint APIENTRY glGetUniformBlockIndex (GLuint, const GLchar *); -GLAPI void APIENTRY glGetActiveUniformBlockiv (GLuint, GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetActiveUniformBlockName (GLuint, GLuint, GLsizei, GLsizei *, GLchar *); -GLAPI void APIENTRY glUniformBlockBinding (GLuint, GLuint, GLuint); -#endif /* GL3_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGETUNIFORMINDICESPROC) (GLuint program, GLsizei uniformCount, const GLchar* *uniformNames, GLuint *uniformIndices); -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMSIVPROC) (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMNAMEPROC) (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName); -typedef GLuint (APIENTRYP PFNGLGETUNIFORMBLOCKINDEXPROC) (GLuint program, const GLchar *uniformBlockName); -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKIVPROC) (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName); -typedef void (APIENTRYP PFNGLUNIFORMBLOCKBINDINGPROC) (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); -#endif - -#ifndef GL_ARB_copy_buffer -#define GL_ARB_copy_buffer 1 -#ifdef GL3_PROTOTYPES -GLAPI void APIENTRY glCopyBufferSubData (GLenum, GLenum, GLintptr, GLintptr, GLsizeiptr); -#endif /* GL3_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); -#endif - -/* Include Post-GL 3.1 changes and extensions */ +/* Include Post-GL 3.0 changes and extensions */ #include <GL3/gl3ext.h> diff --git a/make/stub_includes/opengl/GL3/gl3ext.h b/make/stub_includes/opengl/GL3/gl3ext.h index 7d391921f..46b2c6ee7 100644 --- a/make/stub_includes/opengl/GL3/gl3ext.h +++ b/make/stub_includes/opengl/GL3/gl3ext.h @@ -26,6 +26,153 @@ * #endif */ + +#ifndef GL_VERSION_3_1 +#define GL_SAMPLER_2D_RECT 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW 0x8B64 +#define GL_SAMPLER_BUFFER 0x8DC2 +#define GL_INT_SAMPLER_2D_RECT 0x8DCD +#define GL_INT_SAMPLER_BUFFER 0x8DD0 +#define GL_UNSIGNED_INT_SAMPLER_2D_RECT 0x8DD5 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8 +#define GL_TEXTURE_BUFFER 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D +#define GL_TEXTURE_BUFFER_FORMAT 0x8C2E +#define GL_TEXTURE_RECTANGLE 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8 +#define GL_RED_SNORM 0x8F90 +#define GL_RG_SNORM 0x8F91 +#define GL_RGB_SNORM 0x8F92 +#define GL_RGBA_SNORM 0x8F93 +#define GL_R8_SNORM 0x8F94 +#define GL_RG8_SNORM 0x8F95 +#define GL_RGB8_SNORM 0x8F96 +#define GL_RGBA8_SNORM 0x8F97 +#define GL_R16_SNORM 0x8F98 +#define GL_RG16_SNORM 0x8F99 +#define GL_RGB16_SNORM 0x8F9A +#define GL_RGBA16_SNORM 0x8F9B +#define GL_SIGNED_NORMALIZED 0x8F9C +#define GL_PRIMITIVE_RESTART 0x8F9D +#define GL_PRIMITIVE_RESTART_INDEX 0x8F9E +/* Reuse tokens from ARB_copy_buffer */ +/* reuse GL_COPY_READ_BUFFER */ +/* reuse GL_COPY_WRITE_BUFFER */ +/* Would reuse tokens from ARB_draw_instanced, but it has none */ +/* Reuse tokens from ARB_uniform_buffer_object */ +/* reuse GL_UNIFORM_BUFFER */ +/* reuse GL_UNIFORM_BUFFER_BINDING */ +/* reuse GL_UNIFORM_BUFFER_START */ +/* reuse GL_UNIFORM_BUFFER_SIZE */ +/* reuse GL_MAX_VERTEX_UNIFORM_BLOCKS */ +/* reuse GL_MAX_FRAGMENT_UNIFORM_BLOCKS */ +/* reuse GL_MAX_COMBINED_UNIFORM_BLOCKS */ +/* reuse GL_MAX_UNIFORM_BUFFER_BINDINGS */ +/* reuse GL_MAX_UNIFORM_BLOCK_SIZE */ +/* reuse GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS */ +/* reuse GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS */ +/* reuse GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT */ +/* reuse GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH */ +/* reuse GL_ACTIVE_UNIFORM_BLOCKS */ +/* reuse GL_UNIFORM_TYPE */ +/* reuse GL_UNIFORM_SIZE */ +/* reuse GL_UNIFORM_NAME_LENGTH */ +/* reuse GL_UNIFORM_BLOCK_INDEX */ +/* reuse GL_UNIFORM_OFFSET */ +/* reuse GL_UNIFORM_ARRAY_STRIDE */ +/* reuse GL_UNIFORM_MATRIX_STRIDE */ +/* reuse GL_UNIFORM_IS_ROW_MAJOR */ +/* reuse GL_UNIFORM_BLOCK_BINDING */ +/* reuse GL_UNIFORM_BLOCK_DATA_SIZE */ +/* reuse GL_UNIFORM_BLOCK_NAME_LENGTH */ +/* reuse GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS */ +/* reuse GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES */ +/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER */ +/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER */ +/* reuse GL_INVALID_INDEX */ +#endif +#ifndef GL_VERSION_3_1 +#define GL_VERSION_3_1 1 +/* OpenGL 3.1 also reuses entry points from these extensions: */ +/* ARB_copy_buffer */ +/* ARB_uniform_buffer_object */ +#ifdef GL3_PROTOTYPES +GLAPI void APIENTRY glDrawArraysInstanced (GLenum, GLint, GLsizei, GLsizei); +GLAPI void APIENTRY glDrawElementsInstanced (GLenum, GLsizei, GLenum, const GLvoid *, GLsizei); +GLAPI void APIENTRY glTexBuffer (GLenum, GLenum, GLuint); +GLAPI void APIENTRY glPrimitiveRestartIndex (GLuint); +#endif /* GL3_PROTOTYPES */ +/* No need for explicit function pointer: we force generation of ProcAddress .. */ +#endif + + +#ifndef GL_ARB_copy_buffer +#define GL_COPY_READ_BUFFER 0x8F36 +#define GL_COPY_WRITE_BUFFER 0x8F37 +#endif +#ifndef GL_ARB_copy_buffer +#define GL_ARB_copy_buffer 1 +#ifdef GL3_PROTOTYPES +GLAPI void APIENTRY glCopyBufferSubData (GLenum, GLenum, GLintptr, GLintptr, GLsizeiptr); +#endif /* GL3_PROTOTYPES */ +/* No need for explicit function pointer: we force generation of ProcAddress .. */ +#endif + + +#ifndef GL_ARB_uniform_buffer_object +#define GL_UNIFORM_BUFFER 0x8A11 +#define GL_UNIFORM_BUFFER_BINDING 0x8A28 +#define GL_UNIFORM_BUFFER_START 0x8A29 +#define GL_UNIFORM_BUFFER_SIZE 0x8A2A +#define GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B +#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS 0x8A2C +#define GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D +#define GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E +#define GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F +#define GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30 +#define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31 +#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32 +#define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33 +#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34 +#define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35 +#define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36 +#define GL_UNIFORM_TYPE 0x8A37 +#define GL_UNIFORM_SIZE 0x8A38 +#define GL_UNIFORM_NAME_LENGTH 0x8A39 +#define GL_UNIFORM_BLOCK_INDEX 0x8A3A +#define GL_UNIFORM_OFFSET 0x8A3B +#define GL_UNIFORM_ARRAY_STRIDE 0x8A3C +#define GL_UNIFORM_MATRIX_STRIDE 0x8A3D +#define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E +#define GL_UNIFORM_BLOCK_BINDING 0x8A3F +#define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40 +#define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41 +#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42 +#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46 +/** Manual: #define GL_INVALID_INDEX -1 == (int) 0xFFFFFFFFu */ +#endif +#ifndef GL_ARB_uniform_buffer_object +#define GL_ARB_uniform_buffer_object 1 +#ifdef GL3_PROTOTYPES +GLAPI void APIENTRY glGetUniformIndices (GLuint, GLsizei, const GLchar* *, GLuint *); +GLAPI void APIENTRY glGetActiveUniformsiv (GLuint, GLsizei, const GLuint *, GLenum, GLint *); +GLAPI void APIENTRY glGetActiveUniformName (GLuint, GLuint, GLsizei, GLsizei *, GLchar *); +GLAPI GLuint APIENTRY glGetUniformBlockIndex (GLuint, const GLchar *); +GLAPI void APIENTRY glGetActiveUniformBlockiv (GLuint, GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetActiveUniformBlockName (GLuint, GLuint, GLsizei, GLsizei *, GLchar *); +GLAPI void APIENTRY glUniformBlockBinding (GLuint, GLuint, GLuint); +#endif /* GL3_PROTOTYPES */ +/* No need for explicit function pointer: we force generation of ProcAddress .. */ +#endif + + #ifndef GL_VERSION_3_2 #define GL_VERSION_3_2 1 /* OpenGL 3.2 also reuses entry points from these extensions: */ @@ -284,9 +431,88 @@ GLAPI void APIENTRY glGetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLAPI void APIENTRY glTessellationFactorAMD(GLfloat factor); GLAPI void APIENTRY glTessellationModeAMD(GLenum mode); #endif -typedef void (APIENTRYP PFNGLTESSELLATIONFACTORAMDPROC) (GLfloat factor); -typedef void (APIENTRYP PFNGLTESSELLATIONMODEAMDPROC) (GLenum mode); +/* No need for explicit function pointer: we force generation of ProcAddress .. */ +#endif + +/** + * http://www.opengl.org/registry/specs/NV/shader_buffer_load.txt + */ +#ifndef GL_NV_shader_buffer_load +#define GL_BUFFER_GPU_ADDRESS_NV 0x8F1D +#define GL_GPU_ADDRESS_NV 0x8F34 +#define GL_MAX_SHADER_BUFFER_ADDRESS_NV 0x8F35 +#endif +#ifndef GL_NV_shader_buffer_load +#define GL_NV_shader_buffer_load 1 +#ifdef GL_GL3EXT_PROTOTYPE +GLAPI void APIENTRY glMakeBufferResidentNV(GLenum target, GLenum access); +GLAPI void APIENTRY glMakeBufferNonResidentNV(GLenum target); +GLAPI GLboolean APIENTRY glIsBufferResidentNV(GLenum target); +GLAPI void APIENTRY glNamedMakeBufferResidentNV(GLuint buffer, GLenum access); +GLAPI void APIENTRY glNamedMakeBufferNonResidentNV(GLuint buffer); +GLAPI GLboolean APIENTRY glIsNamedBufferResidentNV(GLuint buffer); +GLAPI void APIENTRY glGetBufferParameterui64vNV(GLenum target, GLenum pname, GLuint64 *params); +GLAPI void APIENTRY glGetNamedBufferParameterui64vNV(GLuint buffer, GLenum pname, GLuint64 *params); +GLAPI void APIENTRY glGetIntegerui64vNV(GLenum value, GLuint64 *result); +GLAPI void APIENTRY glUniformui64NV(GLint location, GLuint64 value); +GLAPI void APIENTRY glUniformui64vNV(GLint location, GLsizei count, GLuint64 *value); +GLAPI void APIENTRY glGetUniformui64vNV(GLuint program, GLint location, GLuint64 *params); +GLAPI void APIENTRY glProgramUniformui64NV(GLuint program, GLint location, GLuint64 value); +GLAPI void APIENTRY glProgramUniformui64vNV(GLuint program, GLint location, GLsizei count, GLuint64 *value); +#endif +/* No need for explicit function pointer: we force generation of ProcAddress .. */ +#endif + +/** + * http://www.opengl.org/registry/specs/NV/vertex_buffer_unified_memory.txt + */ +#ifndef GL_NV_vertex_buffer_unified_memory +#define GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV 0x8F1E +#define GL_ELEMENT_ARRAY_UNIFIED_NV 0x8F1F +#define GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV 0x8F20 +#define GL_TEXTURE_COORD_ARRAY_ADDRESS_NV 0x8F25 +#define GL_VERTEX_ARRAY_ADDRESS_NV 0x8F21 +#define GL_NORMAL_ARRAY_ADDRESS_NV 0x8F22 +#define GL_COLOR_ARRAY_ADDRESS_NV 0x8F23 +#define GL_INDEX_ARRAY_ADDRESS_NV 0x8F24 +#define GL_EDGE_FLAG_ARRAY_ADDRESS_NV 0x8F26 +#define GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV 0x8F27 +#define GL_FOG_COORD_ARRAY_ADDRESS_NV 0x8F28 +#define GL_ELEMENT_ARRAY_ADDRESS_NV 0x8F29 +#define GL_VERTEX_ATTRIB_ARRAY_LENGTH_NV 0x8F2A +#define GL_TEXTURE_COORD_ARRAY_LENGTH_NV 0x8F2F +#define GL_VERTEX_ARRAY_LENGTH_NV 0x8F2B +#define GL_NORMAL_ARRAY_LENGTH_NV 0x8F2C +#define GL_COLOR_ARRAY_LENGTH_NV 0x8F2D +#define GL_INDEX_ARRAY_LENGTH_NV 0x8F2E +#define GL_EDGE_FLAG_ARRAY_LENGTH_NV 0x8F30 +#define GL_SECONDARY_COLOR_ARRAY_LENGTH_NV 0x8F31 +#define GL_FOG_COORD_ARRAY_LENGTH_NV 0x8F32 +#define GL_ELEMENT_ARRAY_LENGTH_NV 0x8F33 +#endif +#ifndef GL_NV_vertex_buffer_unified_memory +#define GL_NV_vertex_buffer_unified_memory 1 +#ifdef GL_GL3EXT_PROTOTYPES +GLAPI GLboolean APIENTRY glIsEnabled( GLenum cap ); +GLAPI void APIENTRY glEnableClientState( GLenum cap ); +GLAPI void APIENTRY glDisableClientState( GLenum cap ); +GLAPI void APIENTRY glBufferAddressRangeNV(GLenum pname, GLuint index, GLuint64 address, GLsizeiptr length); +GLAPI void APIENTRY glVertexFormatNV(GLint size, GLenum type, GLsizei stride); +GLAPI void APIENTRY glNormalFormatNV(GLenum type, GLsizei stride); +GLAPI void APIENTRY glColorFormatNV(GLint size, GLenum type, GLsizei stride); +GLAPI void APIENTRY glIndexFormatNV(GLenum type, GLsizei stride); +GLAPI void APIENTRY glTexCoordFormatNV(GLint size, GLenum type, GLsizei stride); +GLAPI void APIENTRY glEdgeFlagFormatNV(GLsizei stride); +GLAPI void APIENTRY glSecondaryColorFormatNV(GLint size, GLenum type, GLsizei stride); +GLAPI void APIENTRY glFogCoordFormatNV(GLenum type, GLsizei stride); +GLAPI void APIENTRY glVertexAttribFormatNV(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride); +GLAPI void APIENTRY glVertexAttribIFormatNV(GLuint index, GLint size, GLenum type, GLsizei stride); +GLAPI void APIENTRY glGetIntegerui64i_vNV(GLenum value, GLuint index, GLuint64 result[]); #endif +/* No need for explicit function pointer: we force generation of ProcAddress .. */ +#endif + + #ifndef GL_APPLE_float_pixels #define GL_HALF_APPLE 0x140B 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 418336e3f..497e9f03b 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 @@ -202,8 +202,18 @@ public class WindowsWGLContext extends GLContextImpl { // if no 3.2 is available creation fails already! attribs[0+1] = 3; attribs[2+1] = 2; - attribs[6+0] = WGLExt.WGL_CONTEXT_PROFILE_MASK_ARB; - attribs[6+1] = WGLExt.WGL_CONTEXT_CORE_PROFILE_BIT_ARB; + if(glCaps.getGLProfile().isGL3bc()) { + attribs[6+0] = WGLExt.WGL_CONTEXT_PROFILE_MASK_ARB; + attribs[6+1] = WGLExt.WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB; + } + /** + * don't stricten requirements any further, even compatible would be fine + * + } else { + attribs[6+0] = WGLExt.WGL_CONTEXT_PROFILE_MASK_ARB; + attribs[6+1] = WGLExt.WGL_CONTEXT_CORE_PROFILE_BIT_ARB; + } + */ hglrc = wglExt.wglCreateContextAttribsARB(drawable.getNativeWindow().getSurfaceHandle(), hglrc2, attribs, 0); if(0==hglrc) { if(DEBUG) { @@ -212,7 +222,9 @@ public class WindowsWGLContext extends GLContextImpl { // Try >= 3.1 forward compatible - last resort for GL3 ! attribs[0+1] = 3; attribs[2+1] = 1; - attribs[4+1] |= WGLExt.WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB; + if(!glCaps.getGLProfile().isGL3bc()) { + attribs[4+1] |= WGLExt.WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB; + } attribs[6+0] = 0; attribs[6+1] = 0; } else if(DEBUG) { 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 84f32d43e..330d0a473 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 @@ -205,8 +205,18 @@ public abstract class X11GLXContext extends GLContextImpl { // and verify with a None drawable binding (default framebuffer) attribs[0+1] = 3; attribs[2+1] = 2; - // FIXME NV Bug: attribs[8+0] = GLX.GLX_CONTEXT_PROFILE_MASK_ARB; - // FIXME NV Bug: attribs[8+1] = GLX.GLX_CONTEXT_CORE_PROFILE_BIT_ARB; + if(glCaps.getGLProfile().isGL3bc()) { + attribs[8+0] = GLX.GLX_CONTEXT_PROFILE_MASK_ARB; + attribs[8+1] = GLX.GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB; + } + /** + * don't stricten requirements any further, even compatible would be fine + * + } else { + attribs[8+0] = GLX.GLX_CONTEXT_PROFILE_MASK_ARB; + attribs[8+1] = GLX.GLX_CONTEXT_CORE_PROFILE_BIT_ARB; + } + */ context = glXExt.glXCreateContextAttribsARB(display, config.getFBConfig(), share, direct, attribs, 0); if(0!=context) { @@ -232,7 +242,9 @@ public abstract class X11GLXContext extends GLContextImpl { // Try >= 3.1 forward compatible - last resort for GL3 ! attribs[0+1] = 3; attribs[2+1] = 1; - attribs[6+1] |= GLX.GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB; + if(!glCaps.getGLProfile().isGL3bc()) { + attribs[6+1] |= GLX.GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB; + } attribs[8+0] = 0; attribs[8+1] = 0; } diff --git a/src/jogl/classes/javax/media/opengl/GLBase.java b/src/jogl/classes/javax/media/opengl/GLBase.java index 92498077b..be5a6dc4f 100644 --- a/src/jogl/classes/javax/media/opengl/GLBase.java +++ b/src/jogl/classes/javax/media/opengl/GLBase.java @@ -64,9 +64,16 @@ public interface GLBase { public boolean isGL(); /** - * Indicates whether this GL object conforms to the GL3 profile. - * The GL3 profile reflects OpenGL versions greater or equal 3.1 - * @return whether this GL object conforms to the GL3 profile + * Indicates whether this GL object conforms to the GL3 compatibility profile. + * The GL3 compatibility profile merges the GL2 profile and GL3 core profile. + * @return whether this GL object conforms to the GL3 compatibility profile + */ + public boolean isGL3bc(); + + /** + * Indicates whether this GL object conforms to the GL3 core profile. + * The GL3 core profile reflects OpenGL versions greater or equal 3.1 + * @return whether this GL object conforms to the GL3 core profile */ public boolean isGL3(); @@ -124,6 +131,13 @@ public interface GLBase { public GL getGL() throws GLException; /** + * Casts this object to the GL3bc interface. + * @return this object cast to the GL3bc interface + * @throws GLException if this GLObject is not a GL3bc implementation + */ + public GL3bc getGL3bc() throws GLException; + + /** * Casts this object to the GL3 interface. * @return this object cast to the GL3 interface * @throws GLException if this GLObject is not a GL3 implementation diff --git a/src/jogl/classes/javax/media/opengl/GLProfile.java b/src/jogl/classes/javax/media/opengl/GLProfile.java index a63136944..69cdd3f24 100644 --- a/src/jogl/classes/javax/media/opengl/GLProfile.java +++ b/src/jogl/classes/javax/media/opengl/GLProfile.java @@ -60,7 +60,11 @@ public class GLProfile implements Cloneable { // Public (user-visible) profiles // - /** The desktop OpenGL profile 3.x, with x >= 1 */ + /** The desktop OpenGL compatibility profile 3.x, with x >= 1, ie GL2 plus GL3.<br> + <code>bc</code> stands for backward compatibility. */ + public static final String GL3bc = "GL3bc"; + + /** The desktop OpenGL core profile 3.x, with x >= 1 */ public static final String GL3 = "GL3"; /** The desktop OpenGL profile 1.x up to 3.0 */ @@ -84,12 +88,12 @@ public class GLProfile implements Cloneable { /** * 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, GL2GL3, GL3 }; + public static final String[] GL_PROFILE_LIST_ALL = new String[] { GL2, GL2ES2, GL2ES1, GLES2, GLES1, GL2GL3, GL3bc, GL3 }; /** * All GL2ES2 Profiles in the order of default detection: GL2ES2, GL2, GLES2, GL3 */ - public static final String[] GL_PROFILE_LIST_GL2ES2 = new String[] { GL2ES2, GL2, GLES2, GL3 }; + public static final String[] GL_PROFILE_LIST_GL2ES2 = new String[] { GL2ES2, GL2, GLES2, GL3bc, GL3 }; /** * All GL2ES1 Profiles in the order of default detection: GL2ES1, GL2, GLES1 @@ -187,7 +191,9 @@ public class GLProfile implements Cloneable { } private static final String getGLImplBaseClassName(String profileImpl) { - if(GL3.equals(profileImpl)) { + if(GL3bc.equals(profileImpl)) { + return "com.sun.opengl.impl.gl3.GL3bc"; + } else if(GL3.equals(profileImpl)) { return "com.sun.opengl.impl.gl3.GL3"; } else if(GL2.equals(profileImpl)) { return "com.sun.opengl.impl.gl2.GL2"; @@ -246,9 +252,14 @@ public class GLProfile implements Cloneable { return profileImpl; } + /** Indicates whether this profile is capable of GL3bc. */ + public final boolean isGL3bc() { + return GL3bc.equals(profile); + } + /** Indicates whether this profile is capable of GL3. */ public final boolean isGL3() { - return GL3.equals(profile); + return isGL3bc() || GL3.equals(profile); } /** Indicates whether this profile is capable of GL2. */ @@ -301,9 +312,14 @@ public class GLProfile implements Cloneable { return GL2.equals(profileImpl) || GL2ES12.equals(profileImpl) ; } + /** Indicates whether this profile uses the native desktop OpenGL GL3bc implementations. */ + public final boolean usesNativeGL3bc() { + return GL3bc.equals(profileImpl); + } + /** Indicates whether this profile uses the native desktop OpenGL GL3 implementations. */ public final boolean usesNativeGL3() { - return GL3.equals(profileImpl); + return usesNativeGL3bc() || GL3.equals(profileImpl); } /** Indicates whether this profile uses the native desktop OpenGL GL2 or GL3 implementations. */ @@ -623,6 +639,7 @@ public class GLProfile implements Cloneable { private static final boolean isAWTAvailable; private static final boolean isAWTJOGLAvailable; + private static final boolean hasGL3bcImpl; private static final boolean hasGL3Impl; private static final boolean hasGL2Impl; private static final boolean hasGL2ES12Impl; @@ -698,6 +715,7 @@ public class GLProfile implements Cloneable { } // FIXME: check for real GL3 availability .. ? + hasGL3bcImpl = hasDesktopGL && NWReflection.isClassAvailable("com.sun.opengl.impl.gl3.GL3bcImpl"); hasGL3Impl = hasDesktopGL && NWReflection.isClassAvailable("com.sun.opengl.impl.gl3.GL3Impl"); hasGL2Impl = hasDesktopGL && NWReflection.isClassAvailable("com.sun.opengl.impl.gl2.GL2Impl"); @@ -743,6 +761,7 @@ public class GLProfile implements Cloneable { System.err.println("GLProfile.static hasNativeOSFactory "+hasNativeOSFactory); System.err.println("GLProfile.static hasDesktopGLES12 "+hasDesktopGLES12); System.err.println("GLProfile.static hasDesktopGL "+hasDesktopGL); + System.err.println("GLProfile.static hasGL3bcImpl "+hasGL3bcImpl); System.err.println("GLProfile.static hasGL3Impl "+hasGL3Impl); System.err.println("GLProfile.static hasGL2Impl "+hasGL2Impl); System.err.println("GLProfile.static hasGL2ES12Impl "+hasGL2ES12Impl); @@ -811,11 +830,19 @@ public class GLProfile implements Cloneable { return GL2; } else if(hasGL3Impl) { return GL3; + } else if(hasGL3bcImpl) { + return GL3bc; } else if(hasGLES2Impl) { return GLES2; } - } else if(GL3.equals(profile) && hasGL3Impl) { - return GL3; + } else if(GL3bc.equals(profile) && hasGL3bcImpl) { + return GL3bc; + } else if(GL3.equals(profile)) { + if(hasGL3Impl) { + return GL3; + } else if(hasGL3bcImpl) { + return GL3bc; + } } else if(GL2.equals(profile) && hasGL2Impl) { return GL2; } else if(GL2GL3.equals(profile) && hasGL2Impl) { |