From cccddaeb39ad19a4e8c77fdff1d4950f48e32e8e Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Wed, 20 May 2009 21:47:58 +0000 Subject: Recently code (UnifiedName, GLUnifiedName) was added to GlueGen to automatically detect duplicate constant and function definitions between vendor and ARB extensions and the OpenGL core, and to remove the suffixes of ARB extensions. This code has helped automate the process of discovering extensions that were promoted into the OpenGL core. While this code has saved some manual effort, it has also caused several problems: 1. It causes obsolete ARB extensions to be incorrectly moved into the core OpenGL namespace. GL_ARB_texture_rectangle, GL_ARB_vertex_blend, and GL_ARB_matrix_palette are examples of extensions that should not have their ARB suffixes removed because they are dead-end extensions. Definitions which are explicitly specified that they will change, such as those in the EGL_KHR_sync extension, were also incorrectly moved into the core namespace. 2. It has caused certain OpenGL ES-specific definitions to accidentally be promoted into the core OpenGL namespace: for example, the constants associated with the GL_OES_point_size_array extension, which were incorrectly placed into the GL2ES1 interface. 3. It causes namespace collisions between certain ARB extensions that are only accessible via their ARB entry points and core OpenGL routines: specifically GL_ARB_vertex_program and GL_ARB_fragment program. Based on tests on NVIDIA's drivers, when a developer wants to use the earlier ARB_vertex_program and ARB_fragment_program semantics rather than GLSL, it is mandatory to use the ARB entry points rather than the core OpenGL entry points. 4. It is not easy to configure the behavior of this automatic merging, nor easy to see how it would be extended to be configurable. 5. It does not address the problem of detecting which extensions are common between desktop OpenGL and OpenGL ES. A different algorithm would be needed to solve that problem. 6. It has a high degree of functional overlap to the IgnoreExtension directive which has previously been used to ignore ARB extensions that were promoted into the OpenGL core. There were already IgnoreExtension directives in place for all of the OpenGL extensions subsumed in OpenGL 1.1 through 1.3. 7. It has been the cause of several bugs and unexpected interactions with the Ignore and ForceProcAddressGen directives. After careful consideration, it appears that the problems with this code outweigh the benefits and it has been removed. The run-time code which attempts to find extension variants of core entry points has been retained, however. To reduce the amount of subsequent manual work, the following additions have been made: 1. A generic SymbolFilter mechanism has been added to GlueGen, which can be used to pre-process the entire set of constant and function definitions at any time during glue code generation (although it is recommended to do so at the beginning of processing, i.e., in GlueEmitter.beginEmission()). 2. The RenameJavaMethod directive has been generalized to RenameJavaSymbol, and can now work on constant definitions. 3. A ConstantDefinition class has been added. 4. A RenameExtensionIntoCore directive has been added to the GLEmitter which will rename all constant definitions and entry points associated with a particular OpenGL extension into the core namespace, i.e., stripping off any ARB or similar suffixes. 5. An AutoUnifyExtensions directive has been added which is disabled by default but which will automatically ignore any OpenGL extension which has been completely subsumed into the OpenGL core and, if not, print out the first declaration in that extension which caused it to fail to be ignored. The extensions common between OpenGL ES and desktop OpenGL have now largely been moved into the core namespace using the RenameExtensionIntoCore directive. A couple of these extensions had slight differences between desktop OpenGL and OpenGL ES; the common declarations were renamed manually. IgnoreExtension directives have been added for those ARB extensions promoted into the OpenGL core up to OpenGL 2.1. A few extensions which were either silently promoted into the core specification (GL_EXT_paletted_texture) or are obsolete (GL_EXT_multisample, GL_EXT_point_parameters) were also ignored. The GlueGen runtime code which looks up extension versions of core APIs via GLExtensionNames makes this possible without breaking compatibility on older machines that do not support OpenGL 2.1 directly. With these changes, the same effect as the automatic extension unification mechanism has been achieved, with much more explainable and controllable results. Before-and-after versions of all of the public interfaces (GL, GL2ES1, GL2ES2, GLES1, GLES2, and GL2) have been compared by hand to ensure that the results are as expected and desired. Bugs in BuildStaticGLInfo were fixed which were preventing the extension associations in the OpenGL ES headers from being discovered. getExtensions() was added to be able to enumerate the discovered extensions. Most .cfg files were changed to parse both the desktop OpenGL and the OpenGL ES headers using the GLHeaders directive so that the extension associations are known for both sets of APIs. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JOGL_2_SANDBOX@1908 232f8b59-042b-4e1e-8c03-345bb8c30851 --- .../impl/macosx/cgl/MacOSXPbufferCGLContext.java | 2 +- .../impl/macosx/cgl/MacOSXPbufferCGLDrawable.java | 2 +- .../impl/windows/wgl/WindowsPbufferWGLContext.java | 6 +- .../windows/wgl/WindowsPbufferWGLDrawable.java | 96 ++++++------- .../impl/windows/wgl/WindowsWGLDrawable.java | 148 ++++++++++----------- .../com/sun/opengl/util/texture/Texture.java | 16 +-- src/jogl/classes/com/sun/openmax/OMXInstance.java | 12 +- 7 files changed, 141 insertions(+), 141 deletions(-) (limited to 'src/jogl/classes') diff --git a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLContext.java b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLContext.java index b128cfcbe..cdcd66d10 100644 --- a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLContext.java +++ b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLContext.java @@ -88,7 +88,7 @@ public class MacOSXPbufferCGLContext extends MacOSXCGLContext { rect = false; } } - textureTarget = (rect ? GL2.GL_TEXTURE_RECTANGLE: GL.GL_TEXTURE_2D); + textureTarget = (rect ? GL2.GL_TEXTURE_RECTANGLE_EXT: GL.GL_TEXTURE_2D); int[] tmp = new int[1]; gl.glGenTextures(1, tmp, 0); texture = tmp[0]; diff --git a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLDrawable.java b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLDrawable.java index 68122480f..5c41ddbd4 100644 --- a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLDrawable.java +++ b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLDrawable.java @@ -91,7 +91,7 @@ public class MacOSXPbufferCGLDrawable extends MacOSXCGLDrawable { int renderTarget; GLCapabilities capabilities = getRequestedGLCapabilities(); if (GLProfile.isGL2() && capabilities.getPbufferRenderToTextureRectangle()) { - renderTarget = GL2.GL_TEXTURE_RECTANGLE; + renderTarget = GL2.GL_TEXTURE_RECTANGLE_EXT; } else { int w = getNextPowerOf2(getWidth()); int h = getNextPowerOf2(getHeight()); diff --git a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLContext.java b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLContext.java index ac3a5d5c8..5c7e7dc64 100644 --- a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLContext.java +++ b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLContext.java @@ -68,7 +68,7 @@ public class WindowsPbufferWGLContext extends WindowsWGLContext { WGLExt wglExt = getWGLExt(); gl.glBindTexture(textureTarget, texture); if (rtt && hasRTT) { - if (!wglExt.wglBindTexImage(drawable.getPbuffer(), WGLExt.WGL_FRONT_LEFT)) { + if (!wglExt.wglBindTexImageARB(drawable.getPbuffer(), WGLExt.WGL_FRONT_LEFT_ARB)) { throw new GLException("Binding of pbuffer to texture failed: " + wglGetLastError()); } } @@ -84,7 +84,7 @@ public class WindowsPbufferWGLContext extends WindowsWGLContext { } if (rtt && hasRTT) { WGLExt wglExt = getWGLExt(); - if (!wglExt.wglReleaseTexImage(drawable.getPbuffer(), WGLExt.WGL_FRONT_LEFT)) { + if (!wglExt.wglReleaseTexImageARB(drawable.getPbuffer(), WGLExt.WGL_FRONT_LEFT_ARB)) { throw new GLException("Releasing of pbuffer from texture failed: " + wglGetLastError()); } } @@ -123,7 +123,7 @@ public class WindowsPbufferWGLContext extends WindowsWGLContext { if (DEBUG) { System.err.println(" Using render-to-texture-rectangle"); } - textureTarget = GL2.GL_TEXTURE_RECTANGLE; + textureTarget = GL2.GL_TEXTURE_RECTANGLE_ARB; } else { if (DEBUG) { System.err.println(" Using vanilla render-to-texture"); diff --git a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLDrawable.java b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLDrawable.java index 7eab58265..eccc21a15 100644 --- a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLDrawable.java +++ b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLDrawable.java @@ -87,11 +87,11 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable { // not be called here, so we skip the use of any composable // pipelines (see WindowsOnscreenWGLContext.makeCurrentImpl) WGLExt wglExt = cachedWGLExt; - if (wglExt.wglReleasePbufferDC(buffer, nw.getSurfaceHandle()) == 0) { + if (wglExt.wglReleasePbufferDCARB(buffer, nw.getSurfaceHandle()) == 0) { throw new GLException("Error releasing pbuffer device context: error code " + WGL.GetLastError()); } nw.setSurfaceHandle(0); - if (!wglExt.wglDestroyPbuffer(buffer)) { + if (!wglExt.wglDestroyPbufferARB(buffer)) { throw new GLException("Error destroying pbuffer: error code " + WGL.GetLastError()); } buffer = 0; @@ -167,12 +167,12 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable { int[] pformats = new int[MAX_PFORMATS]; int nformats; int[] nformatsTmp = new int[1]; - if (!wglExt.wglChoosePixelFormat(parentHdc, - iattributes, 0, - fattributes, 0, - MAX_PFORMATS, - pformats, 0, - nformatsTmp, 0)) { + if (!wglExt.wglChoosePixelFormatARB(parentHdc, + iattributes, 0, + fattributes, 0, + MAX_PFORMATS, + pformats, 0, + nformatsTmp, 0)) { throw new GLException("pbuffer creation error: wglChoosePixelFormat() failed"); } nformats = nformatsTmp[0]; @@ -185,18 +185,18 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable { if (DEBUG) { System.err.println("" + nformats + " suitable pixel formats found"); // query pixel format - iattributes[0] = WGLExt.WGL_RED_BITS; - iattributes[1] = WGLExt.WGL_GREEN_BITS; - iattributes[2] = WGLExt.WGL_BLUE_BITS; - iattributes[3] = WGLExt.WGL_ALPHA_BITS; - iattributes[4] = WGLExt.WGL_DEPTH_BITS; - iattributes[5] = (useFloat ? (ati ? WGLExt.WGL_PIXEL_TYPE: WGLExt.WGL_FLOAT_COMPONENTS_NV) : WGLExt.WGL_RED_BITS); - iattributes[6] = (haveMultisample ? WGLExt.WGL_SAMPLE_BUFFERS: WGLExt.WGL_RED_BITS); - iattributes[7] = (haveMultisample ? WGLExt.WGL_SAMPLES: WGLExt.WGL_RED_BITS); - iattributes[8] = WGLExt.WGL_DRAW_TO_PBUFFER; + iattributes[0] = WGLExt.WGL_RED_BITS_ARB; + iattributes[1] = WGLExt.WGL_GREEN_BITS_ARB; + iattributes[2] = WGLExt.WGL_BLUE_BITS_ARB; + iattributes[3] = WGLExt.WGL_ALPHA_BITS_ARB; + iattributes[4] = WGLExt.WGL_DEPTH_BITS_ARB; + iattributes[5] = (useFloat ? (ati ? WGLExt.WGL_PIXEL_TYPE_ARB : WGLExt.WGL_FLOAT_COMPONENTS_NV) : WGLExt.WGL_RED_BITS_ARB); + iattributes[6] = (haveMultisample ? WGLExt.WGL_SAMPLE_BUFFERS_ARB : WGLExt.WGL_RED_BITS_ARB); + iattributes[7] = (haveMultisample ? WGLExt.WGL_SAMPLES_ARB : WGLExt.WGL_RED_BITS_ARB); + iattributes[8] = WGLExt.WGL_DRAW_TO_PBUFFER_ARB; int[] ivalues = new int[9]; for (int i = 0; i < nformats; i++) { - if (!wglExt.wglGetPixelFormatAttribiv(parentHdc, pformats[i], 0, 9, iattributes, 0, ivalues, 0)) { + if (!wglExt.wglGetPixelFormatAttribivARB(parentHdc, pformats[i], 0, 9, iattributes, 0, ivalues, 0)) { throw new GLException("Error while querying pixel format " + pformats[i] + "'s (index " + i + "'s) capabilities for debugging"); } @@ -212,9 +212,9 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable { System.err.print(" samples: " + ivalues[7]); if (useFloat) { if (ati) { - if (ivalues[5] == WGLExt.WGL_TYPE_RGBA_FLOAT) { + if (ivalues[5] == WGLExt.WGL_TYPE_RGBA_FLOAT_ARB) { System.err.print(" [ati float]"); - } else if (ivalues[5] != WGLExt.WGL_TYPE_RGBA) { + } else if (ivalues[5] != WGLExt.WGL_TYPE_RGBA_ARB) { System.err.print(" [unknown pixel type " + ivalues[5] + "]"); } } else { @@ -241,26 +241,26 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable { niattribs = 0; if (rtt) { - iattributes[niattribs++] = WGLExt.WGL_TEXTURE_FORMAT; + iattributes[niattribs++] = WGLExt.WGL_TEXTURE_FORMAT_ARB; if (useFloat) { iattributes[niattribs++] = WGLExt.WGL_TEXTURE_FLOAT_RGB_NV; } else { - iattributes[niattribs++] = WGLExt.WGL_TEXTURE_RGBA; + iattributes[niattribs++] = WGLExt.WGL_TEXTURE_RGBA_ARB; } - iattributes[niattribs++] = WGLExt.WGL_TEXTURE_TARGET; - iattributes[niattribs++] = rect ? WGLExt.WGL_TEXTURE_RECTANGLE_NV : WGLExt.WGL_TEXTURE_2D; + iattributes[niattribs++] = WGLExt.WGL_TEXTURE_TARGET_ARB; + iattributes[niattribs++] = rect ? WGLExt.WGL_TEXTURE_RECTANGLE_NV : WGLExt.WGL_TEXTURE_2D_ARB; - iattributes[niattribs++] = WGLExt.WGL_MIPMAP_TEXTURE; + iattributes[niattribs++] = WGLExt.WGL_MIPMAP_TEXTURE_ARB; iattributes[niattribs++] = GL.GL_FALSE; - iattributes[niattribs++] = WGLExt.WGL_PBUFFER_LARGEST; + iattributes[niattribs++] = WGLExt.WGL_PBUFFER_LARGEST_ARB; iattributes[niattribs++] = GL.GL_FALSE; } iattributes[niattribs++] = 0; - tmpBuffer = wglExt.wglCreatePbuffer(parentHdc, format, getWidth(), getHeight(), iattributes, 0); + tmpBuffer = wglExt.wglCreatePbufferARB(parentHdc, format, getWidth(), getHeight(), iattributes, 0); if (tmpBuffer != 0) { // Done break; @@ -273,7 +273,7 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable { } // Get the device context. - long tmpHdc = wglExt.wglGetPbufferDC(tmpBuffer); + long tmpHdc = wglExt.wglGetPbufferDCARB(tmpBuffer); if (tmpHdc == 0) { throw new GLException("pbuffer creation error: wglGetPbufferDC() failed"); } @@ -288,35 +288,35 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable { // Re-query chosen pixel format { niattribs = 0; - iattributes[niattribs++] = WGLExt.WGL_ACCELERATION; - iattributes[niattribs++] = WGLExt.WGL_RED_BITS; - iattributes[niattribs++] = WGLExt.WGL_GREEN_BITS; - iattributes[niattribs++] = WGLExt.WGL_BLUE_BITS; - iattributes[niattribs++] = WGLExt.WGL_ALPHA_BITS; - iattributes[niattribs++] = WGLExt.WGL_DEPTH_BITS; - iattributes[niattribs++] = WGLExt.WGL_STENCIL_BITS; - iattributes[niattribs++] = WGLExt.WGL_DOUBLE_BUFFER; - iattributes[niattribs++] = WGLExt.WGL_STEREO; - iattributes[niattribs++] = WGLExt.WGL_ACCUM_RED_BITS; - iattributes[niattribs++] = WGLExt.WGL_ACCUM_GREEN_BITS; - iattributes[niattribs++] = WGLExt.WGL_ACCUM_BLUE_BITS; - iattributes[niattribs++] = WGLExt.WGL_ACCUM_ALPHA_BITS; - iattributes[niattribs++] = (useFloat ? (ati ? WGLExt.WGL_PIXEL_TYPE: WGLExt.WGL_FLOAT_COMPONENTS_NV) : WGLExt.WGL_RED_BITS); - iattributes[niattribs++] = (haveMultisample ? WGLExt.WGL_SAMPLE_BUFFERS: WGLExt.WGL_RED_BITS); - iattributes[niattribs++] = (haveMultisample ? WGLExt.WGL_SAMPLES: WGLExt.WGL_RED_BITS); - iattributes[niattribs++] = WGLExt.WGL_DRAW_TO_PBUFFER; + iattributes[niattribs++] = WGLExt.WGL_ACCELERATION_ARB; + iattributes[niattribs++] = WGLExt.WGL_RED_BITS_ARB; + iattributes[niattribs++] = WGLExt.WGL_GREEN_BITS_ARB; + iattributes[niattribs++] = WGLExt.WGL_BLUE_BITS_ARB; + iattributes[niattribs++] = WGLExt.WGL_ALPHA_BITS_ARB; + iattributes[niattribs++] = WGLExt.WGL_DEPTH_BITS_ARB; + iattributes[niattribs++] = WGLExt.WGL_STENCIL_BITS_ARB; + iattributes[niattribs++] = WGLExt.WGL_DOUBLE_BUFFER_ARB; + iattributes[niattribs++] = WGLExt.WGL_STEREO_ARB; + iattributes[niattribs++] = WGLExt.WGL_ACCUM_RED_BITS_ARB; + iattributes[niattribs++] = WGLExt.WGL_ACCUM_GREEN_BITS_ARB; + iattributes[niattribs++] = WGLExt.WGL_ACCUM_BLUE_BITS_ARB; + iattributes[niattribs++] = WGLExt.WGL_ACCUM_ALPHA_BITS_ARB; + iattributes[niattribs++] = (useFloat ? (ati ? WGLExt.WGL_PIXEL_TYPE_ARB : WGLExt.WGL_FLOAT_COMPONENTS_NV) : WGLExt.WGL_RED_BITS_ARB); + iattributes[niattribs++] = (haveMultisample ? WGLExt.WGL_SAMPLE_BUFFERS_ARB : WGLExt.WGL_RED_BITS_ARB); + iattributes[niattribs++] = (haveMultisample ? WGLExt.WGL_SAMPLES_ARB : WGLExt.WGL_RED_BITS_ARB); + iattributes[niattribs++] = WGLExt.WGL_DRAW_TO_PBUFFER_ARB; int[] ivalues = new int[niattribs]; // FIXME: usually prefer to throw exceptions, but failure here is not critical - if (wglExt.wglGetPixelFormatAttribiv(parentHdc, pformats[whichFormat], 0, niattribs, iattributes, 0, ivalues, 0)) { + if (wglExt.wglGetPixelFormatAttribivARB(parentHdc, pformats[whichFormat], 0, niattribs, iattributes, 0, ivalues, 0)) { setChosenGLCapabilities(iattributes2GLCapabilities(iattributes, niattribs, ivalues, false)); } } // Determine the actual width and height we were able to create. int[] tmp = new int[1]; - wglExt.wglQueryPbuffer( buffer, WGLExt.WGL_PBUFFER_WIDTH, tmp, 0 ); + wglExt.wglQueryPbufferARB( buffer, WGLExt.WGL_PBUFFER_WIDTH_ARB, tmp, 0 ); width = tmp[0]; - wglExt.wglQueryPbuffer( buffer, WGLExt.WGL_PBUFFER_HEIGHT, tmp, 0 ); + wglExt.wglQueryPbufferARB( buffer, WGLExt.WGL_PBUFFER_HEIGHT_ARB, tmp, 0 ); height = tmp[0]; nw.setSize(width, height); diff --git a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawable.java b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawable.java index 1885de1db..fd2e158a9 100644 --- a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawable.java +++ b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawable.java @@ -163,12 +163,12 @@ public abstract class WindowsWGLDrawable extends GLDrawableImpl { null)) { int[] pformats = new int[MAX_PFORMATS]; int[] numFormatsTmp = new int[1]; - if (dummyWGLExt.wglChoosePixelFormat(hdc, - iattributes, 0, - fattributes, 0, - MAX_PFORMATS, - pformats, 0, - numFormatsTmp, 0)) { + if (dummyWGLExt.wglChoosePixelFormatARB(hdc, + iattributes, 0, + fattributes, 0, + MAX_PFORMATS, + pformats, 0, + numFormatsTmp, 0)) { numFormats = numFormatsTmp[0]; if (numFormats > 0) { // Remove one-basing of pixel format (added on later) @@ -203,8 +203,8 @@ public abstract class WindowsWGLDrawable extends GLDrawableImpl { // meaningless, and put in whether it can render to a // window, to a pbuffer, or to a pixmap) int niattribs = 0; - iattributes[0] = WGLExt.WGL_NUMBER_PIXEL_FORMATS; - if (dummyWGLExt.wglGetPixelFormatAttribiv(hdc, 0, 0, 1, iattributes, 0, iresults, 0)) { + iattributes[0] = WGLExt.WGL_NUMBER_PIXEL_FORMATS_ARB; + if (dummyWGLExt.wglGetPixelFormatAttribivARB(hdc, 0, 0, 1, iattributes, 0, iresults, 0)) { numFormats = iresults[0]; if (DEBUG) { @@ -215,30 +215,30 @@ public abstract class WindowsWGLDrawable extends GLDrawableImpl { // applicable, as we are doing here? // We don't have enough information in the GLCapabilities to // represent those that aren't... - iattributes[niattribs++] = WGLExt.WGL_DRAW_TO_WINDOW; - iattributes[niattribs++] = WGLExt.WGL_ACCELERATION; - iattributes[niattribs++] = WGLExt.WGL_SUPPORT_OPENGL; - iattributes[niattribs++] = WGLExt.WGL_DEPTH_BITS; - iattributes[niattribs++] = WGLExt.WGL_STENCIL_BITS; - iattributes[niattribs++] = WGLExt.WGL_DOUBLE_BUFFER; - iattributes[niattribs++] = WGLExt.WGL_STEREO; - iattributes[niattribs++] = WGLExt.WGL_PIXEL_TYPE; - iattributes[niattribs++] = WGLExt.WGL_RED_BITS; - iattributes[niattribs++] = WGLExt.WGL_GREEN_BITS; - iattributes[niattribs++] = WGLExt.WGL_BLUE_BITS; - iattributes[niattribs++] = WGLExt.WGL_ALPHA_BITS; - iattributes[niattribs++] = WGLExt.WGL_ACCUM_RED_BITS; - iattributes[niattribs++] = WGLExt.WGL_ACCUM_GREEN_BITS; - iattributes[niattribs++] = WGLExt.WGL_ACCUM_BLUE_BITS; - iattributes[niattribs++] = WGLExt.WGL_ACCUM_ALPHA_BITS; + iattributes[niattribs++] = WGLExt.WGL_DRAW_TO_WINDOW_ARB; + iattributes[niattribs++] = WGLExt.WGL_ACCELERATION_ARB; + iattributes[niattribs++] = WGLExt.WGL_SUPPORT_OPENGL_ARB; + iattributes[niattribs++] = WGLExt.WGL_DEPTH_BITS_ARB; + iattributes[niattribs++] = WGLExt.WGL_STENCIL_BITS_ARB; + iattributes[niattribs++] = WGLExt.WGL_DOUBLE_BUFFER_ARB; + iattributes[niattribs++] = WGLExt.WGL_STEREO_ARB; + iattributes[niattribs++] = WGLExt.WGL_PIXEL_TYPE_ARB; + iattributes[niattribs++] = WGLExt.WGL_RED_BITS_ARB; + iattributes[niattribs++] = WGLExt.WGL_GREEN_BITS_ARB; + iattributes[niattribs++] = WGLExt.WGL_BLUE_BITS_ARB; + iattributes[niattribs++] = WGLExt.WGL_ALPHA_BITS_ARB; + iattributes[niattribs++] = WGLExt.WGL_ACCUM_RED_BITS_ARB; + iattributes[niattribs++] = WGLExt.WGL_ACCUM_GREEN_BITS_ARB; + iattributes[niattribs++] = WGLExt.WGL_ACCUM_BLUE_BITS_ARB; + iattributes[niattribs++] = WGLExt.WGL_ACCUM_ALPHA_BITS_ARB; if (haveWGLARBMultisample) { - iattributes[niattribs++] = WGLExt.WGL_SAMPLE_BUFFERS; - iattributes[niattribs++] = WGLExt.WGL_SAMPLES; + iattributes[niattribs++] = WGLExt.WGL_SAMPLE_BUFFERS_ARB; + iattributes[niattribs++] = WGLExt.WGL_SAMPLES_ARB; } availableCaps = new GLCapabilities[numFormats]; for (int i = 0; i < numFormats; i++) { - if (!dummyWGLExt.wglGetPixelFormatAttribiv(hdc, i+1, 0, niattribs, iattributes, 0, iresults, 0)) { + if (!dummyWGLExt.wglGetPixelFormatAttribivARB(hdc, i+1, 0, niattribs, iattributes, 0, iresults, 0)) { throw new GLException("Error getting pixel format attributes for pixel format " + (i + 1) + " of device context"); } availableCaps[i] = iattributes2GLCapabilities(iattributes, niattribs, iresults, true); @@ -425,66 +425,66 @@ public abstract class WindowsWGLDrawable extends GLDrawableImpl { int niattribs = 0; - iattributes[niattribs++] = WGLExt.WGL_SUPPORT_OPENGL; + iattributes[niattribs++] = WGLExt.WGL_SUPPORT_OPENGL_ARB; iattributes[niattribs++] = GL.GL_TRUE; if (pbuffer) { - iattributes[niattribs++] = WGLExt.WGL_DRAW_TO_PBUFFER; + iattributes[niattribs++] = WGLExt.WGL_DRAW_TO_PBUFFER_ARB; iattributes[niattribs++] = GL.GL_TRUE; } else { - iattributes[niattribs++] = WGLExt.WGL_DRAW_TO_WINDOW; + iattributes[niattribs++] = WGLExt.WGL_DRAW_TO_WINDOW_ARB; iattributes[niattribs++] = GL.GL_TRUE; } - iattributes[niattribs++] = WGLExt.WGL_DOUBLE_BUFFER; + iattributes[niattribs++] = WGLExt.WGL_DOUBLE_BUFFER_ARB; if (capabilities.getDoubleBuffered()) { iattributes[niattribs++] = GL.GL_TRUE; } else { iattributes[niattribs++] = GL.GL_FALSE; } - iattributes[niattribs++] = WGLExt.WGL_STEREO; + iattributes[niattribs++] = WGLExt.WGL_STEREO_ARB; if (capabilities.getStereo()) { iattributes[niattribs++] = GL.GL_TRUE; } else { iattributes[niattribs++] = GL.GL_FALSE; } - iattributes[niattribs++] = WGLExt.WGL_DEPTH_BITS; + iattributes[niattribs++] = WGLExt.WGL_DEPTH_BITS_ARB; iattributes[niattribs++] = capabilities.getDepthBits(); - iattributes[niattribs++] = WGLExt.WGL_RED_BITS; + iattributes[niattribs++] = WGLExt.WGL_RED_BITS_ARB; iattributes[niattribs++] = capabilities.getRedBits(); - iattributes[niattribs++] = WGLExt.WGL_GREEN_BITS; + iattributes[niattribs++] = WGLExt.WGL_GREEN_BITS_ARB; iattributes[niattribs++] = capabilities.getGreenBits(); - iattributes[niattribs++] = WGLExt.WGL_BLUE_BITS; + iattributes[niattribs++] = WGLExt.WGL_BLUE_BITS_ARB; iattributes[niattribs++] = capabilities.getBlueBits(); - iattributes[niattribs++] = WGLExt.WGL_ALPHA_BITS; + iattributes[niattribs++] = WGLExt.WGL_ALPHA_BITS_ARB; iattributes[niattribs++] = capabilities.getAlphaBits(); - iattributes[niattribs++] = WGLExt.WGL_STENCIL_BITS; + iattributes[niattribs++] = WGLExt.WGL_STENCIL_BITS_ARB; iattributes[niattribs++] = capabilities.getStencilBits(); if (capabilities.getAccumRedBits() > 0 || capabilities.getAccumGreenBits() > 0 || capabilities.getAccumBlueBits() > 0 || capabilities.getAccumAlphaBits() > 0) { - iattributes[niattribs++] = WGLExt.WGL_ACCUM_BITS; + iattributes[niattribs++] = WGLExt.WGL_ACCUM_BITS_ARB; iattributes[niattribs++] = (capabilities.getAccumRedBits() + capabilities.getAccumGreenBits() + capabilities.getAccumBlueBits() + capabilities.getAccumAlphaBits()); - iattributes[niattribs++] = WGLExt.WGL_ACCUM_RED_BITS; + iattributes[niattribs++] = WGLExt.WGL_ACCUM_RED_BITS_ARB; iattributes[niattribs++] = capabilities.getAccumRedBits(); - iattributes[niattribs++] = WGLExt.WGL_ACCUM_GREEN_BITS; + iattributes[niattribs++] = WGLExt.WGL_ACCUM_GREEN_BITS_ARB; iattributes[niattribs++] = capabilities.getAccumGreenBits(); - iattributes[niattribs++] = WGLExt.WGL_ACCUM_BLUE_BITS; + iattributes[niattribs++] = WGLExt.WGL_ACCUM_BLUE_BITS_ARB; iattributes[niattribs++] = capabilities.getAccumBlueBits(); - iattributes[niattribs++] = WGLExt.WGL_ACCUM_ALPHA_BITS; + iattributes[niattribs++] = WGLExt.WGL_ACCUM_ALPHA_BITS_ARB; iattributes[niattribs++] = capabilities.getAccumAlphaBits(); } if (wglExt.isExtensionAvailable("WGL_ARB_multisample")) { if (capabilities.getSampleBuffers()) { - iattributes[niattribs++] = WGLExt.WGL_SAMPLE_BUFFERS; + iattributes[niattribs++] = WGLExt.WGL_SAMPLE_BUFFERS_ARB; iattributes[niattribs++] = GL.GL_TRUE; - iattributes[niattribs++] = WGLExt.WGL_SAMPLES; + iattributes[niattribs++] = WGLExt.WGL_SAMPLES_ARB; iattributes[niattribs++] = capabilities.getNumSamples(); } } @@ -530,16 +530,16 @@ public abstract class WindowsWGLDrawable extends GLDrawableImpl { if (rtt) { throw new GLException("Render-to-floating-point-texture not supported on ATI hardware"); } else { - iattributes[niattribs++] = WGLExt.WGL_PIXEL_TYPE; - iattributes[niattribs++] = WGLExt.WGL_TYPE_RGBA_FLOAT; + iattributes[niattribs++] = WGLExt.WGL_PIXEL_TYPE_ARB; + iattributes[niattribs++] = WGLExt.WGL_TYPE_RGBA_FLOAT_ARB; } } else { if (!rtt) { // Currently we don't support non-truecolor visuals in the // GLCapabilities, so we don't offer the option of making // color-index pbuffers. - iattributes[niattribs++] = WGLExt.WGL_PIXEL_TYPE; - iattributes[niattribs++] = WGLExt.WGL_TYPE_RGBA; + iattributes[niattribs++] = WGLExt.WGL_PIXEL_TYPE_ARB; + iattributes[niattribs++] = WGLExt.WGL_TYPE_RGBA_ARB; } } @@ -557,13 +557,13 @@ public abstract class WindowsWGLDrawable extends GLDrawableImpl { iattributes[niattribs++] = WGLExt.WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV; iattributes[niattribs++] = GL.GL_TRUE; } else { - iattributes[niattribs++] = rect ? WGLExt.WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV : WGLExt.WGL_BIND_TO_TEXTURE_RGB; + iattributes[niattribs++] = rect ? WGLExt.WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV : WGLExt.WGL_BIND_TO_TEXTURE_RGB_ARB; iattributes[niattribs++] = GL.GL_TRUE; } } } else { - iattributes[niattribs++] = WGLExt.WGL_PIXEL_TYPE; - iattributes[niattribs++] = WGLExt.WGL_TYPE_RGBA; + iattributes[niattribs++] = WGLExt.WGL_PIXEL_TYPE_ARB; + iattributes[niattribs++] = WGLExt.WGL_TYPE_RGBA_ARB; } return true; @@ -577,43 +577,43 @@ public abstract class WindowsWGLDrawable extends GLDrawableImpl { for (int i = 0; i < niattribs; i++) { int attr = iattribs[i]; switch (attr) { - case WGLExt.WGL_DRAW_TO_WINDOW: + case WGLExt.WGL_DRAW_TO_WINDOW_ARB: if (requireRenderToWindow && iresults[i] != GL.GL_TRUE) return null; break; - case WGLExt.WGL_DRAW_TO_PBUFFER: + case WGLExt.WGL_DRAW_TO_PBUFFER_ARB: break; - case WGLExt.WGL_ACCELERATION: - res.setHardwareAccelerated(iresults[i] == WGLExt.WGL_FULL_ACCELERATION); + case WGLExt.WGL_ACCELERATION_ARB: + res.setHardwareAccelerated(iresults[i] == WGLExt.WGL_FULL_ACCELERATION_ARB); break; - case WGLExt.WGL_SUPPORT_OPENGL: + case WGLExt.WGL_SUPPORT_OPENGL_ARB: if (iresults[i] != GL.GL_TRUE) return null; break; - case WGLExt.WGL_DEPTH_BITS: + case WGLExt.WGL_DEPTH_BITS_ARB: res.setDepthBits(iresults[i]); break; - case WGLExt.WGL_STENCIL_BITS: + case WGLExt.WGL_STENCIL_BITS_ARB: res.setStencilBits(iresults[i]); break; - case WGLExt.WGL_DOUBLE_BUFFER: + case WGLExt.WGL_DOUBLE_BUFFER_ARB: res.setDoubleBuffered(iresults[i] == GL.GL_TRUE); break; - case WGLExt.WGL_STEREO: + case WGLExt.WGL_STEREO_ARB: res.setStereo(iresults[i] == GL.GL_TRUE); break; - case WGLExt.WGL_PIXEL_TYPE: + case WGLExt.WGL_PIXEL_TYPE_ARB: // Fail softly with unknown results here - if (iresults[i] == WGLExt.WGL_TYPE_RGBA|| - iresults[i] == WGLExt.WGL_TYPE_RGBA_FLOAT) { + if (iresults[i] == WGLExt.WGL_TYPE_RGBA_ARB || + iresults[i] == WGLExt.WGL_TYPE_RGBA_FLOAT_ARB) { res.setPbufferFloatingPointBuffers(true); } break; @@ -624,43 +624,43 @@ public abstract class WindowsWGLDrawable extends GLDrawableImpl { } break; - case WGLExt.WGL_RED_BITS: + case WGLExt.WGL_RED_BITS_ARB: res.setRedBits(iresults[i]); break; - case WGLExt.WGL_GREEN_BITS: + case WGLExt.WGL_GREEN_BITS_ARB: res.setGreenBits(iresults[i]); break; - case WGLExt.WGL_BLUE_BITS: + case WGLExt.WGL_BLUE_BITS_ARB: res.setBlueBits(iresults[i]); break; - case WGLExt.WGL_ALPHA_BITS: + case WGLExt.WGL_ALPHA_BITS_ARB: res.setAlphaBits(iresults[i]); break; - case WGLExt.WGL_ACCUM_RED_BITS: + case WGLExt.WGL_ACCUM_RED_BITS_ARB: res.setAccumRedBits(iresults[i]); break; - case WGLExt.WGL_ACCUM_GREEN_BITS: + case WGLExt.WGL_ACCUM_GREEN_BITS_ARB: res.setAccumGreenBits(iresults[i]); break; - case WGLExt.WGL_ACCUM_BLUE_BITS: + case WGLExt.WGL_ACCUM_BLUE_BITS_ARB: res.setAccumBlueBits(iresults[i]); break; - case WGLExt.WGL_ACCUM_ALPHA_BITS: + case WGLExt.WGL_ACCUM_ALPHA_BITS_ARB: res.setAccumAlphaBits(iresults[i]); break; - case WGLExt.WGL_SAMPLE_BUFFERS: + case WGLExt.WGL_SAMPLE_BUFFERS_ARB: res.setSampleBuffers(iresults[i] != 0); break; - case WGLExt.WGL_SAMPLES: + case WGLExt.WGL_SAMPLES_ARB: res.setNumSamples(iresults[i]); break; diff --git a/src/jogl/classes/com/sun/opengl/util/texture/Texture.java b/src/jogl/classes/com/sun/opengl/util/texture/Texture.java index e16b840fa..1cb8545c7 100755 --- a/src/jogl/classes/com/sun/opengl/util/texture/Texture.java +++ b/src/jogl/classes/com/sun/opengl/util/texture/Texture.java @@ -295,7 +295,7 @@ public class Texture { * * @return the OpenGL target of this texture * @see javax.media.opengl.GL#GL_TEXTURE_2D - * @see javax.media.opengl.GL2#GL_TEXTURE_RECTANGLE + * @see javax.media.opengl.GL2#GL_TEXTURE_RECTANGLE_ARB */ public int getTarget() { return target; @@ -386,7 +386,7 @@ public class Texture { * @return the texture coordinates corresponding to the specified sub-image */ public TextureCoords getSubImageTexCoords(int x1, int y1, int x2, int y2) { - if (target == GL2.GL_TEXTURE_RECTANGLE) { + if (target == GL2.GL_TEXTURE_RECTANGLE_ARB) { if (mustFlipVertically) { return new TextureCoords(x1, texHeight - y1, x2, texHeight - y2); } else { @@ -490,7 +490,7 @@ public class Texture { texWidth = imgWidth; texHeight = imgHeight; - texTarget = GL2.GL_TEXTURE_RECTANGLE; + texTarget = GL2.GL_TEXTURE_RECTANGLE_ARB; done = true; } @@ -517,7 +517,7 @@ public class Texture { texWidth = imgWidth; texHeight = imgHeight; - texTarget = GL2.GL_TEXTURE_RECTANGLE; + texTarget = GL2.GL_TEXTURE_RECTANGLE_ARB; done = true; } @@ -650,8 +650,8 @@ public class Texture { int magFilter = GL.GL_LINEAR; int wrapMode = (gl.isExtensionAvailable("GL_VERSION_1_2") || !gl.isGL2()) ? GL.GL_CLAMP_TO_EDGE : GL2.GL_CLAMP; - // REMIND: figure out what to do for GL_TEXTURE_RECTANGLE - if (texTarget != GL2.GL_TEXTURE_RECTANGLE) { + // REMIND: figure out what to do for GL_TEXTURE_RECTANGLE_ARB + if (texTarget != GL2.GL_TEXTURE_RECTANGLE_ARB) { gl.glTexParameteri(texParamTarget, GL.GL_TEXTURE_MIN_FILTER, minFilter); gl.glTexParameteri(texParamTarget, GL.GL_TEXTURE_MAG_FILTER, magFilter); gl.glTexParameteri(texParamTarget, GL.GL_TEXTURE_WRAP_S, wrapMode); @@ -665,7 +665,7 @@ public class Texture { // map if ((this.target == 0) || (this.target == GL.GL_TEXTURE_2D) || - (this.target == GL2.GL_TEXTURE_RECTANGLE)) { + (this.target == GL2.GL_TEXTURE_RECTANGLE_ARB)) { this.target = texTarget; } @@ -912,7 +912,7 @@ public class Texture { private void setImageSize(int width, int height, int target) { imgWidth = width; imgHeight = height; - if (target == GL2.GL_TEXTURE_RECTANGLE) { + if (target == GL2.GL_TEXTURE_RECTANGLE_ARB) { if (mustFlipVertically) { coords = new TextureCoords(0, imgHeight, imgWidth, 0); } else { diff --git a/src/jogl/classes/com/sun/openmax/OMXInstance.java b/src/jogl/classes/com/sun/openmax/OMXInstance.java index 0af6901b8..2eff166d2 100644 --- a/src/jogl/classes/com/sun/openmax/OMXInstance.java +++ b/src/jogl/classes/com/sun/openmax/OMXInstance.java @@ -198,10 +198,10 @@ public class OMXInstance { // create EGLImage from texture tmp[0] = EGL.EGL_NONE; - image = eglExt.eglCreateImage( + image = eglExt.eglCreateImageKHR( eglDisplay, eglContext, - eglExt.EGL_GL_TEXTURE_2D, + eglExt.EGL_GL_TEXTURE_2D_KHR, tex, tmp, 0); if (0==image) { @@ -212,9 +212,9 @@ public class OMXInstance { // rendering the EGLImage texture before we tell OpenMAX to fill // it with a new frame. tmp[0] = EGL.EGL_NONE; - sync = eglExt.eglCreateFenceSync( + sync = eglExt.eglCreateFenceSyncKHR( eglDisplay, - eglExt.EGL_SYNC_PRIOR_COMMANDS_COMPLETE, tmp, 0); + eglExt.EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR, tmp, 0); _setStreamEGLImageTexture2D(moviePtr, i, tex, image, sync); @@ -445,12 +445,12 @@ public class OMXInstance { for(int i=0; i