diff options
17 files changed, 310 insertions, 155 deletions
diff --git a/make/config/jogl/gl-common-extensions.cfg b/make/config/jogl/gl-common-extensions.cfg index 5b1d57fb0..f03d58d4a 100644 --- a/make/config/jogl/gl-common-extensions.cfg +++ b/make/config/jogl/gl-common-extensions.cfg @@ -5,16 +5,17 @@ DropUniqVendorExtensions APPLE DropUniqVendorExtensions ATI DropUniqVendorExtensions HP DropUniqVendorExtensions IBM +DropUniqVendorExtensions INGR DropUniqVendorExtensions MESA DropUniqVendorExtensions MESAX DropUniqVendorExtensions NV +DropUniqVendorExtensions PGI DropUniqVendorExtensions SGI DropUniqVendorExtensions SGIS DropUniqVendorExtensions SGIX DropUniqVendorExtensions SUN DropUniqVendorExtensions WIN - # Enums handled by base GL class Ignore GL_FRAMEBUFFER_EXT Ignore GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT @@ -62,3 +63,78 @@ RenameJavaMethod glGetRenderbufferParameterivEXT glGetRenderbufferParameteriv RenameJavaMethod glIsFramebufferEXT glIsFramebuffer RenameJavaMethod glIsRenderbufferEXT glIsRenderbuffer RenameJavaMethod glRenderbufferStorageEXT glRenderbufferStorage + +# Remove extension suffixes from extensions which are common between OpenGL and OpenGL ES +RenameExtensionIntoCore GL_ARB_half_float_pixel +RenameExtensionIntoCore GL_ARB_point_sprite +RenameExtensionIntoCore GL_OES_blend_equation_separate +RenameExtensionIntoCore GL_OES_blend_func_separate +RenameExtensionIntoCore GL_OES_blend_subtract +RenameExtensionIntoCore GL_OES_compressed_paletted_texture +RenameExtensionIntoCore GL_OES_depth24 +RenameExtensionIntoCore GL_OES_depth32 +RenameExtensionIntoCore GL_OES_framebuffer_object +RenameExtensionIntoCore GL_OES_mapbuffer +RenameExtensionIntoCore GL_OES_point_sprite +RenameExtensionIntoCore GL_OES_rgb8_rgba8 +RenameExtensionIntoCore GL_OES_read_format +RenameExtensionIntoCore GL_OES_stencil1 +RenameExtensionIntoCore GL_OES_stencil4 +RenameExtensionIntoCore GL_OES_stencil8 +RenameExtensionIntoCore GL_OES_stencil_wrap +RenameExtensionIntoCore GL_OES_texture_cube_map +RenameExtensionIntoCore GL_OES_texture_half_float +RenameExtensionIntoCore GL_OES_texture_mirrored_repeat + +RenameJavaSymbol GL_STENCIL_INDEX1_EXT GL_STENCIL_INDEX1 +RenameJavaSymbol GL_STENCIL_INDEX4_EXT GL_STENCIL_INDEX4 +RenameJavaSymbol GL_STENCIL_INDEX8_EXT GL_STENCIL_INDEX8 + +# The following extensions have some differences requiring us to +# manually rename some symbols and leave others alone for best +# correctness +# RenameExtensionIntoCore GL_ARB_matrix_palette +# We do not want to pull in all of this extension into the core namespace +# RenameExtensionIntoCore GL_ARB_vertex_blend + +RenameJavaSymbol GL_MAX_VERTEX_UNITS_ARB GL_MAX_VERTEX_UNITS +RenameJavaSymbol GL_MAX_PALETTE_MATRICES_ARB GL_MAX_PALETTE_MATRICES +RenameJavaSymbol GL_MATRIX_PALETTE_ARB GL_MATRIX_PALETTE +RenameJavaSymbol GL_MATRIX_INDEX_ARRAY_ARB GL_MATRIX_INDEX_ARRAY +RenameJavaSymbol GL_WEIGHT_ARRAY_ARB GL_WEIGHT_ARRAY +RenameJavaSymbol GL_CURRENT_PALETTE_MATRIX_ARB GL_CURRENT_PALETTE_MATRIX +RenameJavaSymbol GL_MATRIX_INDEX_ARRAY_SIZE_ARB GL_MATRIX_INDEX_ARRAY_SIZE +RenameJavaSymbol GL_MATRIX_INDEX_ARRAY_TYPE_ARB GL_MATRIX_INDEX_ARRAY_TYPE +RenameJavaSymbol GL_MATRIX_INDEX_ARRAY_STRIDE_ARB GL_MATRIX_INDEX_ARRAY_STRIDE +RenameJavaSymbol GL_MATRIX_INDEX_ARRAY_POINTER_ARB GL_MATRIX_INDEX_ARRAY_POINTER +RenameJavaSymbol GL_WEIGHT_ARRAY_SIZE_ARB GL_WEIGHT_ARRAY_SIZE +RenameJavaSymbol GL_WEIGHT_ARRAY_TYPE_ARB GL_WEIGHT_ARRAY_TYPE +RenameJavaSymbol GL_WEIGHT_ARRAY_STRIDE_ARB GL_WEIGHT_ARRAY_STRIDE +RenameJavaSymbol GL_WEIGHT_ARRAY_POINTER_ARB GL_WEIGHT_ARRAY_POINTER +RenameJavaSymbol glCurrentPaletteMatrixARB glCurrentPaletteMatrix +RenameJavaSymbol glMatrixIndexPointerARB glMatrixIndexPointer +RenameJavaSymbol glWeightPointerARB glWeightPointer + +# There are some definitions in this extension that don't exist in desktop OpenGL, +# so we shouldn't remove the suffixes of those OES-only variants +# RenameExtensionIntoCore GL_OES_matrix_palette +RenameJavaSymbol GL_MAX_VERTEX_UNITS_OES GL_MAX_VERTEX_UNITS +RenameJavaSymbol GL_MAX_PALETTE_MATRICES_OES GL_MAX_PALETTE_MATRICES +RenameJavaSymbol GL_MATRIX_PALETTE_OES GL_MATRIX_PALETTE +RenameJavaSymbol GL_MATRIX_INDEX_ARRAY_OES GL_MATRIX_INDEX_ARRAY +RenameJavaSymbol GL_WEIGHT_ARRAY_OES GL_WEIGHT_ARRAY +RenameJavaSymbol GL_CURRENT_PALETTE_MATRIX_OES GL_CURRENT_PALETTE_MATRIX +RenameJavaSymbol GL_MATRIX_INDEX_ARRAY_SIZE_OES GL_MATRIX_INDEX_ARRAY_SIZE +RenameJavaSymbol GL_MATRIX_INDEX_ARRAY_TYPE_OES GL_MATRIX_INDEX_ARRAY_TYPE +RenameJavaSymbol GL_MATRIX_INDEX_ARRAY_STRIDE_OES GL_MATRIX_INDEX_ARRAY_STRIDE +RenameJavaSymbol GL_MATRIX_INDEX_ARRAY_POINTER_OES GL_MATRIX_INDEX_ARRAY_POINTER +RenameJavaSymbol GL_WEIGHT_ARRAY_SIZE_OES GL_WEIGHT_ARRAY_SIZE +RenameJavaSymbol GL_WEIGHT_ARRAY_TYPE_OES GL_WEIGHT_ARRAY_TYPE +RenameJavaSymbol GL_WEIGHT_ARRAY_STRIDE_OES GL_WEIGHT_ARRAY_STRIDE +RenameJavaSymbol GL_WEIGHT_ARRAY_POINTER_OES GL_WEIGHT_ARRAY_POINTER +RenameJavaSymbol GL_WEIGHT_ARRAY_BUFFER_BINDING_OES GL_WEIGHT_ARRAY_BUFFER_BINDING +RenameJavaSymbol glCurrentPaletteMatrixOES glCurrentPaletteMatrix +RenameJavaSymbol glMatrixIndexPointerOES glMatrixIndexPointer +RenameJavaSymbol glWeightPointerOES glWeightPointer + + diff --git a/make/config/jogl/gl-common.cfg b/make/config/jogl/gl-common.cfg index 1ee882e40..8c3061773 100644 --- a/make/config/jogl/gl-common.cfg +++ b/make/config/jogl/gl-common.cfg @@ -27,10 +27,12 @@ Ignore glGetBufferPointerv # Ignore GL functions that deal with explicit pointer values in such a # way that we cannot implement the functionality in Java Ignore glGetBufferPointerv +Ignore glGetBufferPointervARB Ignore glGetPointerv Ignore glGetPointervEXT Ignore glGetTexParameterPointervAPPLE Ignore glGetVertexAttribPointerv +Ignore glGetVertexAttribPointervARB Ignore glGetVertexAttribPointervNV Ignore glTracePointerRangeMESA @@ -55,6 +57,7 @@ Ignore glGetVariantPointervEXT Ignore (GL|GLU|GLX|WGL|AGL|CGL)_EXT_.+ Ignore (GL|GLU|GLX|WGL|AGL|CGL)_ARB_.+ +Ignore (GL|GLU|GLX|WGL|AGL|CGL)_OES_.+ Ignore (GL|GLU|GLX|WGL|AGL|CGL)_PGI_.+ Ignore (GL|GLU|GLX|WGL|AGL|CGL)_SGI_.+ Ignore (GL|GLU|GLX|WGL|AGL|CGL)_SGIS_.+ @@ -149,7 +152,9 @@ IgnoreExtension GL_EXT_convolution IgnoreExtension GL_EXT_draw_range_elements IgnoreExtension GL_EXT_histogram IgnoreExtension GL_EXT_packed_pixels -# FIXME: is GL_EXT_paletted_texture also obsolete? +# NOTE: also ignoring GL_EXT_paletted_texture because it appears that it was subsumed +# into the core even though that isn't stated explicitly in the spec +IgnoreExtension GL_EXT_paletted_texture IgnoreExtension GL_EXT_rescale_normal IgnoreExtension GL_EXT_separate_specular_color IgnoreExtension GL_EXT_texture3D @@ -175,6 +180,50 @@ IgnoreExtension GL_EXT_texture_env_combine IgnoreExtension GL_EXT_texture_env_dot3 IgnoreExtension GL_SGIS_texture_border_clamp +# Ignore extensions subsumed in OpenGL 1.4 (from OpenGL 1.4 spec, Appendix G) +IgnoreExtension GL_ARB_depth_texture +IgnoreExtension GL_ARB_point_parameters +IgnoreExtension GL_ARB_shadow +IgnoreExtension GL_ARB_texture_env_crossbar +IgnoreExtension GL_ARB_texture_mirrored_repeat +IgnoreExtension GL_ARB_window_pos +IgnoreExtension GL_EXT_blend_func_separate +IgnoreExtension GL_EXT_fog_coord +IgnoreExtension GL_EXT_texture_lod_bias +IgnoreExtension GL_EXT_multi_draw_arrays +IgnoreExtension GL_EXT_secondary_color +IgnoreExtension GL_EXT_stencil_wrap +IgnoreExtension GL_NV_blend_square +IgnoreExtension GL_SGIS_generate_mipmap + +# Ignore extensions subsumed in OpenGL 1.5 (from OpenGL 1.5 spec, Appendix H) +IgnoreExtension GL_ARB_occlusion_query +IgnoreExtension GL_ARB_vertex_buffer_object +IgnoreExtension GL_EXT_shadow_funcs + +# Ignore extensions subsumed in OpenGL 2.0 (from OpenGL 2.0 spec, Appendix I) +# NOTE that GL_ARB_shader_objects is NOT ignored here, because the +# naming convention is too different for us to pick up the entry +# points automatically (e.g. glCreateShaderObjectARB was exposed as +# glCreateShader) +IgnoreExtension GL_ARB_vertex_shader +IgnoreExtension GL_ARB_fragment_shader +IgnoreExtension GL_ARB_draw_buffers +IgnoreExtension GL_ARB_texture_non_power_of_two +IgnoreExtension GL_ARB_point_sprite +IgnoreExtension GL_EXT_blend_equation_separate +# Don't ignore the following one since the entry point is different from anything in the core +# IgnoreExtension GL_EXT_stencil_two_side + +# Ignore extensions subsumed in OpenGL 2.1 (from OpenGL 2.1 spec, Appendix J) +IgnoreExtension GL_ARB_pixel_buffer_object +IgnoreExtension GL_EXT_texture_sRGB + +# Ignore a few obsolete versions of extensions that have been subsumed into the core or ARB extensions +IgnoreExtension GL_EXT_multisample +IgnoreExtension GL_EXT_point_parameters +IgnoreExtension GL_EXT_texture_rectangle + # # Opaques and other directives for platform-independent routines # diff --git a/make/config/jogl/gl-es1.cfg b/make/config/jogl/gl-es1.cfg index a840aedb5..0bc4dc916 100755 --- a/make/config/jogl/gl-es1.cfg +++ b/make/config/jogl/gl-es1.cfg @@ -40,6 +40,8 @@ GetProcAddressTableExpr ((GLES1ProcAddressTable)_context.getGLProcAddressTable() # and functions and the extensions in which they are defined GLHeader GLES/gl.h GLHeader GLES/glext.h +GLHeader GL/gl.h +GLHeader GL/glext.h # Force all of the methods to be emitted using dynamic linking so we # don't need to link against any emulation library on the desktop or @@ -53,6 +55,11 @@ LocalProcAddressCallingConvention __ALL__ GL_APIENTRY # Pick up on-line OpenGL javadoc thanks to user cylab on javagaming.org forums TagNativeBinding true +# Ignore certain extensions that will be picked up by the dynamic +# lookup mechanism anyway if they are present +IgnoreExtension GL_OES_fixed_point +IgnoreExtension GL_OES_single_precision + CustomJavaCode GLES1Impl public void glOrtho(double left, double right, double bottom, double top, double near_val, double far_val) { CustomJavaCode GLES1Impl glOrtho((float) left, (float) right, (float) bottom, (float) top, (float) near_val, (float) far_val); } diff --git a/make/config/jogl/gl-es2.cfg b/make/config/jogl/gl-es2.cfg index af0867a6f..bd467776e 100755 --- a/make/config/jogl/gl-es2.cfg +++ b/make/config/jogl/gl-es2.cfg @@ -29,6 +29,8 @@ GetProcAddressTableExpr ((GLES2ProcAddressTable)_context.getGLProcAddressTable() # and functions and the extensions in which they are defined GLHeader GLES2/gl2.h GLHeader GLES2/gl2ext.h +GLHeader GL/gl.h +GLHeader GL/glext.h # Force all of the methods to be emitted using dynamic linking so we # don't need to link against any emulation library on the desktop or diff --git a/make/config/jogl/gl-gl2.cfg b/make/config/jogl/gl-gl2.cfg index f0aafd932..c98f81571 100644 --- a/make/config/jogl/gl-gl2.cfg +++ b/make/config/jogl/gl-gl2.cfg @@ -45,6 +45,9 @@ Ignore GL_STENCIL_INDEX16_EXT # Pick up on-line OpenGL javadoc thanks to user cylab on javagaming.org forums TagNativeBinding true +# Ignore extensions that are already picked up via the GL2ES1 interface +IgnoreExtension GL_EXT_point_parameters + CustomJavaCode GL2 public static final int GL_STENCIL_INDEX16 = 0x8D49; CustomJavaCode GL2 public static final int GL_RGBA_FLOAT32_APPLE = 0x8814; CustomJavaCode GL2 public static final int GL_RGBA_FLOAT16_APPLE = 0x881A; diff --git a/make/config/jogl/gl-if-gl.cfg b/make/config/jogl/gl-if-gl.cfg index acbf0f976..46e11fdd4 100755 --- a/make/config/jogl/gl-if-gl.cfg +++ b/make/config/jogl/gl-if-gl.cfg @@ -31,6 +31,8 @@ GetProcAddressTableExpr DontGenerateProcAddressTableStuff # and functions and the extensions in which they are defined GLHeader GLES2/gl2.h GLHeader GLES2/gl2ext.h +GLHeader GL/gl.h +GLHeader GL/glext.h # Pick up on-line OpenGL javadoc thanks to user cylab on javagaming.org forums TagNativeBinding true diff --git a/make/config/jogl/gl-if-gl2_es1.cfg b/make/config/jogl/gl-if-gl2_es1.cfg index ecd9bc525..d09ebcb30 100755 --- a/make/config/jogl/gl-if-gl2_es1.cfg +++ b/make/config/jogl/gl-if-gl2_es1.cfg @@ -21,18 +21,20 @@ Include gl-common-extensions.cfg JavaOutputDir gensrc/classes NativeOutputDir gensrc/native/jogl -# Ignore all ES 1.X only stuff to GL2 -Ignore glPointSizePointer +# Ignore all ES 1.X only stuff not in GL2 +IgnoreExtension GL_OES_compressed_ETC1_RGB8_texture +IgnoreExtension GL_OES_draw_texture +IgnoreExtension GL_OES_fixed_point +IgnoreExtension GL_OES_matrix_get +IgnoreExtension GL_OES_point_size_array +IgnoreExtension GL_OES_query_matrix +IgnoreExtension GL_OES_vertex_half_float Ignore glGetFixedv -Ignore ^glDrawTex.* -#heavy float/double array diff to GL2 -Ignore glClipPlanef -Ignore ^glGetClipPlanef(OES)? +# Ignore OES variants of single precision floating point routines +IgnoreExtension GL_OES_single_precision -#impl diff -Ignore ^glEGL.* -Ignore ^gl.*(xv)(OES)? +# Ignore fixed point versions of routines in ES 1.x core Ignore glAlphaFuncx Ignore glClearColorx Ignore glClearDepthx @@ -62,7 +64,17 @@ Ignore glTexEnvx Ignore glTexGenx Ignore glTexParameterx Ignore glTranslatex -Ignore glLoadPaletteFromModelViewMatrix + +#heavy float/double array diff to GL2 +Ignore glClipPlanef +Ignore ^glGetClipPlanef(OES)? + +#impl diff +Ignore ^glEGL.* +Ignore ^gl.*(xv)(OES)? +Ignore glTexGenxOES +Ignore GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES +Ignore glLoadPaletteFromModelViewMatrixOES Ignore glGetFixedv CustomJavaCode GL2ES1 public void glOrtho(double left, double right, double bottom, double top, double near_val, double far_val); @@ -76,6 +88,8 @@ GetProcAddressTableExpr DontGenerateProcAddressTableStuff # and functions and the extensions in which they are defined GLHeader GLES/gl.h GLHeader GLES/glext.h +GLHeader GL/gl.h +GLHeader GL/glext.h # Pick up on-line OpenGL javadoc thanks to user cylab on javagaming.org forums TagNativeBinding true diff --git a/make/config/jogl/gl-if-gl2_es2.cfg b/make/config/jogl/gl-if-gl2_es2.cfg index 716351c3f..832c32ee5 100755 --- a/make/config/jogl/gl-if-gl2_es2.cfg +++ b/make/config/jogl/gl-if-gl2_es2.cfg @@ -33,6 +33,8 @@ GetProcAddressTableExpr DontGenerateProcAddressTableStuff # and functions and the extensions in which they are defined GLHeader GLES2/gl2.h GLHeader GLES2/gl2ext.h +GLHeader GL/gl.h +GLHeader GL/glext.h # Pick up on-line OpenGL javadoc thanks to user cylab on javagaming.org forums TagNativeBinding true diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gles1.java b/make/config/jogl/gl-impl-CustomJavaCode-gles1.java index 3af0864cd..a7c42a81d 100755 --- a/make/config/jogl/gl-impl-CustomJavaCode-gles1.java +++ b/make/config/jogl/gl-impl-CustomJavaCode-gles1.java @@ -276,7 +276,7 @@ private Map/*<ARBVBOKey, ByteBuffer>*/ arbVBOCache = new HashMap(); /** Entry point to C language function: <br> <code> LPVOID glMapBuffer(GLenum target, GLenum access); </code> */ public java.nio.ByteBuffer glMapBuffer(int target, int access) { - final long __addr_ = ((GLES1ProcAddressTable)_context.getGLProcAddressTable())._addressof_glMapBuffer; + final long __addr_ = ((GLES1ProcAddressTable)_context.getGLProcAddressTable())._addressof_glMapBufferOES; if (__addr_ == 0) { throw new GLException("Method \"glMapBuffer\" not available"); } diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gles2.java b/make/config/jogl/gl-impl-CustomJavaCode-gles2.java index bf94eed43..e1adf3b7c 100755 --- a/make/config/jogl/gl-impl-CustomJavaCode-gles2.java +++ b/make/config/jogl/gl-impl-CustomJavaCode-gles2.java @@ -286,7 +286,7 @@ private Map/*<ARBVBOKey, ByteBuffer>*/ arbVBOCache = new HashMap(); /** Entry point to C language function: <br> <code> LPVOID glMapBuffer(GLenum target, GLenum access); </code> */ public java.nio.ByteBuffer glMapBuffer(int target, int access) { - final long __addr_ = ((GLES2ProcAddressTable)_context.getGLProcAddressTable())._addressof_glMapBuffer; + final long __addr_ = ((GLES2ProcAddressTable)_context.getGLProcAddressTable())._addressof_glMapBufferOES; if (__addr_ == 0) { throw new GLException("Method \"glMapBuffer\" not available"); } 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<textureNum; i++) { if(null!=eglImgTexs[i]) { if(0!=eglImgTexs[i].image) { - eglExt.eglDestroyImage( + eglExt.eglDestroyImageKHR( eglDisplay, eglImgTexs[i].image); } if(0!=eglImgTexs[i].sync) { - eglExt.eglDestroySync(eglImgTexs[i].sync); + eglExt.eglDestroySyncKHR(eglImgTexs[i].sync); } if(null!=gl) { eglImgTexs[i].texture.destroy(gl); |