diff options
Diffstat (limited to 'make/config')
49 files changed, 1380 insertions, 858 deletions
diff --git a/make/config/jogl/gl-common-extensions.cfg b/make/config/jogl/gl-common-extensions.cfg index 6631e035d..a723a9fd8 100644 --- a/make/config/jogl/gl-common-extensions.cfg +++ b/make/config/jogl/gl-common-extensions.cfg @@ -20,6 +20,7 @@ DropUniqVendorExtensions WIN # Drop some obsolete or mostly-integrated vendor extensions that the above directives let in # Note that some of these are in LWJGL, so perhaps there is justification for leaving them in +IgnoreExtension GL_APPLE_sync IgnoreExtension GL_APPLE_element_array IgnoreExtension GL_APPLE_vertex_array_object IgnoreExtension GL_ATI_element_array @@ -46,6 +47,7 @@ IgnoreExtension GL_NV_texture_rectangle IgnoreExtension GL_NV_vertex_program # This one would require more work -- has associated GLX and WGL bindings IgnoreExtension GL_NV_present_video +IgnoreExtension GL_OES_fixed_point # For the time being, ignore these extensions which are in the ES 2.0 spec IgnoreExtension GL_NV_framebuffer_vertex_attrib_array @@ -86,25 +88,11 @@ RenameExtensionIntoCore GL_NV_draw_buffers RenameExtensionIntoCore GL_NV_fbo_color_attachments RenameExtensionIntoCore GL_EXT_packed_float RenameExtensionIntoCore GL_EXT_texture_format_BGRA8888 - -# A mess w/ the ES2 definition .. sadly -# RenameExtensionIntoCore GL_EXT_texture_storage -RenameJavaSymbol glTexStorage1DEXT glTexStorage1D -RenameJavaSymbol glTexStorage2DEXT glTexStorage2D -RenameJavaSymbol glTexStorage3DEXT glTexStorage3D -RenameJavaSymbol GL_TEXTURE_IMMUTABLE_FORMAT_EXT GL_TEXTURE_IMMUTABLE_FORMAT -RenameJavaSymbol GL_RGBA32F_EXT GL_RGBA32F -RenameJavaSymbol GL_RGB32F_EXT GL_RGB32F -RenameJavaSymbol GL_ALPHA32F_EXT GL_ALPHA32F_ARB -RenameJavaSymbol GL_LUMINANCE32F_EXT GL_LUMINANCE32F_ARB -RenameJavaSymbol GL_LUMINANCE_ALPHA32F_EXT GL_LUMINANCE_ALPHA32F_ARB -RenameJavaSymbol GL_RGB16F_EXT GL_RGB16F -RenameJavaSymbol GL_ALPHA16F_EXT GL_ALPHA16F_ARB -RenameJavaSymbol GL_LUMINANCE16F_EXT GL_LUMINANCE16F_ARB -RenameJavaSymbol GL_LUMINANCE_ALPHA16F_EXT GL_LUMINANCE_ALPHA16F_ARB -RenameJavaSymbol GL_RGB10_A2_EXT GL_RGB10_A2 -RenameJavaSymbol GL_RGB10_EXT GL_RGB10 - +RenameExtensionIntoCore GL_OES_single_precision +RenameExtensionIntoCore GL_EXT_draw_buffers +RenameExtensionIntoCore GL_EXT_texture_storage +RenameExtensionIntoCore GL_ARB_texture_storage +RenameExtensionIntoCore GL_EXT_map_buffer_range # The following extensions have some differences requiring us to # manually rename some symbols and leave others alone for best diff --git a/make/config/jogl/gl-common.cfg b/make/config/jogl/gl-common.cfg index ad0b7d1d0..ddb312075 100644 --- a/make/config/jogl/gl-common.cfg +++ b/make/config/jogl/gl-common.cfg @@ -7,6 +7,19 @@ HierarchicalNativeOutput false RuntimeExceptionType GLException UnsupportedExceptionType GLException +# Inform the glue code generator of the association between #defines +# and functions and the extensions in which they are defined +GLHeader GL/gl.h +GLHeader GL/glext.h +GLHeader GL/glcorearb.h +GLHeader GL/glcorearbext.h +GLHeader GLES/gl.h +GLHeader GLES/glext.h +GLHeader GLES2/gl2.h +GLHeader GLES2/gl2ext.h +GLHeader GLES3/gl3.h +GLHeader GLES3/gl3ext.h + # Imports needed by all glue code Import java.util.* Import javax.media.opengl.* @@ -37,13 +50,17 @@ Ignore glGetVertexAttribPointerv Ignore glGetVertexAttribPointervARB Ignore glGetVertexAttribPointervNV Ignore glTracePointerRangeMESA -Ignore glDebugMessageCallbackARB Ignore glDebugMessageCallbackAMD +Ignore glDebugMessageCallbackARB +Ignore glDebugMessageCallbackKHR +Ignore glDebugMessageCallback -# Manually implement glMapBuffer as the size of the returned buffer +# Manually implement glMapBuffer and glMapBufferRange as the size of the returned buffer # can only be computed by calling another routine ManuallyImplement glMapBuffer ForceProcAddressGen glMapBuffer +ManuallyImplement glMapBufferRange +ForceProcAddressGen glMapBufferRange # Ignore the ATI_map_object_buffer extension for now unless someone # claims they need it, as it will undoubtedly require a similar @@ -249,7 +266,7 @@ RenameExtensionIntoCore GL_EXT_draw_buffers2 RenameExtensionIntoCore GL_ARB_texture_compression_rgtc IgnoreExtension GL_EXT_texture_compression_rgtc -RenameExtensionIntoCore GL_EXT_transform_feedback +IgnoreExtension GL_EXT_transform_feedback IgnoreExtension GL_NV_transform_feedback # gl.h uses GL_ARB_vertex_array_object @@ -277,6 +294,8 @@ IgnoreExtension GL_EXT_texture_buffer_object RenameExtensionIntoCore GL_EXT_texture_rectangle IgnoreExtension GL_NV_texture_rectangle RenameExtensionIntoCore GL_ARB_uniform_buffer_object +# Use Manual definition, otherwise GlueGen uses 'long' type +Ignore GL_INVALID_INDEX # <<< OpenGL 3.1 # >>> OpenGL 3.2 @@ -339,6 +358,17 @@ RenameExtensionIntoCore GL_ARB_viewport_array # Rename extension suffices (if exist) subsumed in OpenGL 4.2 (from OpenGL 4.2 spec, Appendix L.1) # <<< OpenGL 4.2 +# >>> OpenGL 4.3 +# Rename extension suffices (if exist) subsumed in OpenGL 4.3 (from OpenGL 4.3 spec, Appendix ?.1) +RenameExtensionIntoCore GL_ARB_debug_output +# <<< OpenGL 4.3 + +# >>> OpenGL ES 2.0 +# <<< OpenGL ES 2.0 + +# >>> OpenGL ES 3.0 +# <<< OpenGL ES 3.0 + # 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 @@ -352,6 +382,8 @@ IgnoreExtension GL_EXT_shader_image_load_store Opaque boolean GLboolean Opaque long GLsync Opaque long GLeglImageOES +Opaque long cl_context +Opaque long cl_event ReturnsString glGetString ReturnsString glGetStringi @@ -421,9 +453,6 @@ NIODirectOnly glExtGetBufferPointervQCOM ReturnValueCapacity wglAllocateMemoryNV {0} ReturnValueCapacity glXAllocateMemoryNV {0} -ReturnValueCapacity glMapBufferRange {2} -ReturnValueCapacity glMapNamedBufferRangeEXT {2} - # Pass arguments to ARB_vertex_program, ARB_fragment_program, # ARB_shader_objects, NV_vertex_program, NV_fragment_program, and # ARB_vertex_shader as Strings @@ -473,7 +502,7 @@ ArgumentIsString glGetFragDataIndex 1 ArgumentIsString glGetSubroutineIndex 2 ArgumentIsString glGetSubroutineUniformLocation 2 -ArgumentIsString glDebugMessageInsertARB 5 +ArgumentIsString glDebugMessageInsert 5 ArgumentIsString glDebugMessageInsertAMD 4 ArgumentIsString glNamedStringARB 2 4 @@ -702,78 +731,122 @@ RangeCheck glDeleteVertexArraysAPPLE 1 {0} # Javadoc for the GL class ClassJavadoc GL /** -ClassJavadoc GL * <P> Common interface containing the subset of all profiles, GL3bc, GL3, GL2, GLES1 and GLES2.<br> -ClassJavadoc GL * This interface reflects common data types, texture and framebuffer functionality.</P> +ClassJavadoc GL * <p> Common interface containing the subset of all profiles, GL3bc, GL3, GL2, GLES1 and GLES2.<br/> +ClassJavadoc GL * This interface reflects common data types, texture and framebuffer functionality.</p> ClassJavadoc GL */ ClassJavadoc GL2ES1 /** -ClassJavadoc GL2ES1 * <P> -ClassJavadoc GL2ES1 * Interface containing the common subset of GL2 and GLES1.<br> -ClassJavadoc GL2ES1 * This interface reflects only the fixed functionality of OpenGL<br> -ClassJavadoc GL2ES1 * </P> +ClassJavadoc GL2ES1 * <p> +ClassJavadoc GL2ES1 * Interface containing the common subset of GL2 and GLES1.<br/> +ClassJavadoc GL2ES1 * This interface reflects only the fixed functionality of OpenGL<br/> +ClassJavadoc GL2ES1 * </p> ClassJavadoc GL2ES1 */ ClassJavadoc GL2ES2 /** -ClassJavadoc GL2ES2 * <P> -ClassJavadoc GL2ES2 * Interface containing the common subset of GL3, GL2 and GLES2.<br> -ClassJavadoc GL2ES2 * This interface reflects only the programmable shader functionality of desktop and embedded OpenGL<br> -ClassJavadoc GL2ES2 * </P> +ClassJavadoc GL2ES2 * <p> +ClassJavadoc GL2ES2 * Interface containing the common subset of GL3, GL2 and GLES2.<br/> +ClassJavadoc GL2ES2 * This interface reflects only the programmable shader functionality of desktop and embedded OpenGL<br/> +ClassJavadoc GL2ES2 * This interface is almost GLES2 complete.<br/> +ClassJavadoc GL2ES2 * </p> ClassJavadoc GL2ES2 */ +ClassJavadoc GL2ES3 /** +ClassJavadoc GL2ES3 * <p> +ClassJavadoc GL2ES3 * Interface containing the common subset of core GL2 and GLES3 (OpenGL ES 3.0).<br/> +ClassJavadoc GL2ES3 * This interface reflects only the programmable shader functionality of desktop and embedded OpenGL<br/> +ClassJavadoc GL2ES3 * This interface is not GLES3 complete and merely exist to avoid duplicated definitions.<br/> +ClassJavadoc GL2ES3 * </p> +ClassJavadoc GL2ES3 */ + +ClassJavadoc GL3ES3 /** +ClassJavadoc GL3ES3 * <p> +ClassJavadoc GL3ES3 * Interface containing the common subset of core GL3 (OpenGL 3.1+) and GLES3 (OpenGL ES 3.0).<br/> +ClassJavadoc GL3ES3 * This interface reflects only the programmable shader functionality of desktop and embedded OpenGL<br/> +ClassJavadoc GL3ES3 * This interface is almost GLES3 complete, but lacks the <code>GL_ARB_ES3_compatibility</code> extension.<br/> +ClassJavadoc GL3ES3 * </p> +ClassJavadoc GL3ES3 */ + +ClassJavadoc GL4ES3 /** +ClassJavadoc GL4ES3 * <p> +ClassJavadoc GL4ES3 * Interface containing the common subset of core GL4 (OpenGL 4.0+) and GLES3 (OpenGL ES 3.0).<br/> +ClassJavadoc GL4ES3 * This interface reflects only the programmable shader functionality of desktop and embedded OpenGL<br/> +ClassJavadoc GL4ES3 * This interface is GLES3 complete.<br/> +ClassJavadoc GL4ES3 * </p> +ClassJavadoc GL4ES3 */ + ClassJavadoc GL2GL3 /** -ClassJavadoc GL2GL3 * <P> -ClassJavadoc GL2GL3 * Interface containing the common subset of core GL3 (OpenGL 3.1+) and GL2 (OpenGL 3.0), -ClassJavadoc GL2GL3 * also known as the OpenGL 3.0 forward compatible, non deprecated subset.<br> -ClassJavadoc GL2GL3 * This interface reflects only the programmable shader functionality of desktop OpenGL<br> -ClassJavadoc GL2GL3 * </P> +ClassJavadoc GL2GL3 * <p> +ClassJavadoc GL2GL3 * Interface containing the common subset of core GL3 (OpenGL 3.1) and GL2 (OpenGL 3.0), +ClassJavadoc GL2GL3 * also known as the OpenGL 3.0 forward compatible, non deprecated subset.<br/> +ClassJavadoc GL2GL3 * This interface reflects only the programmable shader functionality of desktop OpenGL<br/> +ClassJavadoc GL2GL3 * </p> ClassJavadoc GL2GL3 */ ClassJavadoc GL2 /** -ClassJavadoc GL2 * <P> +ClassJavadoc GL2 * <p> ClassJavadoc GL2 * This interface contains all core desktop OpenGL methods through ClassJavadoc GL2 * version 3.0, inclusive, as well as most of it's extensions defined at the ClassJavadoc GL2 * time of this specification. Early OpenGL extensions whose functionality ClassJavadoc GL2 * was incorporated into core OpenGL by version 3.0, inclusive, are specifically -ClassJavadoc GL2 * excluded.<br> +ClassJavadoc GL2 * excluded.<br/> ClassJavadoc GL2 * Note: OpenGL 3.0 is the last subsumed version in the specification. ClassJavadoc GL2 * You need to use a {@link GL3} or {@link GL3bc} OpenGL 3.1+ context to benefit ClassJavadoc GL2 * from new functionality and versions. -ClassJavadoc GL2 * </P> +ClassJavadoc GL2 * </p> ClassJavadoc GL2 */ -ClassJavadoc GL3bc /** -ClassJavadoc GL3bc * <P> -ClassJavadoc GL3bc * This interface contains the OpenGL 3.x compatibility profile, ie includes all methods -ClassJavadoc GL3bc * as defined in {@link GL2} and {@link GL3}.<br> -ClassJavadoc GL3bc * </P> -ClassJavadoc GL3bc */ - ClassJavadoc GL3 /** -ClassJavadoc GL3 * <P> -ClassJavadoc GL3 * This interface contains all core, forward compatible, OpenGL methods starting from 3.1, -ClassJavadoc GL3 * inclusive, as well as most of it's extensions defined at the time of this specification.<br> +ClassJavadoc GL3 * <p> +ClassJavadoc GL3 * This interface contains the core, forward compatible, OpenGL methods of GL 3.x, with x >=1, +ClassJavadoc GL3 * as well as most of it's extensions defined at the time of this specification.<br/> ClassJavadoc GL3 * Note: OpenGL 3.0 forward compatible, non deprecated functionality is included in the -ClassJavadoc GL3 * 3.1 specification, hence the {@link GL2GL3} implemented interface.<br> -ClassJavadoc GL3 * Note: OpenGL 3.1 forward compatible no more includes fixed point functionality. -ClassJavadoc GL3 * </P> +ClassJavadoc GL3 * 3.1 specification, hence the {@link GL2GL3} implemented interface.<br/> +ClassJavadoc GL3 * Note: OpenGL 3.1 forward compatible, core profile abandoned fixed point functionality. +ClassJavadoc GL3 * </p> ClassJavadoc GL3 */ +ClassJavadoc GL3bc /** +ClassJavadoc GL3bc * <p> +ClassJavadoc GL3bc * This interface containing all core and compatibility OpenGL methods of GL 3.x, with x >= 1,<br/> +ClassJavadoc GL3bc * as well as most of it's extensions defined at the time of this specification. +ClassJavadoc GL3bc * </p> +ClassJavadoc GL3bc */ + +ClassJavadoc GL4 /** +ClassJavadoc GL4 * <p> +ClassJavadoc GL4 * This interface containing all core OpenGL methods of GL 4.x, with x >= 0,<br/> +ClassJavadoc GL4 * as well as most of it's extensions defined at the time of this specification. +ClassJavadoc GL4 * </p> +ClassJavadoc GL4 */ + +ClassJavadoc GL4bc /** +ClassJavadoc GL4bc * <p> +ClassJavadoc GL4bc * This interface containing all core and compatibility OpenGL methods of GL 4.x, with x >= 0,<br/> +ClassJavadoc GL4bc * as well as most of it's extensions defined at the time of this specification. +ClassJavadoc GL4bc * </p> +ClassJavadoc GL4bc */ + ClassJavadoc GLES1 /** -ClassJavadoc GLES1 * <P> +ClassJavadoc GLES1 * <p> ClassJavadoc GLES1 * This interface contains all core embedded OpenGL methods of ES 1.x, with x >= 0, -ClassJavadoc GLES1 * inclusive, as well as most of it's extensions defined at the -ClassJavadoc GLES1 * time of this specification. -ClassJavadoc GLES1 * </P> +ClassJavadoc GLES1 * as well as most of it's extensions defined at the time of this specification. +ClassJavadoc GLES1 * </p> ClassJavadoc GLES1 */ ClassJavadoc GLES2 /** -ClassJavadoc GLES2 * <P> +ClassJavadoc GLES2 * <p> ClassJavadoc GLES2 * This interface contains all core embedded OpenGL methods of ES 2.x, with x >= 0, -ClassJavadoc GLES2 * inclusive, as well as most of it's extensions defined at the -ClassJavadoc GLES2 * time of this specification. -ClassJavadoc GLES2 * </P> +ClassJavadoc GLES2 * inclusive, as well as most of it's extensions defined at the time of this specification. +ClassJavadoc GLES2 * </p> ClassJavadoc GLES2 */ +ClassJavadoc GLES3 /** +ClassJavadoc GLES3 * <p> +ClassJavadoc GLES3 * This interface contains all core embedded OpenGL methods of ES 3.x, with x >= 0, +ClassJavadoc GLES3 * inclusive, as well as most of it's extensions defined at the time of this specification. +ClassJavadoc GLES3 * </p> +ClassJavadoc GLES3 */ + # Javadoc for the EGL class ClassJavadoc EGL /** ClassJavadoc EGL * Provides access to the embedded-specific OpenGL vendor extensions. @@ -805,11 +878,3 @@ ClassJavadoc XVisualInfo * extensions. No other access is provided to these dat ClassJavadoc XVisualInfo * this wrapper is not useful to end users, though it is used in the implementation. ClassJavadoc XVisualInfo */ -# Custom code for querying extensions and exposing -# wglAllocateMemoryNV/glXAllocateMemoryNV -CustomJavaCode GL2GL3 /** -CustomJavaCode GL2GL3 * Provides platform-independent access to the <code>wglAllocateMemoryNV</code> / -CustomJavaCode GL2GL3 * <code>glXAllocateMemoryNV</code> extension. -CustomJavaCode GL2GL3 */ -CustomJavaCode GL2GL3 public java.nio.ByteBuffer glAllocateMemoryNV(int arg0, float arg1, float arg2, float arg3); - diff --git a/make/config/jogl/gl-desktop.cfg b/make/config/jogl/gl-desktop.cfg index a91f5ac5b..244271468 100644 --- a/make/config/jogl/gl-desktop.cfg +++ b/make/config/jogl/gl-desktop.cfg @@ -1,11 +1,6 @@ # This .cfg file provides common options used by the desktop OpenGL # implementation on all platforms. -# Inform the glue code generator of the association between #defines -# and functions and the extensions in which they are defined -GLHeader GL/gl.h -GLHeader GL/glext.h - #Include gl-desktop-tracker.cfg diff --git a/make/config/jogl/gl-es1.cfg b/make/config/jogl/gl-es1.cfg index 2a7b64dd3..b73b1a731 100644 --- a/make/config/jogl/gl-es1.cfg +++ b/make/config/jogl/gl-es1.cfg @@ -30,13 +30,6 @@ EmitProcAddressTable true ProcAddressTableClassName GLES1ProcAddressTable GetProcAddressTableExpr ((GLES1ProcAddressTable)_context.getGLProcAddressTable()) -# Inform the glue code generator of the association between #defines -# 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 # depend on the presence of an import library for a particular device @@ -49,11 +42,6 @@ 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 - # Add PixelStorei StateTracker # # Add input validation to glPixelStorei, just to be sure. diff --git a/make/config/jogl/gl-es2.cfg b/make/config/jogl/gl-es3.cfg index 8b6152bd0..997723d01 100644 --- a/make/config/jogl/gl-es2.cfg +++ b/make/config/jogl/gl-es3.cfg @@ -1,40 +1,45 @@ # This .cfg file is used to generate the GL interface and implementing class. JavaOutputDir gensrc/classes -NativeOutputDir gensrc/native/jogl/es2 +NativeOutputDir gensrc/native/jogl/es3 ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL.java ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL2ES2.java +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GLES2.java +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL2ES3.java +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL3ES3.java +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL4ES3.java ExtendedInterfaceSymbolsIgnore ../src/jogl/classes/javax/media/opengl/GLBase.java Package javax.media.opengl Style InterfaceAndImpl -JavaClass GLES2 -#Extends GLES2 GLBase -#Extends GLES2 GL -Extends GLES2 GL2ES2 -ImplPackage jogamp.opengl.es2 -ImplJavaClass GLES2Impl -Implements GLES2Impl GLBase -Implements GLES2Impl GL -Implements GLES2Impl GL2ES2 +JavaClass GLES3 +#Extends GLES3 GLBase +#Extends GLES3 GL +#Extends GLES3 GL2ES2 +#Extends GLES3 GL2ES3 +#Extends GLES3 GL3ES3 +Extends GLES3 GLES2 +Extends GLES3 GL4ES3 +ImplPackage jogamp.opengl.es3 +ImplJavaClass GLES3Impl +Implements GLES3Impl GLBase +Implements GLES3Impl GL +Implements GLES3Impl GL2ES2 +Implements GLES3Impl GLES2 +Implements GLES3Impl GL2ES3 +Implements GLES3Impl GL3ES3 +Implements GLES3Impl GL4ES3 HierarchicalNativeOutput false Include gl-common.cfg Include gl-common-extensions.cfg -Include gl2_es2-common.cfg +Include gl2_es3-common.cfg +Include gl2_es2-CustomJavaCode.cfg -RenameExtensionIntoCore GL_OES_texture_3D -RenameExtensionIntoCore GL_OES_get_program_binary +ForceExtension GL_ARB_ES3_compatibility EmitProcAddressTable true -ProcAddressTableClassName GLES2ProcAddressTable -GetProcAddressTableExpr ((GLES2ProcAddressTable)_context.getGLProcAddressTable()) - -# Inform the glue code generator of the association between #defines -# 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 +ProcAddressTableClassName GLES3ProcAddressTable +GetProcAddressTableExpr ((GLES3ProcAddressTable)_context.getGLProcAddressTable()) # 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 @@ -51,7 +56,7 @@ TagNativeBinding true # Add PixelStorei StateTracker # # Add input validation to glPixelStorei, just to be sure. -CustomJavaCode GLES2Impl private static final int params_offset = 0; // just a helper for JavaPrologue .. +CustomJavaCode GLES3Impl private static final int params_offset = 0; // just a helper for JavaPrologue .. JavaPrologue glPixelStorei if (pname != GL_PACK_ALIGNMENT && pname != GL_UNPACK_ALIGNMENT) { JavaPrologue glPixelStorei throw new GLException("Unsupported pixel store parameter name 0x" + Integer.toHexString(pname)); @@ -60,8 +65,6 @@ JavaPrologue glPixelStorei glStateTracker.setInt(pname, param); JavaPrologue glGetIntegerv if ( glStateTracker.getInt(pname, params, params_offset) ) { return; } -IncludeAs CustomJavaCode GLES2 gl-if-CustomJavaCode-gles2.java - CustomCCode #include <stdio.h> /* android */ CustomCCode /* Define GL_GLEXT_PROTOTYPES so that the OpenGL extension prototypes in CustomCCode "glext.h" are parsed. */ @@ -69,19 +72,24 @@ CustomCCode #define GL_GLEXT_PROTOTYPES CustomCCode /* Include the OpenGL headers */ CustomCCode /* #define GL_APICALL __declspec(dllimport) */ -CustomCCode #include <GLES2/gl2.h> +CustomCCode #include <GLES3/gl3.h> +CustomCCode #include <GLES3/gl3ext.h> CustomCCode #include <GLES2/gl2ext.h> CustomCCode #include <stdlib.h> -IncludeAs CustomJavaCode GLES2Impl gl-impl-CustomJavaCode-common.java -IncludeAs CustomJavaCode GLES2Impl gl-impl-CustomJavaCode-gles2.java -IncludeAs CustomJavaCode GLES2Impl gl-impl-CustomJavaCode-embedded.java -IncludeAs CustomJavaCode GLES2Impl gl-impl-CustomJavaCode-gl2_es2.java -IncludeAs CustomCCode gl-impl-CustomCCode-gles2.c - -Import javax.media.opengl.GLES1 -Import javax.media.opengl.GLES2 -Import javax.media.opengl.GL2 +IncludeAs CustomJavaCode GLES3Impl gl-impl-CustomJavaCode-common.java +IncludeAs CustomJavaCode GLES3Impl gl-impl-CustomJavaCode-gles3.java +IncludeAs CustomJavaCode GLES3Impl gl-impl-CustomJavaCode-embedded.java +IncludeAs CustomJavaCode GLES3Impl gl-impl-CustomJavaCode-gl2_es2.java +IncludeAs CustomCCode gl-impl-CustomCCode-gles3.c + +Import javax.media.opengl.GLBase +Import javax.media.opengl.GL +Import javax.media.opengl.GL2ES2 +Import javax.media.opengl.GL2ES3 +Import javax.media.opengl.GL3ES3 +Import javax.media.opengl.GL4ES3 +Import javax.media.opengl.GLES3 Import javax.media.opengl.GLArrayData Import javax.media.opengl.GLUniformData Import com.jogamp.common.nio.Buffers diff --git a/make/config/jogl/gl-gl4bc.cfg b/make/config/jogl/gl-gl4bc.cfg index ce6883106..d1bd85641 100644 --- a/make/config/jogl/gl-gl4bc.cfg +++ b/make/config/jogl/gl-gl4bc.cfg @@ -5,6 +5,9 @@ NativeOutputDir gensrc/native/jogl/gl4 ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL.java ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL2ES1.java ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL2ES2.java +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL2ES3.java +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL3ES3.java +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL4ES3.java ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL2GL3.java ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL2.java ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL3.java @@ -22,6 +25,9 @@ JavaClass GL4bc #Extends GL4bc GL #Extends GL4bc GL2ES1 #Extends GL4bc GL2ES2 +#Extends GL4bc GL2ES3 +#Extends GL4bc GL3ES3 +#Extends GL4bc GL4ES3 #Extends GL4bc GL2GL3 #Extends GL4bc GL2 #Extends GL4bc GL3 @@ -33,6 +39,9 @@ Implements GL4bcImpl GLBase Implements GL4bcImpl GL Implements GL4bcImpl GL2ES1 Implements GL4bcImpl GL2ES2 +Implements GL4bcImpl GL2ES3 +Implements GL4bcImpl GL3ES3 +Implements GL4bcImpl GL4ES3 Implements GL4bcImpl GL2GL3 Implements GL4bcImpl GL2 Implements GL4bcImpl GL3 @@ -43,7 +52,8 @@ Include gl-common.cfg Include gl-common-extensions.cfg Include gl-desktop.cfg Include gl3-desktop.cfg -Include gl2_es2-common.cfg +Include gl3-common.cfg +Include gl2_es2-CustomJavaCode.cfg # Manually implement glMapNamedBufferEXT as the size of the returned buffer # can only be computed by calling another routine @@ -52,7 +62,7 @@ ForceProcAddressGen glMapNamedBufferEXT JavaEpilogue glNamedBufferDataEXT bufferSizeTracker.setDirectStateBufferSize({0}, this, {1}); # Manuall implement glDebugMessageCallback* using the proc address resolver -ForceProcAddressGen glDebugMessageCallbackARB +ForceProcAddressGen glDebugMessageCallback ForceProcAddressGen glDebugMessageCallbackAMD # Force all of the methods to be emitted using dynamic linking so we @@ -81,18 +91,22 @@ JavaPrologue glPixelStorei glStateTracker.setInt(pname, param); JavaPrologue glGetIntegerv if ( glStateTracker.getInt(pname, params, params_offset) ) { return; } -CustomJavaCode GL4bcImpl public void glFrustumf(float left, float right, float bottom, float top, float zNear, float zFar) { -CustomJavaCode GL4bcImpl glFrustum((double)left, (double)right, (double)bottom, (double)top, (double)zNear, (double)zFar); } +JavaPrologue glFrustumf if ( !_context.hasFP32CompatAPI() ) { +JavaPrologue glFrustumf glFrustum((double)left, (double)right, (double)bottom, (double)top, (double)zNear, (double)zFar); +JavaPrologue glFrustumf return; +JavaPrologue glFrustumf } -CustomJavaCode GL4bcImpl public void glOrthof(float left, float right, float bottom, float top, float zNear, float zFar) { -CustomJavaCode GL4bcImpl glOrtho((double)left, (double)right, (double)bottom, (double)top, (double)zNear, (double)zFar); } +JavaPrologue glOrthof if ( !_context.hasFP32CompatAPI() ) { +JavaPrologue glOrthof glOrtho((double)left, (double)right, (double)bottom, (double)top, (double)zNear, (double)zFar); +JavaPrologue glOrthof return; +JavaPrologue glOrthof } -JavaPrologue glDepthRangef if ( !_context.isGLES2Compatible() ) { +JavaPrologue glDepthRangef if ( !_context.isGLES2Compatible() && !_context.hasFP32CompatAPI() ) { JavaPrologue glDepthRangef glDepthRange( (double)zNear, (double)zFar ); JavaPrologue glDepthRangef return; JavaPrologue glDepthRangef } -JavaPrologue glClearDepthf if ( !_context.isGLES2Compatible() ) { +JavaPrologue glClearDepthf if ( !_context.isGLES2Compatible() && !_context.hasFP32CompatAPI() ) { JavaPrologue glClearDepthf glClearDepth( (double)depth ); JavaPrologue glClearDepthf return; JavaPrologue glClearDepthf } @@ -102,12 +116,16 @@ Include gl3ext-headers.cfg IncludeAs CustomJavaCode GL4bcImpl gl-impl-CustomJavaCode-common.java IncludeAs CustomJavaCode GL4bcImpl gl-impl-CustomJavaCode-gl4bc.java -IncludeAs CustomJavaCode GL4bcImpl gl-impl-CustomJavaCode-desktop.java IncludeAs CustomJavaCode GL4bcImpl gl-impl-CustomJavaCode-gl2_es2.java IncludeAs CustomCCode gl-impl-CustomCCode-gl4bc.c Import javax.media.opengl.GLES1 Import javax.media.opengl.GLES2 +Import javax.media.opengl.GL2ES1 +Import javax.media.opengl.GL2ES2 +Import javax.media.opengl.GL2ES3 +Import javax.media.opengl.GL3ES3 +Import javax.media.opengl.GL4ES3 Import javax.media.opengl.GL2GL3 Import javax.media.opengl.GL2 Import javax.media.opengl.GL3 diff --git a/make/config/jogl/gl-headers.cfg b/make/config/jogl/gl-headers.cfg index b80630c63..62f5e8dd4 100644 --- a/make/config/jogl/gl-headers.cfg +++ b/make/config/jogl/gl-headers.cfg @@ -1,7 +1,6 @@ CustomCCode #include <gluegen_stdint.h> CustomCCode #include <stdio.h> /* android */ -CustomCCode /* Define GL_GLEXT_PROTOTYPES so that the OpenGL extension prototypes in -CustomCCode "glext.h" are parsed. */ +CustomCCode /** Define GL_GLEXT_PROTOTYPES so that the OpenGL extension prototypes are parsed. */ CustomCCode #define GL_GLEXT_PROTOTYPES CustomCCode #if defined(_WIN32) CustomCCode #define WIN32_LEAN_AND_MEAN diff --git a/make/config/jogl/gl-if-CustomJavaCode-gl2_gl3.java b/make/config/jogl/gl-if-CustomJavaCode-es3.java index 97fd6c4a6..0a1c43085 100644 --- a/make/config/jogl/gl-if-CustomJavaCode-gl2_gl3.java +++ b/make/config/jogl/gl-if-CustomJavaCode-es3.java @@ -8,3 +8,7 @@ public static final long GL_TIMEOUT_IGNORED = 0xFFFFFFFFFFFFFFFFL ; /** Part of <code>GL_ARB_shader_image_load_store</code> */ public static final int GL_ALL_BARRIER_BITS = 0xFFFFFFFF ; +public boolean glIsPBOPackEnabled(); + +public boolean glIsPBOUnpackEnabled(); + diff --git a/make/config/jogl/gl-if-CustomJavaCode-gl.java b/make/config/jogl/gl-if-CustomJavaCode-gl.java index 9ea4f98b4..f9f33eec9 100644 --- a/make/config/jogl/gl-if-CustomJavaCode-gl.java +++ b/make/config/jogl/gl-if-CustomJavaCode-gl.java @@ -57,3 +57,11 @@ earmarked for ES 3.0 (hence kept in GL while fixing Bug 590) */ public static final int GL_HALF_FLOAT = 0x140B; + /** Part of <code>GL_VERSION_1_4</code>, <code>GL_ES_VERSION_2_0</code>, <code>GL_OES_required_internalformat</code>. */ + public static final int GL_DEPTH_COMPONENT16 = 0x81A5; + /** Part of <code>GL_VERSION_1_0</code>, <code>GL_OES_element_index_uint</code>, <code>GL_ES_VERSION_2_0</code> */ + public static final int GL_UNSIGNED_INT = 0x1405; + /** Part of <code>GL_VERSION_1_0</code>, <code>GL_ES_VERSION_2_0</code> */ + public static final int GL_UNSIGNED_SHORT = 0x1403; + + diff --git a/make/config/jogl/gl-if-CustomJavaCode-gl2_es2.java b/make/config/jogl/gl-if-CustomJavaCode-gl2_es2.java index 4522d34c8..5ad235de5 100644 --- a/make/config/jogl/gl-if-CustomJavaCode-gl2_es2.java +++ b/make/config/jogl/gl-if-CustomJavaCode-gl2_es2.java @@ -39,10 +39,21 @@ * <br> Calls <code> void {@native glDepthRange}(GLclampd zNear, GLclampd zFar); </code> if no native implementation is available. */ public void glDepthRangef(float zNear, float zFar); + public void glDepthRange(double zNear, double zFar); + /** Entry point to C language function: * <code> void {@native glClearDepthf}(GLclampf depth); </code> * <br>Part of <code>GL_ES_VERSION_2_0</code> and <code>GL_ARB_ES2_compatibility</code>. * <br> Calls <code> void {@native glClearDepth}(GLclampd depth); </code> if no native implementation is available. */ public void glClearDepthf(float depth); + public void glClearDepth( double depth ); + + public void glVertexAttribPointer(GLArrayData array); + + public void glUniform(GLUniformData data); + + /** Part of <code>GL_VERSION_1_0</code>, <code>GL_ES_VERSION_2_0</code>, <code>GL_ANGLE_depth_texture</code> */ + public static final int GL_DEPTH_COMPONENT = 0x1902; + /** End: GL_ARB_ES2_compatibility functions, which are part of ES2 core as well */ diff --git a/make/config/jogl/gl-if-CustomJavaCode-gl_compat.java b/make/config/jogl/gl-if-CustomJavaCode-gl_compat.java new file mode 100644 index 000000000..22ae54cbe --- /dev/null +++ b/make/config/jogl/gl-if-CustomJavaCode-gl_compat.java @@ -0,0 +1,20 @@ + +/** + * Part of <code>GL_NV_vertex_array_range</code>. + * <p> + * Provides platform-independent access to the <code>wglAllocateMemoryNV</code> / + * <code>glXAllocateMemoryNV</code>. + * </p> + */ +public java.nio.ByteBuffer glAllocateMemoryNV(int size, float readFrequency, float writeFrequency, float priority); + +/** + * Part of <code>GL_NV_vertex_array_range</code>. + * <p> + * Provides platform-independent access to the <code>wglFreeMemoryNV</code> / + * <code>glXFreeMemoryNV</code>. + * </p> + */ +public void glFreeMemoryNV(java.nio.ByteBuffer pointer); + + diff --git a/make/config/jogl/gl-if-CustomJavaCode-gles2.java b/make/config/jogl/gl-if-CustomJavaCode-gles2.java deleted file mode 100644 index ea40f6329..000000000 --- a/make/config/jogl/gl-if-CustomJavaCode-gles2.java +++ /dev/null @@ -1,3 +0,0 @@ - - public static final int GL_NVIDIA_PLATFORM_BINARY_NV = 0x890B; - diff --git a/make/config/jogl/gl-if-es2.cfg b/make/config/jogl/gl-if-es2.cfg new file mode 100644 index 000000000..aabd2d5a7 --- /dev/null +++ b/make/config/jogl/gl-if-es2.cfg @@ -0,0 +1,30 @@ +# This .cfg file is used to generate the GL interface and implementing class. +JavaOutputDir gensrc/classes +NativeOutputDir gensrc/native/jogl/es2 + +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL.java +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL2ES2.java +ExtendedInterfaceSymbolsIgnore ../src/jogl/classes/javax/media/opengl/GLBase.java + +Package javax.media.opengl +Style InterfaceOnly +JavaClass GLES2 +#Extends GLES2 GLBase +#Extends GLES2 GL +Extends GLES2 GL2ES2 +Include gl-common.cfg +Include gl-common-extensions.cfg +Include gl2_es2-common.cfg +Include gl2_es2-CustomJavaCode.cfg + +# Pick up on-line OpenGL javadoc thanks to user cylab on javagaming.org forums +TagNativeBinding true + +# dummy procaddress config / force procaddress for comments +EmitProcAddressTable false +ProcAddressTableClassName DontGenerateProcAddressTableStuff +GetProcAddressTableExpr DontGenerateProcAddressTableStuff +ForceProcAddressGen __ALL__ + +CustomJavaCode GLES2 public static final int GL_NVIDIA_PLATFORM_BINARY_NV = 0x890B; + diff --git a/make/config/jogl/gl-if-gl-ignores.cfg b/make/config/jogl/gl-if-gl-ignores.cfg index 25fbd5a6f..e6513cadb 100644 --- a/make/config/jogl/gl-if-gl-ignores.cfg +++ b/make/config/jogl/gl-if-gl-ignores.cfg @@ -13,6 +13,7 @@ DropUniqVendorExtensions IMG DropUniqVendorExtensions QCOM DropUniqVendorExtensions NV DropUniqVendorExtensions VIV +DropUniqVendorExtensions FJ IgnoreExtension GL_EXT_discard_framebuffer IgnoreExtension GL_OES_compressed_paletted_texture @@ -34,11 +35,14 @@ IgnoreExtension GL_EXT_multisampled_render_to_texture IgnoreExtension GL_EXT_framebuffer_multisample IgnoreExtension GL_OES_texture_half_float IgnoreExtension GL_OES_vertex_half_float -# IgnoreExtension GL_EXT_texture_storage IgnoreExtension GL_NV_draw_buffers IgnoreExtension GL_NV_fbo_color_attachments IgnoreExtension GL_OES_vertex_array_object IgnoreExtension GL_OES_texture_3D +IgnoreExtension GL_OES_surfaceless_context +IgnoreExtension GL_OES_required_internalformat +IgnoreExtension GL_EXT_unpack_subimage +IgnoreExtension GL_KHR_debug # includes GL_STATE_RESTORE, which hasn't the QCOM suffix IgnoreExtension GL_QCOM_extended_get @@ -46,12 +50,8 @@ Ignore GL_STATE_RESTORE # above ext mightbe subsumed, ignore the aliased ones Ignore GL_ACTIVE_PROGRAM -Ignore GL_ALPHA16F -Ignore GL_ALPHA32F -Ignore GL_ALPHA8 Ignore GL_ANY_SAMPLES_PASSED Ignore GL_ANY_SAMPLES_PASSED_CONSERVATIVE -Ignore GL_BGRA8 Ignore GL_BGRA8_EXT Ignore GL_BUFFER_OBJECT_EXT Ignore GL_COLOR_ATTACHMENT1 @@ -93,12 +93,6 @@ Ignore GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING Ignore GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE Ignore GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT Ignore GL_INT_10_10_10_2 -Ignore GL_LUMINANCE16F -Ignore GL_LUMINANCE32F -Ignore GL_LUMINANCE8 -Ignore GL_LUMINANCE8_ALPHA8 -Ignore GL_LUMINANCE_ALPHA16F -Ignore GL_LUMINANCE_ALPHA32F Ignore GL_MAX_COLOR_ATTACHMENTS Ignore GL_MAX_DRAW_BUFFERS Ignore GL_PROGRAM_OBJECT_EXT @@ -108,15 +102,15 @@ Ignore GL_PROGRAM_SEPARABLE Ignore GL_QUERY_OBJECT_EXT Ignore GL_QUERY_RESULT Ignore GL_QUERY_RESULT_AVAILABLE +Ignore GL_R32F Ignore GL_R16F Ignore GL_R8 Ignore GL_RED Ignore GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES Ignore GL_RG +Ignore GL_RG32F Ignore GL_RG16F Ignore GL_RG8 -Ignore GL_RGB16F -Ignore GL_RGBA16F Ignore GL_SAMPLER_2D_SHADOW Ignore GL_SAMPLER_EXTERNAL_OES Ignore GL_SHADER_BINARY_DMP @@ -530,13 +524,9 @@ Ignore glFogxvOES Ignore glFramebufferVertexAttribArrayNV Ignore glFrustumf Ignore glFrustumfOES -#Ignore glGenerateMipmap -#Ignore glGenerateMipmapOES Ignore glGetActiveAttrib Ignore glGetActiveUniform Ignore glGetAttachedShaders -Ignore glGetClipPlanef -Ignore glGetClipPlanefOES Ignore glGetFixedv Ignore glGetFixedvOES Ignore glGetLightfv diff --git a/make/config/jogl/gl-if-gl.cfg b/make/config/jogl/gl-if-gl.cfg index 89233330a..4137cae8e 100644 --- a/make/config/jogl/gl-if-gl.cfg +++ b/make/config/jogl/gl-if-gl.cfg @@ -10,8 +10,8 @@ HierarchicalNativeOutput false Include gl-common.cfg Include gl-common-extensions.cfg Include gl-if-gl-ignores.cfg -Include gl-if-gl3-ignores.cfg -Include gl-if-gl4-ignores.cfg +Include gl-if-gl2_es2-ignores.cfg +Include gl-if-luminance-ignore.cfg JavaOutputDir gensrc/classes NativeOutputDir gensrc/native/jogl @@ -27,14 +27,6 @@ ProcAddressTableClassName DontGenerateProcAddressTableStuff GetProcAddressTableExpr DontGenerateProcAddressTableStuff ForceProcAddressGen __ALL__ -# Inform the glue code generator of the association between #defines -# and functions and the extensions in which they are defined. -# This also gives a better API doc since it includes all extension names. -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.cfg b/make/config/jogl/gl-if-gl2.cfg index c58b73dfd..60efd73af 100644 --- a/make/config/jogl/gl-if-gl2.cfg +++ b/make/config/jogl/gl-if-gl2.cfg @@ -25,6 +25,8 @@ Include gl-desktop.cfg Include gl-if-gl3-ignores.cfg Include gl-if-gl4-ignores.cfg +IncludeAs CustomJavaCode GL2 gl-if-CustomJavaCode-gl_compat.java + # Pick up on-line OpenGL javadoc thanks to user cylab on javagaming.org forums TagNativeBinding true @@ -37,8 +39,5 @@ ForceProcAddressGen __ALL__ # Ignore extensions that are already picked up via the GL2ES1 interface IgnoreExtension GL_EXT_point_parameters -CustomJavaCode GL2 public boolean glIsPBOPackEnabled(); -CustomJavaCode GL2 public boolean glIsPBOUnpackEnabled(); - Include gl-headers.cfg diff --git a/make/config/jogl/gl-if-gl2_es1.cfg b/make/config/jogl/gl-if-gl2_es1.cfg index ad8bbea7d..04d78f51e 100644 --- a/make/config/jogl/gl-if-gl2_es1.cfg +++ b/make/config/jogl/gl-if-gl2_es1.cfg @@ -17,6 +17,7 @@ ExtendedInterfaceSymbolsIgnore ../src/jogl/classes/javax/media/opengl/fixedfunc/ HierarchicalNativeOutput false Include gl-common.cfg Include gl-common-extensions.cfg +Include gl-if-luminance-ignore.cfg JavaOutputDir gensrc/classes NativeOutputDir gensrc/native/jogl @@ -39,11 +40,11 @@ IgnoreExtension GL_OES_EGL_image_external 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 +IgnoreExtension GL_OES_matrix_palette IgnoreExtension GL_EXT_debug_marker IgnoreExtension GL_EXT_debug_label @@ -55,11 +56,6 @@ IgnoreExtension GL_QCOM_extended_get Ignore GL_STATE_RESTORE Ignore GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET -Ignore glGetFixedv - -# Ignore OES variants of single precision floating point routines -IgnoreExtension GL_OES_single_precision - # Ignore fixed point versions of routines in ES 1.x core Ignore glAlphaFuncx Ignore glClearColorx @@ -68,18 +64,28 @@ Ignore glClipPlanex Ignore glColor4x Ignore glDepthRangex Ignore glFogx +Ignore glFogxv Ignore glFrustumx Ignore glGetClipPlanex +Ignore glGetFixedv +Ignore glGetLightxv +Ignore glGetMaterialxv +Ignore glGetTexEnvxv +Ignore glGetTexParameterxv Ignore glLightModelx +Ignore glLightModelxv Ignore glLightx +Ignore glLightxv Ignore glLineWidthx Ignore glLoadMatrixx Ignore glMaterialx +Ignore glMaterialxv Ignore glMultMatrixx Ignore glMultiTexCoord4x Ignore glNormal3x Ignore glOrthox Ignore glPointParameterx +Ignore glPointParameterxv Ignore glPointSizex Ignore glPolygonOffsetx Ignore glQueryMatrixx @@ -87,21 +93,19 @@ Ignore glRotatex Ignore glSampleCoveragex Ignore glScalex Ignore glTexEnvx +Ignore glTexEnvxv Ignore glTexGenx Ignore glTexParameterx +Ignore glTexParameterxv Ignore glTranslatex #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); CustomJavaCode GL2ES1 public void glFrustum(double left, double right, double bottom, double top, double zNear, double zFar); @@ -112,13 +116,6 @@ ProcAddressTableClassName DontGenerateProcAddressTableStuff GetProcAddressTableExpr DontGenerateProcAddressTableStuff ForceProcAddressGen __ALL__ -# Inform the glue code generator of the association between #defines -# 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-ignores.cfg b/make/config/jogl/gl-if-gl2_es2-ignores.cfg new file mode 100644 index 000000000..f08d8a51b --- /dev/null +++ b/make/config/jogl/gl-if-gl2_es2-ignores.cfg @@ -0,0 +1,48 @@ +# Ignore all ES 2.X only stuff .. +DropUniqVendorExtensions ANGLE +DropUniqVendorExtensions ARM +DropUniqVendorExtensions APPLE +DropUniqVendorExtensions ATI +DropUniqVendorExtensions IMG +DropUniqVendorExtensions QCOM +DropUniqVendorExtensions NV +DropUniqVendorExtensions VIV + +Ignore glEGL.* + +IgnoreExtension GL_AMD_compressed_3DC_texture +IgnoreExtension GL_AMD_compressed_ATC_texture +IgnoreExtension GL_AMD_program_binary_Z400 +IgnoreExtension GL_AMD_performance_monitor + +IgnoreExtension GL_KHR_texture_compression_astc_ldr +IgnoreExtension GL_ANGLE_depth_texture +IgnoreExtension GL_ANGLE_instanced_arrays +IgnoreExtension GL_ANGLE_pack_reverse_row_order +IgnoreExtension GL_ANGLE_program_binary +IgnoreExtension GL_ANGLE_texture_compression_dxt3 +IgnoreExtension GL_ANGLE_texture_compression_dxt5 +IgnoreExtension GL_ANGLE_texture_usage +IgnoreExtension GL_ANGLE_translated_shader_source +IgnoreExtension GL_EXT_debug_label +IgnoreExtension GL_EXT_debug_marker +IgnoreExtension GL_EXT_discard_framebuffer +IgnoreExtension GL_EXT_disjoint_timer_query +IgnoreExtension GL_EXT_draw_buffers +IgnoreExtension GL_EXT_multiview_draw_buffers +IgnoreExtension GL_EXT_multisampled_render_to_texture +IgnoreExtension GL_EXT_shader_framebuffer_fetch +IgnoreExtension GL_FJ_shader_binary_GCCSO +IgnoreExtension GL_OES_compressed_paletted_texture +IgnoreExtension GL_OES_compressed_ETC1_RGB8_texture +IgnoreExtension GL_OES_vertex_array_object +IgnoreExtension GL_OES_vertex_half_float +IgnoreExtension GL_OES_surfaceless_context +IgnoreExtension GL_OES_texture_half_float +IgnoreExtension GL_OES_EGL_image_external + +# includes GL_STATE_RESTORE, which hasn't the QCOM suffix +IgnoreExtension GL_QCOM_extended_get +Ignore GL_STATE_RESTORE + +Ignore GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET diff --git a/make/config/jogl/gl-if-gl2_es2.cfg b/make/config/jogl/gl-if-gl2_es2.cfg index 85e799298..0ad140eb2 100644 --- a/make/config/jogl/gl-if-gl2_es2.cfg +++ b/make/config/jogl/gl-if-gl2_es2.cfg @@ -14,45 +14,9 @@ Extends GL2ES2 GL HierarchicalNativeOutput false Include gl-common.cfg Include gl-common-extensions.cfg -Include gl-if-gl3-ignores.cfg -Include gl-if-gl4-ignores.cfg - -RenameExtensionIntoCore GL_OES_texture_3D -RenameExtensionIntoCore GL_OES_get_program_binary - -# Ignore all ES 2.X only stuff .. -DropUniqVendorExtensions AMD -DropUniqVendorExtensions ANGLE -DropUniqVendorExtensions ARM -DropUniqVendorExtensions APPLE -DropUniqVendorExtensions ATI -DropUniqVendorExtensions IMG -DropUniqVendorExtensions QCOM -DropUniqVendorExtensions NV -DropUniqVendorExtensions VIV - -IgnoreExtension GL_EXT_discard_framebuffer -IgnoreExtension GL_OES_compressed_paletted_texture -IgnoreExtension GL_OES_compressed_ETC1_RGB8_texture -IgnoreExtension GL_OES_vertex_array_object -IgnoreExtension GL_OES_texture_half_float -IgnoreExtension GL_OES_vertex_half_float -IgnoreExtension GL_OES_EGL_image_external -IgnoreExtension GL_EXT_debug_marker -IgnoreExtension GL_EXT_debug_label -IgnoreExtension GL_EXT_multisampled_render_to_texture - -# isn't included in GL2 -# includes GL_STATE_RESTORE, which hasn't the QCOM suffix -IgnoreExtension GL_QCOM_extended_get -Ignore GL_STATE_RESTORE -Ignore GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET - -# Ignore ^gl.*x(v)?(OES)? -Ignore glEGL.* -#Ignore glFramebufferVertexAttribArrayNV -#Ignore glCoverageOperationNV -#Ignore glCoverageMaskNV +Include gl2_es2-common.cfg +Include gl-if-gl2_es2-ignores.cfg +Include gl-if-luminance-ignore.cfg # Ignore GL_ARB_ES2_compatibility functions for interface code generation # since we need our own javadoc header for a detailed description @@ -62,9 +26,6 @@ Ignore glGetShaderPrecisionFormat Ignore glDepthRangef Ignore glClearDepthf -CustomJavaCode GL2ES2 public void glClearDepth( double depth ); -CustomJavaCode GL2ES2 public void glDepthRange(double zNear, double zFar); - IncludeAs CustomJavaCode GL2ES2 gl-if-CustomJavaCode-gl2_es2.java # dummy procaddress config / force procaddress for comments @@ -73,20 +34,8 @@ ProcAddressTableClassName DontGenerateProcAddressTableStuff GetProcAddressTableExpr DontGenerateProcAddressTableStuff ForceProcAddressGen __ALL__ -# Inform the glue code generator of the association between #defines -# and functions and the extensions in which they are defined -# This also gives a better API doc since it includes all extension names. -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 -CustomJavaCode GL2ES2 public void glVertexAttribPointer(GLArrayData array); -CustomJavaCode GL2ES2 public void glUniform(GLUniformData data); -CustomJavaCode GL2ES2 - Import java.io.PrintStream diff --git a/make/config/jogl/gl-if-gl2_es3-ignores.cfg b/make/config/jogl/gl-if-gl2_es3-ignores.cfg new file mode 100644 index 000000000..172857840 --- /dev/null +++ b/make/config/jogl/gl-if-gl2_es3-ignores.cfg @@ -0,0 +1,47 @@ +# Ignore all ES 3.X only stuff .. +DropUniqVendorExtensions ANGLE +DropUniqVendorExtensions ARM +DropUniqVendorExtensions APPLE +DropUniqVendorExtensions ATI +DropUniqVendorExtensions IMG +DropUniqVendorExtensions QCOM +DropUniqVendorExtensions NV +DropUniqVendorExtensions VIV + +Ignore glEGL.* + +IgnoreExtension GL_AMD_compressed_3DC_texture +IgnoreExtension GL_AMD_compressed_ATC_texture +IgnoreExtension GL_AMD_program_binary_Z400 +IgnoreExtension GL_AMD_performance_monitor + +IgnoreExtension GL_ANGLE_depth_texture +IgnoreExtension GL_ANGLE_instanced_arrays +IgnoreExtension GL_ANGLE_pack_reverse_row_order +IgnoreExtension GL_ANGLE_program_binary +IgnoreExtension GL_ANGLE_texture_compression_dxt3 +IgnoreExtension GL_ANGLE_texture_compression_dxt5 +IgnoreExtension GL_ANGLE_texture_usage +IgnoreExtension GL_ANGLE_translated_shader_source +IgnoreExtension GL_EXT_debug_label +IgnoreExtension GL_EXT_debug_marker +IgnoreExtension GL_EXT_discard_framebuffer +IgnoreExtension GL_EXT_disjoint_timer_query +IgnoreExtension GL_EXT_draw_buffers +IgnoreExtension GL_EXT_multisampled_render_to_texture +IgnoreExtension GL_EXT_multiview_draw_buffers +IgnoreExtension GL_EXT_shader_framebuffer_fetch +IgnoreExtension GL_OES_compressed_paletted_texture +IgnoreExtension GL_OES_compressed_ETC1_RGB8_texture +IgnoreExtension GL_OES_vertex_array_object +IgnoreExtension GL_OES_vertex_half_float +IgnoreExtension GL_OES_surfaceless_context +IgnoreExtension GL_OES_texture_half_float +IgnoreExtension GL_OES_EGL_image_external +IgnoreExtension GL_FJ_shader_binary_GCCSO + +# includes GL_STATE_RESTORE, which hasn't the QCOM suffix +IgnoreExtension GL_QCOM_extended_get +Ignore GL_STATE_RESTORE + +Ignore GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET diff --git a/make/config/jogl/gl-if-gl2_es3.cfg b/make/config/jogl/gl-if-gl2_es3.cfg new file mode 100644 index 000000000..f44c9b393 --- /dev/null +++ b/make/config/jogl/gl-if-gl2_es3.cfg @@ -0,0 +1,45 @@ +# This .cfg file is used to generate the GL interface and implementing class. +JavaOutputDir gensrc/classes +NativeOutputDir gensrc/native/jogl + +Package javax.media.opengl +Style InterfaceOnly +JavaClass GL2ES3 +#Extends GL2ES3 GLBase +#Extends GL2ES3 GL +Extends GL2ES3 GL2ES2 + +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL.java +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL2ES2.java +ExtendedInterfaceSymbolsIgnore ../src/jogl/classes/javax/media/opengl/GLBase.java + +ExtendedInterfaceSymbolsOnly ../build-temp/gluegen-set/javax/media/opengl/GL2ES3Subset.java + +HierarchicalNativeOutput false +Include gl-common.cfg +Include gl-common-extensions.cfg +Include gl2_es3-common.cfg +Include gl-if-gl2_es3-ignores.cfg +Include gl-if-gl4-ignores.cfg +Include gl-if-luminance-ignore.cfg + +IncludeAs CustomJavaCode GL2ES3 gl-if-CustomJavaCode-es3.java + +# +# Same name but different signature .. +# No collisions found .. good! + +# dummy procaddress config / force procaddress for comments +EmitProcAddressTable false +ProcAddressTableClassName DontGenerateProcAddressTableStuff +GetProcAddressTableExpr DontGenerateProcAddressTableStuff +ForceProcAddressGen __ALL__ + +# Also force the calling conventions of the locally generated function +# pointer typedefs for these routines to APIENTRY +LocalProcAddressCallingConvention __ALL__ APIENTRY + +# Pick up on-line OpenGL javadoc thanks to user cylab on javagaming.org forums +TagNativeBinding true + +Import java.io.PrintStream diff --git a/make/config/jogl/gl-if-gl2_gl3.cfg b/make/config/jogl/gl-if-gl2_gl3.cfg index 0c51dfe9c..467919328 100644 --- a/make/config/jogl/gl-if-gl2_gl3.cfg +++ b/make/config/jogl/gl-if-gl2_gl3.cfg @@ -4,21 +4,23 @@ Style InterfaceOnly JavaClass GL2GL3 #Extends GL2GL3 GLBase #Extends GL2GL3 GL -Extends GL2GL3 GL2ES2 +#Extends GL2GL3 GL2ES2 +Extends GL2GL3 GL2ES3 ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL.java ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL2ES2.java +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL2ES3.java ExtendedInterfaceSymbolsIgnore ../src/jogl/classes/javax/media/opengl/GLBase.java -ExtendedInterfaceSymbolsOnly ../build-temp/gluegen-set/javax/media/opengl/GL3Subset.java +ExtendedInterfaceSymbolsOnly ../build-temp/gluegen-set/javax/media/opengl/GL2GL3Subset.java HierarchicalNativeOutput false Include gl-common.cfg Include gl-common-extensions.cfg Include gl-desktop.cfg +Include gl3-common.cfg Include gl-if-gl4-ignores.cfg - -IncludeAs CustomJavaCode GL2GL3 gl-if-CustomJavaCode-gl2_gl3.java +Include gl-if-luminance-ignore.cfg JavaOutputDir gensrc/classes NativeOutputDir gensrc/native/jogl @@ -33,11 +35,6 @@ ProcAddressTableClassName DontGenerateProcAddressTableStuff GetProcAddressTableExpr DontGenerateProcAddressTableStuff ForceProcAddressGen __ALL__ -# Inform the glue code generator of the association between #defines -# and functions and the extensions in which they are defined -GLHeader GL/gl.h -GLHeader GL/glext.h - # Also force the calling conventions of the locally generated function # pointer typedefs for these routines to APIENTRY LocalProcAddressCallingConvention __ALL__ APIENTRY diff --git a/make/config/jogl/gl-if-gl2es3-subset.cfg b/make/config/jogl/gl-if-gl2es3-subset.cfg new file mode 100644 index 000000000..3e325e065 --- /dev/null +++ b/make/config/jogl/gl-if-gl2es3-subset.cfg @@ -0,0 +1,17 @@ +# This .cfg file is used to generate the common GL2 ES3 set +JavaOutputDir ../../build-temp/gluegen-set + +Package javax.media.opengl +Style InterfaceOnly +JavaClass GL2ES3Subset +Include gl-common.cfg +Include gl-common-extensions.cfg +Include gl2_es3-common.cfg +Include gl-if-gl3-ignores.cfg +Include gl-if-gl4-ignores.cfg + +# dummy procaddress config / force procaddress for comments +EmitProcAddressTable false +ProcAddressTableClassName DontGenerateProcAddressTableStuff +GetProcAddressTableExpr DontGenerateProcAddressTableStuff +ForceProcAddressGen __ALL__ diff --git a/make/config/jogl/gl-if-gl3-subset.cfg b/make/config/jogl/gl-if-gl2gl3-subset.cfg index dae38ec0c..ecb384ca3 100644 --- a/make/config/jogl/gl-if-gl3-subset.cfg +++ b/make/config/jogl/gl-if-gl2gl3-subset.cfg @@ -3,10 +3,11 @@ JavaOutputDir ../../build-temp/gluegen-set Package javax.media.opengl Style InterfaceOnly -JavaClass GL3Subset +JavaClass GL2GL3Subset Include gl-common.cfg Include gl-common-extensions.cfg Include gl3-desktop.cfg +Include gl3-common.cfg Include gl-if-gl3-ignores.cfg Include gl-if-gl4-ignores.cfg diff --git a/make/config/jogl/gl-if-gl3.cfg b/make/config/jogl/gl-if-gl3.cfg index 649b35165..09f51d6b0 100644 --- a/make/config/jogl/gl-if-gl3.cfg +++ b/make/config/jogl/gl-if-gl3.cfg @@ -4,6 +4,8 @@ NativeOutputDir gensrc/native/jogl/gl3 ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL.java ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL2ES2.java +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL2ES3.java +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL3ES3.java ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL2GL3.java ExtendedInterfaceSymbolsIgnore ../src/jogl/classes/javax/media/opengl/GLBase.java @@ -13,16 +15,14 @@ JavaClass GL3 #Extends GL3 GLBase #Extends GL3 GL #Extends GL3 GL2ES2 +#Extends GL3 GL2ES3 +Extends GL3 GL3ES3 Extends GL3 GL2GL3 ImplPackage jogamp.opengl.gl3 -ImplJavaClass GL3Impl -Implements GL3Impl GLBase -Implements GL3Impl GL -Implements GL3Impl GL2ES2 -Implements GL3Impl GL2GL3 Include gl-common.cfg Include gl-common-extensions.cfg Include gl3-desktop.cfg +Include gl3-common.cfg Include gl-if-gl4-ignores.cfg # Pick up on-line OpenGL javadoc thanks to user cylab on javagaming.org forums diff --git a/make/config/jogl/gl-if-gl3_es3.cfg b/make/config/jogl/gl-if-gl3_es3.cfg new file mode 100644 index 000000000..a25d9112a --- /dev/null +++ b/make/config/jogl/gl-if-gl3_es3.cfg @@ -0,0 +1,43 @@ +# This .cfg file is used to generate the GL interface and implementing class. +JavaOutputDir gensrc/classes +NativeOutputDir gensrc/native/jogl + +Package javax.media.opengl +Style InterfaceOnly +JavaClass GL3ES3 +#Extends GL3ES3 GLBase +#Extends GL3ES3 GL +#Extends GL3ES3 GL2ES2 +Extends GL3ES3 GL2ES3 + +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL.java +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL2ES2.java +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL2ES3.java +ExtendedInterfaceSymbolsIgnore ../src/jogl/classes/javax/media/opengl/GLBase.java + +HierarchicalNativeOutput false +Include gl-common.cfg +Include gl-common-extensions.cfg +Include gl2_es3-common.cfg +Include gl-if-gl2_es3-ignores.cfg +Include gl-if-gl4-ignores.cfg +Include gl-if-luminance-ignore.cfg + +# +# Same name but different signature .. +# No collisions found .. good! + +# dummy procaddress config / force procaddress for comments +EmitProcAddressTable false +ProcAddressTableClassName DontGenerateProcAddressTableStuff +GetProcAddressTableExpr DontGenerateProcAddressTableStuff +ForceProcAddressGen __ALL__ + +# Also force the calling conventions of the locally generated function +# pointer typedefs for these routines to APIENTRY +LocalProcAddressCallingConvention __ALL__ APIENTRY + +# Pick up on-line OpenGL javadoc thanks to user cylab on javagaming.org forums +TagNativeBinding true + +Import java.io.PrintStream diff --git a/make/config/jogl/gl-if-gl3bc.cfg b/make/config/jogl/gl-if-gl3bc.cfg index f07a9a417..bca3d61e6 100644 --- a/make/config/jogl/gl-if-gl3bc.cfg +++ b/make/config/jogl/gl-if-gl3bc.cfg @@ -5,6 +5,8 @@ NativeOutputDir gensrc/native/jogl/gl3 ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL.java ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL2ES1.java ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL2ES2.java +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL2ES3.java +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL3ES3.java ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL2GL3.java ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL2.java ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL3.java @@ -20,6 +22,8 @@ JavaClass GL3bc #Extends GL3bc GL #Extends GL3bc GL2ES1 #Extends GL3bc GL2ES2 +#Extends GL3bc GL2ES3 +#Extends GL3bc GL3ES3 #Extends GL3bc GL2GL3 Extends GL3bc GL2 Extends GL3bc GL3 @@ -30,6 +34,8 @@ Include gl-desktop.cfg Include gl3-desktop.cfg Include gl-if-gl4-ignores.cfg +IncludeAs CustomJavaCode GL2 gl-if-CustomJavaCode-gl_compat.java + # Pick up on-line OpenGL javadoc thanks to user cylab on javagaming.org forums TagNativeBinding true diff --git a/make/config/jogl/gl-if-gl4-ignores.cfg b/make/config/jogl/gl-if-gl4-ignores.cfg index 4948b64df..619c82924 100644 --- a/make/config/jogl/gl-if-gl4-ignores.cfg +++ b/make/config/jogl/gl-if-gl4-ignores.cfg @@ -9,5 +9,7 @@ IgnoreExtension GL_VERSION_4_0 IgnoreExtension GL_VERSION_4_1 IgnoreExtension GL_VERSION_4_2 +IgnoreExtension GL_VERSION_4_3 +IgnoreExtension GL_VERSION_4_4 IgnoreExtension GL_ARB_shader_precision diff --git a/make/config/jogl/gl-if-gl4.cfg b/make/config/jogl/gl-if-gl4.cfg index 1e920ac7c..4b19b448e 100644 --- a/make/config/jogl/gl-if-gl4.cfg +++ b/make/config/jogl/gl-if-gl4.cfg @@ -4,6 +4,9 @@ NativeOutputDir gensrc/native/jogl/gl4 ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL.java ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL2ES2.java +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL2ES3.java +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL3ES3.java +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL4ES3.java ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL2GL3.java ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL3.java ExtendedInterfaceSymbolsIgnore ../src/jogl/classes/javax/media/opengl/GLBase.java @@ -14,11 +17,15 @@ JavaClass GL4 #Extends GL4 GLBase #Extends GL4 GL #Extends GL4 GL2ES2 +#Extends GL4 GL2ES3 +#Extends GL4 GL3ES3 #Extends GL4 GL2GL3 +Extends GL4 GL4ES3 Extends GL4 GL3 Include gl-common.cfg Include gl-common-extensions.cfg Include gl3-desktop.cfg +Include gl3-common.cfg # dummy procaddress config / force procaddress for comments EmitProcAddressTable false diff --git a/make/config/jogl/gl-if-gl4_es3.cfg b/make/config/jogl/gl-if-gl4_es3.cfg new file mode 100644 index 000000000..cd9c17f27 --- /dev/null +++ b/make/config/jogl/gl-if-gl4_es3.cfg @@ -0,0 +1,47 @@ +# This .cfg file is used to generate the GL interface and implementing class. +JavaOutputDir gensrc/classes +NativeOutputDir gensrc/native/jogl + +Package javax.media.opengl +Style InterfaceOnly +JavaClass GL4ES3 +#Extends GL4ES3 GLBase +#Extends GL4ES3 GL +#Extends GL4ES3 GL2ES2 +#Extends GL4ES3 GL2ES3 +Extends GL4ES3 GL3ES3 + +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL.java +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL2ES2.java +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL2ES3.java +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL3ES3.java +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL3.java +ExtendedInterfaceSymbolsIgnore ../src/jogl/classes/javax/media/opengl/GLBase.java + +HierarchicalNativeOutput false +Include gl-common.cfg +Include gl-common-extensions.cfg +Include gl2_es3-common.cfg +Include gl-if-gl2_es3-ignores.cfg +Include gl-if-luminance-ignore.cfg + +ForceExtension GL_ARB_ES3_compatibility + +# +# Same name but different signature .. +# No collisions found .. good! + +# dummy procaddress config / force procaddress for comments +EmitProcAddressTable false +ProcAddressTableClassName DontGenerateProcAddressTableStuff +GetProcAddressTableExpr DontGenerateProcAddressTableStuff +ForceProcAddressGen __ALL__ + +# Also force the calling conventions of the locally generated function +# pointer typedefs for these routines to APIENTRY +LocalProcAddressCallingConvention __ALL__ APIENTRY + +# Pick up on-line OpenGL javadoc thanks to user cylab on javagaming.org forums +TagNativeBinding true + +Import java.io.PrintStream diff --git a/make/config/jogl/gl-if-luminance-ignore.cfg b/make/config/jogl/gl-if-luminance-ignore.cfg new file mode 100644 index 000000000..4fb79fae9 --- /dev/null +++ b/make/config/jogl/gl-if-luminance-ignore.cfg @@ -0,0 +1,7 @@ +Ignore GL_LUMINANCE16F +Ignore GL_LUMINANCE32F +Ignore GL_LUMINANCE_ALPHA16F +Ignore GL_LUMINANCE_ALPHA32F +Ignore GL_LUMINANCE4_ALPHA4 +Ignore GL_LUMINANCE8 +Ignore GL_LUMINANCE8_ALPHA8 diff --git a/make/config/jogl/gl-impl-CustomCCode-gl4bc.c b/make/config/jogl/gl-impl-CustomCCode-gl4bc.c index d389db298..4ddc27bf2 100644 --- a/make/config/jogl/gl-impl-CustomCCode-gl4bc.c +++ b/make/config/jogl/gl-impl-CustomCCode-gl4bc.c @@ -15,6 +15,22 @@ Java_jogamp_opengl_gl4_GL4bcImpl_dispatch_1glMapBuffer(JNIEnv *env, jobject _unu /* Java->C glue code: * Java package: jogamp.opengl.gl4.GL4bcImpl + * Java method: java.nio.ByteBuffer dispatch_glMapBufferRange(int target, long offset, long length, int access) + * C function: void * glMapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); + */ +JNIEXPORT jlong JNICALL +Java_jogamp_opengl_gl4_GL4bcImpl_dispatch_1glMapBufferRange(JNIEnv *env, jobject _unused, jint target, jlong offset, jlong length, jint access, jlong procAddress) { + typedef void * (APIENTRY*_local_PFNGLMAPBUFFERRANGEPROC)(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); + _local_PFNGLMAPBUFFERRANGEPROC ptr_glMapBufferRange; + void * _res; + ptr_glMapBufferRange = (_local_PFNGLMAPBUFFERRANGEPROC) (intptr_t) procAddress; + assert(ptr_glMapBufferRange != NULL); + _res = (* ptr_glMapBufferRange) ((GLenum) target, (GLintptr) offset, (GLsizeiptr) length, (GLbitfield) access); + return (jlong) (intptr_t) _res; +} + +/* Java->C glue code: + * Java package: jogamp.opengl.gl4.GL4bcImpl * Java method: long dispatch_glMapNamedBufferEXT(int target, int access) * C function: void * glMapNamedBufferEXT(GLenum target, GLenum access); */ diff --git a/make/config/jogl/gl-impl-CustomCCode-gles1.c b/make/config/jogl/gl-impl-CustomCCode-gles1.c index 0155c13f8..88cfe4418 100644 --- a/make/config/jogl/gl-impl-CustomCCode-gles1.c +++ b/make/config/jogl/gl-impl-CustomCCode-gles1.c @@ -16,6 +16,22 @@ Java_jogamp_opengl_es1_GLES1Impl_dispatch_1glMapBuffer(JNIEnv *env, jobject _unu /* Java->C glue code: * Java package: jogamp.opengl.es1.GLES1Impl + * Java method: java.nio.ByteBuffer dispatch_glMapBufferRange(int target, long offset, long length, int access) + * C function: void * glMapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); + */ +JNIEXPORT jlong JNICALL +Java_jogamp_opengl_es1_GLES1Impl_dispatch_1glMapBufferRange(JNIEnv *env, jobject _unused, jint target, jlong offset, jlong length, jint access, jlong procAddress) { + typedef void * (GL_APIENTRY*_local_PFNGLMAPBUFFERRANGEPROC)(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); + _local_PFNGLMAPBUFFERRANGEPROC ptr_glMapBufferRange; + void * _res; + ptr_glMapBufferRange = (_local_PFNGLMAPBUFFERRANGEPROC) (intptr_t) procAddress; + assert(ptr_glMapBufferRange != NULL); + _res = (* ptr_glMapBufferRange) ((GLenum) target, (GLintptr) offset, (GLsizeiptr) length, (GLbitfield) access); + return (jlong) (intptr_t) _res; +} + +/* Java->C glue code: + * Java package: jogamp.opengl.es1.GLES1Impl * Java method: ByteBuffer newDirectByteBuffer(long addr, long capacity); * C function: jobject newDirectByteBuffer(jlong addr, jlong capacity); */ diff --git a/make/config/jogl/gl-impl-CustomCCode-gles2.c b/make/config/jogl/gl-impl-CustomCCode-gles2.c deleted file mode 100644 index e140df76b..000000000 --- a/make/config/jogl/gl-impl-CustomCCode-gles2.c +++ /dev/null @@ -1,25 +0,0 @@ -typedef GLvoid* (GL_APIENTRY* PFNGLMAPBUFFERPROC) (GLenum target, GLenum access); -/* Java->C glue code: - * Java package: jogamp.opengl.es2.GLES2Impl - * Java method: long dispatch_glMapBuffer(int target, int access) - * C function: void * glMapBuffer(GLenum target, GLenum access); - */ -JNIEXPORT jlong JNICALL -Java_jogamp_opengl_es2_GLES2Impl_dispatch_1glMapBuffer(JNIEnv *env, jobject _unused, jint target, jint access, jlong glProcAddress) { - PFNGLMAPBUFFERPROC ptr_glMapBuffer; - void * _res; - ptr_glMapBuffer = (PFNGLMAPBUFFERPROC) (intptr_t) glProcAddress; - assert(ptr_glMapBuffer != NULL); - _res = (* ptr_glMapBuffer) ((GLenum) target, (GLenum) access); - return (jlong) (intptr_t) _res; -} - -/* Java->C glue code: - * Java package: jogamp.opengl.es2.GLES2Impl - * Java method: ByteBuffer newDirectByteBuffer(long addr, long capacity); - * C function: jobject newDirectByteBuffer(jlong addr, jlong capacity); - */ -JNIEXPORT jobject JNICALL -Java_jogamp_opengl_es2_GLES2Impl_newDirectByteBuffer(JNIEnv *env, jobject _unused, jlong addr, jlong capacity) { - return (*env)->NewDirectByteBuffer(env, (void*) (intptr_t) addr, capacity); -} diff --git a/make/config/jogl/gl-impl-CustomCCode-gles3.c b/make/config/jogl/gl-impl-CustomCCode-gles3.c new file mode 100644 index 000000000..2f3329bfa --- /dev/null +++ b/make/config/jogl/gl-impl-CustomCCode-gles3.c @@ -0,0 +1,41 @@ +typedef GLvoid* (GL_APIENTRY* PFNGLMAPBUFFERPROC) (GLenum target, GLenum access); +/* Java->C glue code: + * Java package: jogamp.opengl.es3.GLES3Impl + * Java method: long dispatch_glMapBuffer(int target, int access) + * C function: void * glMapBuffer(GLenum target, GLenum access); + */ +JNIEXPORT jlong JNICALL +Java_jogamp_opengl_es3_GLES3Impl_dispatch_1glMapBuffer(JNIEnv *env, jobject _unused, jint target, jint access, jlong glProcAddress) { + PFNGLMAPBUFFERPROC ptr_glMapBuffer; + void * _res; + ptr_glMapBuffer = (PFNGLMAPBUFFERPROC) (intptr_t) glProcAddress; + assert(ptr_glMapBuffer != NULL); + _res = (* ptr_glMapBuffer) ((GLenum) target, (GLenum) access); + return (jlong) (intptr_t) _res; +} + +/* Java->C glue code: + * Java package: jogamp.opengl.es3.GLES3Impl + * Java method: java.nio.ByteBuffer dispatch_glMapBufferRange(int target, long offset, long length, int access) + * C function: void * glMapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); + */ +JNIEXPORT jlong JNICALL +Java_jogamp_opengl_es3_GLES3Impl_dispatch_1glMapBufferRange(JNIEnv *env, jobject _unused, jint target, jlong offset, jlong length, jint access, jlong procAddress) { + typedef void * (GL_APIENTRY*_local_PFNGLMAPBUFFERRANGEPROC)(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); + _local_PFNGLMAPBUFFERRANGEPROC ptr_glMapBufferRange; + void * _res; + ptr_glMapBufferRange = (_local_PFNGLMAPBUFFERRANGEPROC) (intptr_t) procAddress; + assert(ptr_glMapBufferRange != NULL); + _res = (* ptr_glMapBufferRange) ((GLenum) target, (GLintptr) offset, (GLsizeiptr) length, (GLbitfield) access); + return (jlong) (intptr_t) _res; +} + +/* Java->C glue code: + * Java package: jogamp.opengl.es3.GLES3Impl + * Java method: ByteBuffer newDirectByteBuffer(long addr, long capacity); + * C function: jobject newDirectByteBuffer(jlong addr, jlong capacity); + */ +JNIEXPORT jobject JNICALL +Java_jogamp_opengl_es3_GLES3Impl_newDirectByteBuffer(JNIEnv *env, jobject _unused, jlong addr, jlong capacity) { + return (*env)->NewDirectByteBuffer(env, (void*) (intptr_t) addr, capacity); +} diff --git a/make/config/jogl/gl-impl-CustomJavaCode-common.java b/make/config/jogl/gl-impl-CustomJavaCode-common.java index 8e8165fff..4024d8e1a 100644 --- a/make/config/jogl/gl-impl-CustomJavaCode-common.java +++ b/make/config/jogl/gl-impl-CustomJavaCode-common.java @@ -118,3 +118,95 @@ return _context.getDefaultReadBuffer(); } + private final HashMap<MemoryObject, MemoryObject> arbMemCache = new HashMap<MemoryObject, MemoryObject>(); + + /** Entry point to C language function: <code> void * {@native glMapBuffer}(GLenum target, GLenum access); </code> <br>Part of <code>GL_VERSION_1_5</code>; <code>GL_OES_mapbuffer</code> */ + private final java.nio.ByteBuffer glMapBufferImpl(int target, boolean useRange, long offset, long length, int access, long glProcAddress) { + if (glProcAddress == 0) { + throw new GLException("Method \""+(useRange?"glMapBufferRange":"glMapBuffer")+"\" not available"); + } + final long sz = bufferSizeTracker.getBufferSize(bufferStateTracker, target, this); + if (0 == sz) { + return null; + } + if( !useRange ) { + length = sz; + offset = 0; + } else { + if( length + offset > sz ) { + throw new GLException("Out of range: offset "+offset+" + length "+length+" > size "+sz); + } + if( 0 > length || 0 > offset ) { + throw new GLException("Invalid values: offset "+offset+", length "+length); + } + if( 0 == length ) { + return null; + } + } + final long addr = useRange ? dispatch_glMapBufferRange(target, offset, length, access, glProcAddress) : + dispatch_glMapBuffer(target, access, glProcAddress); + if (0 == addr) { + return null; + } + ByteBuffer buffer; + MemoryObject memObj0 = new MemoryObject(addr, length); // object and key + MemoryObject memObj1 = MemoryObject.getOrAddSafe(arbMemCache, memObj0); + if(memObj0 == memObj1) { + // just added .. + if(null != memObj0.getBuffer()) { + throw new InternalError(); + } + buffer = newDirectByteBuffer(addr, length); + Buffers.nativeOrder(buffer); + memObj0.setBuffer(buffer); + } else { + // already mapped + buffer = memObj1.getBuffer(); + if(null == buffer) { + throw new InternalError(); + } + } + buffer.position(0); + return buffer; + } + private native long dispatch_glMapBuffer(int target, int access, long glProcAddress); + private native long dispatch_glMapBufferRange(int target, long offset, long length, int access, long procAddress); + + + /** Entry point to C language function: <code> GLvoid * {@native glMapNamedBufferEXT}(GLuint buffer, GLenum access); </code> <br>Part of <code>GL_EXT_direct_state_access</code> */ + private final java.nio.ByteBuffer glMapNamedBufferImpl(int bufferName, int access, long glProcAddress) { + if (glProcAddress == 0) { + throw new GLException("Method \"glMapNamedBufferEXT\" not available"); + } + final long sz = bufferSizeTracker.getDirectStateBufferSize(bufferName, this); + if (0 == sz) { + return null; + } + final long addr = dispatch_glMapNamedBufferEXT(bufferName, access, glProcAddress); + if (0 == addr) { + return null; + } + ByteBuffer buffer; + MemoryObject memObj0 = new MemoryObject(addr, sz); // object and key + MemoryObject memObj1 = MemoryObject.getOrAddSafe(arbMemCache, memObj0); + if(memObj0 == memObj1) { + // just added .. + if(null != memObj0.getBuffer()) { + throw new InternalError(); + } + buffer = newDirectByteBuffer(addr, sz); + Buffers.nativeOrder(buffer); + memObj0.setBuffer(buffer); + } else { + // already mapped + buffer = memObj1.getBuffer(); + if(null == buffer) { + throw new InternalError(); + } + } + buffer.position(0); + return buffer; + } + private native long dispatch_glMapNamedBufferEXT(int buffer, int access, long procAddress); + + private native ByteBuffer newDirectByteBuffer(long addr, long capacity); diff --git a/make/config/jogl/gl-impl-CustomJavaCode-desktop.java b/make/config/jogl/gl-impl-CustomJavaCode-desktop.java deleted file mode 100644 index 6a74b80a6..000000000 --- a/make/config/jogl/gl-impl-CustomJavaCode-desktop.java +++ /dev/null @@ -1,148 +0,0 @@ - private int[] imageSizeTemp = new int[1]; - - private final int imageSizeInBytes(int format, int type, int width, int height, int depth, boolean pack) { - return GLBuffers.sizeof(this, imageSizeTemp, format, type, width, height, depth, pack) ; - } - - @Override - public final boolean isGL4bc() { - return _context.isGL4bc(); - } - - @Override - public final boolean isGL4() { - return _context.isGL4(); - } - - @Override - public final boolean isGL3bc() { - return _context.isGL3bc(); - } - - @Override - public final boolean isGL3() { - return _context.isGL3(); - } - - @Override - public final boolean isGL2() { - return _context.isGL2(); - } - - @Override - public final boolean isGL2ES1() { - return _context.isGL2ES1(); - } - - @Override - public final boolean isGL2ES2() { - return _context.isGL2ES2(); - } - - @Override - public final boolean isGLES2Compatible() { - return _context.isGLES2Compatible(); - } - - public final boolean isGL2GL3() { - return _context.isGL2GL3(); - } - - @Override - public final boolean hasGLSL() { - return _context.hasGLSL(); - } - - @Override - public final GL4bc getGL4bc() throws GLException { - if(!isGL4bc()) { - throw new GLException("Not a GL4bc implementation"); - } - return this; - } - - @Override - public final GL4 getGL4() throws GLException { - if(!isGL4()) { - throw new GLException("Not a GL4 implementation"); - } - return this; - } - - @Override - public final GL3bc getGL3bc() throws GLException { - if(!isGL3bc()) { - throw new GLException("Not a GL3bc implementation"); - } - return this; - } - - @Override - public final GL3 getGL3() throws GLException { - if(!isGL3()) { - throw new GLException("Not a GL3 implementation"); - } - return this; - } - - @Override - public final GL2 getGL2() throws GLException { - if(!isGL2()) { - throw new GLException("Not a GL2 implementation"); - } - return this; - } - - @Override - public final GL2ES1 getGL2ES1() throws GLException { - if(!isGL2ES1()) { - throw new GLException("Not a GL2ES1 implementation"); - } - return this; - } - - @Override - public final GL2ES2 getGL2ES2() throws GLException { - if(!isGL2ES2()) { - throw new GLException("Not a GL2ES2 implementation"); - } - return this; - } - - @Override - public final GL2GL3 getGL2GL3() throws GLException { - if(!isGL2GL3()) { - throw new GLException("Not a GL2GL3 implementation"); - } - return this; - } - - @Override - public final boolean isGLES1() { - return false; - } - - @Override - public final boolean isGLES2() { - return false; - } - - @Override - public final boolean isGLES() { - return false; - } - - @Override - public final GLES1 getGLES1() throws GLException { - throw new GLException("Not a GLES1 implementation"); - } - - @Override - public final GLES2 getGLES2() throws GLException { - throw new GLException("Not a GLES2 implementation"); - } - - @Override - public final boolean isNPOTTextureAvailable() { - return _context.isNPOTTextureAvailable(); - } diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gl4bc.java b/make/config/jogl/gl-impl-CustomJavaCode-gl4bc.java index fbe7484c4..cacea322a 100644 --- a/make/config/jogl/gl-impl-CustomJavaCode-gl4bc.java +++ b/make/config/jogl/gl-impl-CustomJavaCode-gl4bc.java @@ -29,12 +29,223 @@ public GL4bcImpl(GLProfile glp, GLContextImpl context) { this.glProfile = glp; } -/** - * Provides platform-independent access to the wglAllocateMemoryNV / - * glXAllocateMemoryNV extension. - */ -public final java.nio.ByteBuffer glAllocateMemoryNV(int arg0, float arg1, float arg2, float arg3) { - return _context.glAllocateMemoryNV(arg0, arg1, arg2, arg3); +public final void finalizeInit() { + if(null != _context) { + haveARBPixelBufferObject = isExtensionAvailable("GL_ARB_pixel_buffer_object"); + haveEXTPixelBufferObject = isExtensionAvailable("GL_EXT_pixel_buffer_object"); + haveGL15 = isExtensionAvailable("GL_VERSION_1_5"); + haveGL21 = isExtensionAvailable("GL_VERSION_2_1"); + haveARBVertexBufferObject = isExtensionAvailable("GL_ARB_vertex_buffer_object"); + haveARBVertexArrayObject = _context.getGLVersionNumber().compareTo(GLContext.Version300) >= 0 || + isExtensionAvailable("GL_ARB_vertex_array_object"); + } else { + haveARBPixelBufferObject = false; + haveEXTPixelBufferObject = false; + haveGL15 = false; + haveGL21 = false; + haveARBVertexBufferObject = false; + haveARBVertexArrayObject = false; + } +} + +private int[] imageSizeTemp = new int[1]; + +private final int imageSizeInBytes(int format, int type, int width, int height, int depth, boolean pack) { + return GLBuffers.sizeof(this, imageSizeTemp, format, type, width, height, depth, pack) ; +} + +@Override +public final boolean isGL4bc() { + return _context.isGL4bc(); +} + +@Override +public final boolean isGL4() { + return _context.isGL4(); +} + +@Override +public final boolean isGL3bc() { + return _context.isGL3bc(); +} + +@Override +public final boolean isGL3() { + return _context.isGL3(); +} + +@Override +public final boolean isGL2() { + return _context.isGL2(); +} + +@Override +public final boolean isGL2ES1() { + return _context.isGL2ES1(); +} + +@Override +public final boolean isGL2ES2() { + return _context.isGL2ES2(); +} + +@Override +public final boolean isGL3ES3() { + return _context.isGL3ES3(); +} + +@Override +public final boolean isGL4ES3() { + return _context.isGL4ES3(); +} + +@Override +public final boolean isGLES2Compatible() { + return _context.isGLES2Compatible(); +} + +@Override +public final boolean isGLES3Compatible() { + return _context.isGLES3Compatible(); +} + +@Override +public final boolean isGL2GL3() { + return _context.isGL2GL3(); +} + +@Override +public final boolean hasGLSL() { + return _context.hasGLSL(); +} + +@Override +public final GL4bc getGL4bc() throws GLException { + if(!isGL4bc()) { + throw new GLException("Not a GL4bc implementation"); + } + return this; +} + +@Override +public final GL4 getGL4() throws GLException { + if(!isGL4()) { + throw new GLException("Not a GL4 implementation"); + } + return this; +} + +@Override +public final GL3bc getGL3bc() throws GLException { + if(!isGL3bc()) { + throw new GLException("Not a GL3bc implementation"); + } + return this; +} + +@Override +public final GL3 getGL3() throws GLException { + if(!isGL3()) { + throw new GLException("Not a GL3 implementation"); + } + return this; +} + +@Override +public final GL2 getGL2() throws GLException { + if(!isGL2()) { + throw new GLException("Not a GL2 implementation"); + } + return this; +} + +@Override +public final GL2ES1 getGL2ES1() throws GLException { + if(!isGL2ES1()) { + throw new GLException("Not a GL2ES1 implementation"); + } + return this; +} + +@Override +public final GL2ES2 getGL2ES2() throws GLException { + if(!isGL2ES2()) { + throw new GLException("Not a GL2ES2 implementation"); + } + return this; +} + +@Override +public final GL3ES3 getGL3ES3() throws GLException { + if(!isGL3ES3()) { + throw new GLException("Not a GL3ES3 implementation"); + } + return this; +} + +@Override +public final GL4ES3 getGL4ES3() throws GLException { + if(!isGL4ES3()) { + throw new GLException("Not a GL4ES3 implementation"); + } + return this; +} + +@Override +public final GL2GL3 getGL2GL3() throws GLException { + if(!isGL2GL3()) { + throw new GLException("Not a GL2GL3 implementation"); + } + return this; +} + +@Override +public final boolean isGLES1() { + return false; +} + +@Override +public final boolean isGLES2() { + return false; +} + +@Override +public final boolean isGLES3() { + return false; +} + +@Override +public final boolean isGLES() { + return false; +} + +@Override +public final GLES1 getGLES1() throws GLException { + throw new GLException("Not a GLES1 implementation"); +} + +@Override +public final GLES2 getGLES2() throws GLException { + throw new GLException("Not a GLES2 implementation"); +} + +@Override +public final GLES3 getGLES3() throws GLException { + throw new GLException("Not a GLES3 implementation"); +} + +@Override +public final boolean isNPOTTextureAvailable() { + return _context.isNPOTTextureAvailable(); +} +@Override +public final java.nio.ByteBuffer glAllocateMemoryNV(int size, float readFrequency, float writeFrequency, float priority) { + return _context.glAllocateMemoryNV(size, readFrequency, writeFrequency, priority); +} + +@Override +public final void glFreeMemoryNV(java.nio.ByteBuffer pointer) { + _context.glFreeMemoryNV(pointer); } // @@ -45,7 +256,6 @@ private final GLBufferSizeTracker bufferSizeTracker; private final GLBufferStateTracker bufferStateTracker; private final GLStateTracker glStateTracker; -private boolean bufferObjectExtensionsInitialized = false; private boolean haveARBPixelBufferObject; private boolean haveEXTPixelBufferObject; private boolean haveGL15; @@ -53,20 +263,6 @@ private boolean haveGL21; private boolean haveARBVertexBufferObject; private boolean haveARBVertexArrayObject; -private final void initBufferObjectExtensionChecks() { - if ( bufferObjectExtensionsInitialized ) { - return; - } - bufferObjectExtensionsInitialized = true; - haveARBPixelBufferObject = isExtensionAvailable("GL_ARB_pixel_buffer_object"); - haveEXTPixelBufferObject = isExtensionAvailable("GL_EXT_pixel_buffer_object"); - haveGL15 = isExtensionAvailable("GL_VERSION_1_5"); - haveGL21 = isExtensionAvailable("GL_VERSION_2_1"); - haveARBVertexBufferObject = isExtensionAvailable("GL_ARB_vertex_buffer_object"); - haveARBVertexArrayObject = _context.getGLVersionNumber().compareTo(GLContext.Version300) >= 0 || - isExtensionAvailable("GL_ARB_vertex_array_object"); -} - private final boolean checkBufferObject(boolean extensionAvail, boolean allowVAO, boolean enabled, @@ -111,7 +307,6 @@ private final boolean checkBufferObject(boolean extensionAvail, } private final boolean checkArrayVBODisabled(boolean throwException) { - initBufferObjectExtensionChecks(); return checkBufferObject(haveGL15 || haveARBVertexBufferObject, haveARBVertexArrayObject, // allowVAO false, // enable @@ -120,7 +315,6 @@ private final boolean checkArrayVBODisabled(boolean throwException) { } private final boolean checkArrayVBOEnabled(boolean throwException) { - initBufferObjectExtensionChecks(); return checkBufferObject(haveGL15 || haveARBVertexBufferObject, haveARBVertexArrayObject, // allowVAO true, // enable @@ -129,7 +323,6 @@ private final boolean checkArrayVBOEnabled(boolean throwException) { } private final boolean checkElementVBODisabled(boolean throwException) { - initBufferObjectExtensionChecks(); return checkBufferObject(haveGL15 || haveARBVertexBufferObject, haveARBVertexArrayObject, // allowVAO false, // enable @@ -138,7 +331,6 @@ private final boolean checkElementVBODisabled(boolean throwException) { } private final boolean checkElementVBOEnabled(boolean throwException) { - initBufferObjectExtensionChecks(); return checkBufferObject(haveGL15 || haveARBVertexBufferObject, haveARBVertexArrayObject, // allowVAO true, // enable @@ -147,7 +339,6 @@ private final boolean checkElementVBOEnabled(boolean throwException) { } private final boolean checkUnpackPBODisabled(boolean throwException) { - initBufferObjectExtensionChecks(); return checkBufferObject(haveGL21 || haveARBPixelBufferObject || haveEXTPixelBufferObject, false, // allowVAO false, // enable @@ -156,7 +347,6 @@ private final boolean checkUnpackPBODisabled(boolean throwException) { } private final boolean checkUnpackPBOEnabled(boolean throwException) { - initBufferObjectExtensionChecks(); return checkBufferObject(haveGL21 || haveARBPixelBufferObject || haveEXTPixelBufferObject, false, // allowVAO true, // enable @@ -165,7 +355,6 @@ private final boolean checkUnpackPBOEnabled(boolean throwException) { } private final boolean checkPackPBODisabled(boolean throwException) { - initBufferObjectExtensionChecks(); return checkBufferObject(haveGL21 || haveARBPixelBufferObject || haveEXTPixelBufferObject, false, // allowVAO false, // enable @@ -174,7 +363,6 @@ private final boolean checkPackPBODisabled(boolean throwException) { } private final boolean checkPackPBOEnabled(boolean throwException) { - initBufferObjectExtensionChecks(); return checkBufferObject(haveGL21 || haveARBPixelBufferObject || haveEXTPixelBufferObject, false, // allowVAO true, // enable @@ -192,87 +380,21 @@ public final boolean glIsPBOUnpackEnabled() { return checkUnpackPBOEnabled(false); } -private final HashMap<MemoryObject, MemoryObject> arbMemCache = new HashMap<MemoryObject, MemoryObject>(); - -/** Entry point to C language function: <br> <code> LPVOID glMapBuffer(GLenum target, GLenum access); </code> */ +/** Entry point to C language function: <code> void * {@native glMapBuffer}(GLenum target, GLenum access); </code> <br>Part of <code>GL_VERSION_1_5</code>; <code>GL_OES_mapbuffer</code> */ public final java.nio.ByteBuffer glMapBuffer(int target, int access) { - final long __addr_ = ((GL4bcProcAddressTable)_context.getGLProcAddressTable())._addressof_glMapBuffer; - if (__addr_ == 0) { - throw new GLException("Method \"glMapBuffer\" not available"); - } - final long sz = bufferSizeTracker.getBufferSize(bufferStateTracker, target, this); - if (0 == sz) { - return null; - } - final long addr = dispatch_glMapBuffer(target, access, __addr_); - if (0 == addr) { - return null; - } - ByteBuffer buffer; - MemoryObject memObj0 = new MemoryObject(addr, sz); // object and key - MemoryObject memObj1 = MemoryObject.getOrAddSafe(arbMemCache, memObj0); - if(memObj0 == memObj1) { - // just added .. - if(null != memObj0.getBuffer()) { - throw new InternalError(); - } - buffer = newDirectByteBuffer(addr, sz); - Buffers.nativeOrder(buffer); - memObj0.setBuffer(buffer); - } else { - // already mapped - buffer = memObj1.getBuffer(); - if(null == buffer) { - throw new InternalError(); - } - } - buffer.position(0); - return buffer; + return glMapBufferImpl(target, false, 0, 0, access, ((GL4bcProcAddressTable)_context.getGLProcAddressTable())._addressof_glMapBuffer); } -/** Encapsulates function pointer for OpenGL function <br>: <code> LPVOID glMapBuffer(GLenum target, GLenum access); </code> */ -native private long dispatch_glMapBuffer(int target, int access, long glProcAddress); +/** Entry point to C language function: <code> void * {@native glMapBufferRange}(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); </code> <br>Part of <code>GL_ES_VERSION_3_0</code>, <code>GL_VERSION_3_0</code>; <code>GL_EXT_map_buffer_range</code> */ +public final ByteBuffer glMapBufferRange(int target, long offset, long length, int access) { + return glMapBufferImpl(target, true, offset, length, access, ((GL4bcProcAddressTable)_context.getGLProcAddressTable())._addressof_glMapBufferRange); +} /** Entry point to C language function: <code> GLvoid * {@native glMapNamedBufferEXT}(GLuint buffer, GLenum access); </code> <br>Part of <code>GL_EXT_direct_state_access</code> */ public final java.nio.ByteBuffer glMapNamedBufferEXT(int bufferName, int access) { - final long __addr_ = ((GL4bcProcAddressTable)_context.getGLProcAddressTable())._addressof_glMapNamedBufferEXT; - if (__addr_ == 0) { - throw new GLException("Method \"glMapNamedBufferEXT\" not available"); - } - final long sz = bufferSizeTracker.getDirectStateBufferSize(bufferName, this); - if (0 == sz) { - return null; - } - final long addr = dispatch_glMapNamedBufferEXT(bufferName, access, __addr_); - if (0 == addr) { - return null; - } - ByteBuffer buffer; - MemoryObject memObj0 = new MemoryObject(addr, sz); // object and key - MemoryObject memObj1 = MemoryObject.getOrAddSafe(arbMemCache, memObj0); - if(memObj0 == memObj1) { - // just added .. - if(null != memObj0.getBuffer()) { - throw new InternalError(); - } - buffer = newDirectByteBuffer(addr, sz); - Buffers.nativeOrder(buffer); - memObj0.setBuffer(buffer); - } else { - // already mapped - buffer = memObj1.getBuffer(); - if(null == buffer) { - throw new InternalError(); - } - } - buffer.position(0); - return buffer; + return glMapNamedBufferImpl(bufferName, access, ((GL4bcProcAddressTable)_context.getGLProcAddressTable())._addressof_glMapNamedBufferEXT); } -private native long dispatch_glMapNamedBufferEXT(int buffer, int access, long procAddress); - -native private ByteBuffer newDirectByteBuffer(long addr, long capacity); - @Override public final void glVertexPointer(GLArrayData array) { if(array.getComponentCount()==0) return; diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gles1.java b/make/config/jogl/gl-impl-CustomJavaCode-gles1.java index 70425689a..2fa83dca6 100644 --- a/make/config/jogl/gl-impl-CustomJavaCode-gles1.java +++ b/make/config/jogl/gl-impl-CustomJavaCode-gles1.java @@ -48,6 +48,11 @@ public final boolean isGLES2() { } @Override +public final boolean isGLES3() { + return false; +} + +@Override public final boolean isGLES() { return true; } @@ -63,11 +68,26 @@ public final boolean isGL2ES2() { } @Override +public final boolean isGL3ES3() { + return false; +} + +@Override +public final boolean isGL4ES3() { + return false; +} + +@Override public final boolean isGLES2Compatible() { return false; } @Override +public final boolean isGLES3Compatible() { + return false; +} + +@Override public final boolean isGL2GL3() { return false; } @@ -118,6 +138,11 @@ public final GLES2 getGLES2() throws GLException { } @Override +public final GLES3 getGLES3() throws GLException { + throw new GLException("Not a GLES3 implementation"); +} + +@Override public final GL2ES1 getGL2ES1() throws GLException { return this; } @@ -128,6 +153,16 @@ public final GL2ES2 getGL2ES2() throws GLException { } @Override +public final GL3ES3 getGL3ES3() throws GLException { + throw new GLException("Not a GL3ES3 implementation"); +} + +@Override +public final GL4ES3 getGL4ES3() throws GLException { + throw new GLException("Not a GL4ES3 implementation"); +} + +@Override public final GL2GL3 getGL2GL3() throws GLException { throw new GLException("Not a GL2GL3 implementation"); } @@ -206,48 +241,15 @@ private final boolean checkPackPBOEnabled(boolean throwException) { return false; } -private final HashMap<MemoryObject, MemoryObject> arbMemCache = new HashMap<MemoryObject, MemoryObject>(); - -/** Entry point to C language function: <br> <code> LPVOID glMapBuffer(GLenum target, GLenum access); </code> */ +/** Entry point to C language function: <code> void * {@native glMapBuffer}(GLenum target, GLenum access); </code> <br>Part of <code>GL_VERSION_1_5</code>; <code>GL_OES_mapbuffer</code> */ public final java.nio.ByteBuffer glMapBuffer(int target, int access) { - final long __addr_ = ((GLES1ProcAddressTable)_context.getGLProcAddressTable())._addressof_glMapBuffer; - if (__addr_ == 0) { - throw new GLException("Method \"glMapBuffer\" not available"); - } - final long sz = bufferSizeTracker.getBufferSize(bufferStateTracker, target, this); - if (0 == sz) { - return null; - } - final long addr = dispatch_glMapBuffer(target, access, __addr_); - if (0 == addr) { - return null; - } - ByteBuffer buffer; - MemoryObject memObj0 = new MemoryObject(addr, sz); // object and key - MemoryObject memObj1 = MemoryObject.getOrAddSafe(arbMemCache, memObj0); - if(memObj0 == memObj1) { - // just added .. - if(null != memObj0.getBuffer()) { - throw new InternalError(); - } - buffer = newDirectByteBuffer(addr, sz); - Buffers.nativeOrder(buffer); - memObj0.setBuffer(buffer); - } else { - // already mapped - buffer = memObj1.getBuffer(); - if(null == buffer) { - throw new InternalError(); - } - } - buffer.position(0); - return buffer; + return glMapBufferImpl(target, false, 0, 0, access, ((GLES1ProcAddressTable)_context.getGLProcAddressTable())._addressof_glMapBuffer); } -/** Encapsulates function pointer for OpenGL function <br>: <code> LPVOID glMapBuffer(GLenum target, GLenum access); </code> */ -native private long dispatch_glMapBuffer(int target, int access, long glProcAddress); - -native private ByteBuffer newDirectByteBuffer(long addr, long capacity); +/** Entry point to C language function: <code> void * {@native glMapBufferRange}(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); </code> <br>Part of <code>GL_ES_VERSION_3_0</code>, <code>GL_VERSION_3_0</code>; <code>GL_EXT_map_buffer_range</code> */ +public final ByteBuffer glMapBufferRange(int target, long offset, long length, int access) { + return glMapBufferImpl(target, true, offset, length, access, ((GLES1ProcAddressTable)_context.getGLProcAddressTable())._addressof_glMapBufferRange); +} @Override public final void glVertexPointer(GLArrayData array) { diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gles2.java b/make/config/jogl/gl-impl-CustomJavaCode-gles2.java deleted file mode 100644 index 37f3f33aa..000000000 --- a/make/config/jogl/gl-impl-CustomJavaCode-gles2.java +++ /dev/null @@ -1,262 +0,0 @@ - -public GLES2Impl(GLProfile glp, GLContextImpl context) { - this._context = context; - if(null != context) { - this.bufferSizeTracker = context.getBufferSizeTracker(); - this.bufferStateTracker = context.getBufferStateTracker(); - this.glStateTracker = context.getGLStateTracker(); - } else { - this.bufferSizeTracker = null; - this.bufferStateTracker = null; - this.glStateTracker = null; - } - this.glProfile = glp; -} - -@Override -public final boolean isGL4bc() { - return false; -} - -@Override -public final boolean isGL4() { - return false; -} - -@Override -public final boolean isGL3bc() { - return false; -} - -@Override -public final boolean isGL3() { - return false; -} - -public final boolean isGL2() { - return false; -} - -@Override -public final boolean isGLES1() { - return false; -} - -@Override -public final boolean isGLES2() { - return true; -} - -@Override -public final boolean isGLES() { - return true; -} - -@Override -public final boolean isGL2ES1() { - return false; -} - -@Override -public final boolean isGL2ES2() { - return true; -} - -@Override -public final boolean isGLES2Compatible() { - return true; -} - -@Override -public final boolean isGL2GL3() { - return false; -} - -@Override -public final boolean hasGLSL() { - return true; -} - -@Override -public boolean isNPOTTextureAvailable() { - return true; -} - -@Override -public final GL4bc getGL4bc() throws GLException { - throw new GLException("Not a GL4bc implementation"); -} - -@Override -public final GL4 getGL4() throws GLException { - throw new GLException("Not a GL4 implementation"); -} - -@Override -public final GL3bc getGL3bc() throws GLException { - throw new GLException("Not a GL3bc implementation"); -} - -@Override -public final GL3 getGL3() throws GLException { - throw new GLException("Not a GL3 implementation"); -} - -@Override -public final GL2 getGL2() throws GLException { - throw new GLException("Not a GL2 implementation"); -} - -@Override -public final GLES1 getGLES1() throws GLException { - throw new GLException("Not a GLES1 implementation"); -} - -@Override -public final GLES2 getGLES2() throws GLException { - return this; -} - -@Override -public final GL2ES1 getGL2ES1() throws GLException { - throw new GLException("Not a GL2ES1 implementation"); -} - -@Override -public final GL2ES2 getGL2ES2() throws GLException { - return this; -} - -@Override -public final GL2GL3 getGL2GL3() throws GLException { - throw new GLException("Not a GL2GL3 implementation"); -} - -// -// Helpers for ensuring the correct amount of texture data -// - -private final GLBufferSizeTracker bufferSizeTracker; -private final GLBufferStateTracker bufferStateTracker; -private final GLStateTracker glStateTracker; - -private final boolean checkBufferObject(boolean enabled, - int state, - String kind, boolean throwException) { - final int buffer = bufferStateTracker.getBoundBufferObject(state, this); - if (enabled) { - if (0 == buffer) { - if(throwException) { - throw new GLException(kind + " must be enabled to call this method"); - } - return false; - } - } else { - if (0 != buffer) { - if(throwException) { - throw new GLException(kind + " must be disabled to call this method"); - } - return false; - } - } - return true; -} - -private final boolean checkArrayVBODisabled(boolean throwException) { - return checkBufferObject(false, // enabled - GL.GL_ARRAY_BUFFER, - "array vertex_buffer_object", throwException); -} - -private final boolean checkArrayVBOEnabled(boolean throwException) { - return checkBufferObject(true, // enabled - GL.GL_ARRAY_BUFFER, - "array vertex_buffer_object", throwException); -} - -private final boolean checkElementVBODisabled(boolean throwException) { - return checkBufferObject(false, // enabled - GL.GL_ELEMENT_ARRAY_BUFFER, - "element vertex_buffer_object", throwException); -} - -private final boolean checkElementVBOEnabled(boolean throwException) { - return checkBufferObject(true, // enabled - GL.GL_ELEMENT_ARRAY_BUFFER, - "element vertex_buffer_object", throwException); -} - -private final boolean checkUnpackPBODisabled(boolean throwException) { - // PBO n/a for ES 1.1 or ES 2.0 - return true; -} - -private final boolean checkUnpackPBOEnabled(boolean throwException) { - // PBO n/a for ES 1.1 or ES 2.0 - return false; -} - -private final boolean checkPackPBODisabled(boolean throwException) { - // PBO n/a for ES 1.1 or ES 2.0 - return true; -} - -private final boolean checkPackPBOEnabled(boolean throwException) { - // PBO n/a for ES 1.1 or ES 2.0 - return false; -} - -private final HashMap<MemoryObject, MemoryObject> arbMemCache = new HashMap<MemoryObject, MemoryObject>(); - -/** Entry point to C language function: <br> <code> LPVOID glMapBuffer(GLenum target, GLenum access); </code> */ -@Override -public final java.nio.ByteBuffer glMapBuffer(int target, int access) { - final long __addr_ = ((GLES2ProcAddressTable)_context.getGLProcAddressTable())._addressof_glMapBuffer; - if (__addr_ == 0) { - throw new GLException("Method \"glMapBuffer\" not available"); - } - final long sz = bufferSizeTracker.getBufferSize(bufferStateTracker, target, this); - if (0 == sz) { - return null; - } - final long addr = dispatch_glMapBuffer(target, access, __addr_); - if (0 == addr) { - return null; - } - ByteBuffer buffer; - MemoryObject memObj0 = new MemoryObject(addr, sz); // object and key - MemoryObject memObj1 = MemoryObject.getOrAddSafe(arbMemCache, memObj0); - if(memObj0 == memObj1) { - // just added .. - if(null != memObj0.getBuffer()) { - throw new InternalError(); - } - buffer = newDirectByteBuffer(addr, sz); - Buffers.nativeOrder(buffer); - memObj0.setBuffer(buffer); - } else { - // already mapped - buffer = memObj1.getBuffer(); - if(null == buffer) { - throw new InternalError(); - } - } - buffer.position(0); - return buffer; -} - -/** Encapsulates function pointer for OpenGL function <br>: <code> LPVOID glMapBuffer(GLenum target, GLenum access); </code> */ -native private long dispatch_glMapBuffer(int target, int access, long glProcAddress); - -native private ByteBuffer newDirectByteBuffer(long addr, long capacity); - -@Override -public final void glClearDepth(double depth) { - glClearDepthf((float)depth); -} - -@Override -public final void glDepthRange(double zNear, double zFar) { - glDepthRangef((float)zNear, (float)zFar); -} - diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gles3.java b/make/config/jogl/gl-impl-CustomJavaCode-gles3.java new file mode 100644 index 000000000..e0b0c6a09 --- /dev/null +++ b/make/config/jogl/gl-impl-CustomJavaCode-gles3.java @@ -0,0 +1,320 @@ + +public GLES3Impl(GLProfile glp, GLContextImpl context) { + this._context = context; + if(null != context) { + this.bufferSizeTracker = context.getBufferSizeTracker(); + this.bufferStateTracker = context.getBufferStateTracker(); + this.glStateTracker = context.getGLStateTracker(); + } else { + this.bufferSizeTracker = null; + this.bufferStateTracker = null; + this.glStateTracker = null; + } + this.glProfile = glp; + this._isES3 = glp.getImplName() == GLProfile.GLES3; +} + +@Override +public final boolean isGL4bc() { + return false; +} + +@Override +public final boolean isGL4() { + return false; +} + +@Override +public final boolean isGL3bc() { + return false; +} + +@Override +public final boolean isGL3() { + return false; +} + +public final boolean isGL2() { + return false; +} + +@Override +public final boolean isGLES1() { + return false; +} + +@Override +public final boolean isGLES2() { + return true; +} + +@Override +public final boolean isGLES3() { + return _isES3; +} + +@Override +public final boolean isGLES() { + return true; +} + +@Override +public final boolean isGL2ES1() { + return false; +} + +@Override +public final boolean isGL2ES2() { + return true; +} + +@Override +public final boolean isGL3ES3() { + return _isES3; +} + +@Override +public final boolean isGL4ES3() { + return _isES3; +} + +@Override +public final boolean isGLES2Compatible() { + return true; +} + +@Override +public final boolean isGLES3Compatible() { + return _isES3; +} + + +@Override +public final boolean isGL2GL3() { + return false; +} + +@Override +public final boolean hasGLSL() { + return true; +} + +@Override +public boolean isNPOTTextureAvailable() { + return true; +} + +@Override +public final GL4bc getGL4bc() throws GLException { + throw new GLException("Not a GL4bc implementation"); +} + +@Override +public final GL4 getGL4() throws GLException { + throw new GLException("Not a GL4 implementation"); +} + +@Override +public final GL3bc getGL3bc() throws GLException { + throw new GLException("Not a GL3bc implementation"); +} + +@Override +public final GL3 getGL3() throws GLException { + throw new GLException("Not a GL3 implementation"); +} + +@Override +public final GL2 getGL2() throws GLException { + throw new GLException("Not a GL2 implementation"); +} + +@Override +public final GLES1 getGLES1() throws GLException { + throw new GLException("Not a GLES1 implementation"); +} + +@Override +public final GLES2 getGLES2() throws GLException { + return this; +} + +@Override +public final GLES3 getGLES3() throws GLException { + return this; +} + +@Override +public final GL2ES1 getGL2ES1() throws GLException { + throw new GLException("Not a GL2ES1 implementation"); +} + +@Override +public final GL2ES2 getGL2ES2() throws GLException { + return this; +} + +@Override +public final GL3ES3 getGL3ES3() throws GLException { + if(!_isES3) { + throw new GLException("Not a GL3ES3 implementation"); + } + return this; +} + +@Override +public final GL4ES3 getGL4ES3() throws GLException { + if(!_isES3) { + throw new GLException("Not a GL4ES3 implementation"); + } + return this; +} + +@Override +public final GL2GL3 getGL2GL3() throws GLException { + throw new GLException("Not a GL2GL3 implementation"); +} + +// +// Helpers for ensuring the correct amount of texture data +// + +private final boolean _isES3; +private final GLBufferSizeTracker bufferSizeTracker; +private final GLBufferStateTracker bufferStateTracker; +private final GLStateTracker glStateTracker; + +private final boolean checkBufferObject(boolean extensionAvail, + boolean allowVAO, + boolean enabled, + int state, + String kind, boolean throwException) { + if ( !extensionAvail ) { + if ( !enabled ) { + return true; + } + if(throwException) { + throw new GLException("Required extensions not available to call this function"); + } + return false; + } + int buffer = bufferStateTracker.getBoundBufferObject(state, this); + if ( enabled ) { + if ( 0 != buffer ) { + return true; + } + if ( allowVAO ) { + buffer = bufferStateTracker.getBoundBufferObject(GLES3.GL_VERTEX_ARRAY_BINDING, this); + if( 0 != buffer && !_context.isDefaultVAO(buffer) ) { + return true; + } + } + if ( throwException ) { + throw new GLException(kind + " must be enabled to call this method"); + } + return false; + } else { + if ( 0 == buffer ) { + return true; + } + if ( throwException ) { + throw new GLException(kind + " must be disabled to call this method"); + } + return false; + } +} + +private final boolean checkArrayVBODisabled(boolean throwException) { + return checkBufferObject(true, + _isES3, // allowVAO + false, // enable + GL.GL_ARRAY_BUFFER, + "array vertex_buffer_object", throwException); +} + +private final boolean checkArrayVBOEnabled(boolean throwException) { + return checkBufferObject(true, + _isES3, // allowVAO + true, // enable + GL.GL_ARRAY_BUFFER, + "array vertex_buffer_object", throwException); +} + +private final boolean checkElementVBODisabled(boolean throwException) { + return checkBufferObject(true, + _isES3, // allowVAO + false, // enable + GL.GL_ELEMENT_ARRAY_BUFFER, + "element vertex_buffer_object", throwException); +} + +private final boolean checkElementVBOEnabled(boolean throwException) { + return checkBufferObject(true, + _isES3, // allowVAO + true, // enable + GL.GL_ELEMENT_ARRAY_BUFFER, + "element vertex_buffer_object", throwException); +} + +private final boolean checkUnpackPBODisabled(boolean throwException) { + return checkBufferObject(_isES3, + false, // allowVAO + false, // enable + GL2.GL_PIXEL_UNPACK_BUFFER, + "unpack pixel_buffer_object", throwException); +} + +private final boolean checkUnpackPBOEnabled(boolean throwException) { + return checkBufferObject(_isES3, + false, // allowVAO + true, // enable + GL2.GL_PIXEL_UNPACK_BUFFER, + "unpack pixel_buffer_object", throwException); +} + +private final boolean checkPackPBODisabled(boolean throwException) { + return checkBufferObject(_isES3, + false, // allowVAO + false, // enable + GL2.GL_PIXEL_PACK_BUFFER, + "pack pixel_buffer_object", throwException); +} + +private final boolean checkPackPBOEnabled(boolean throwException) { + return checkBufferObject(_isES3, + false, // allowVAO + true, // enable + GL2.GL_PIXEL_PACK_BUFFER, + "pack pixel_buffer_object", throwException); +} + +@Override +public final boolean glIsPBOPackEnabled() { + return checkPackPBOEnabled(false); +} + +@Override +public final boolean glIsPBOUnpackEnabled() { + return checkUnpackPBOEnabled(false); +} + +/** Entry point to C language function: <code> void * {@native glMapBuffer}(GLenum target, GLenum access); </code> <br>Part of <code>GL_VERSION_1_5</code>; <code>GL_OES_mapbuffer</code> */ +public final java.nio.ByteBuffer glMapBuffer(int target, int access) { + return glMapBufferImpl(target, false, 0, 0, access, ((GLES3ProcAddressTable)_context.getGLProcAddressTable())._addressof_glMapBuffer); +} + +/** Entry point to C language function: <code> void * {@native glMapBufferRange}(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); </code> <br>Part of <code>GL_ES_VERSION_3_0</code>, <code>GL_VERSION_3_0</code>; <code>GL_EXT_map_buffer_range</code> */ +public final ByteBuffer glMapBufferRange(int target, long offset, long length, int access) { + return glMapBufferImpl(target, true, offset, length, access, ((GLES3ProcAddressTable)_context.getGLProcAddressTable())._addressof_glMapBufferRange); +} + +@Override +public final void glClearDepth(double depth) { + glClearDepthf((float)depth); +} + +@Override +public final void glDepthRange(double zNear, double zFar) { + glDepthRangef((float)zNear, (float)zFar); +} + diff --git a/make/config/jogl/gl2_es2-CustomJavaCode.cfg b/make/config/jogl/gl2_es2-CustomJavaCode.cfg new file mode 100644 index 000000000..b769f3b29 --- /dev/null +++ b/make/config/jogl/gl2_es2-CustomJavaCode.cfg @@ -0,0 +1,13 @@ + +JavaPrologue glReleaseShaderCompiler if ( !_context.isGLES2Compatible() ) { +JavaPrologue glReleaseShaderCompiler return; +JavaPrologue glReleaseShaderCompiler } + +JavaPrologue glShaderBinary if ( !_context.isGLES2Compatible() ) { +JavaPrologue glShaderBinary throw new GLException("Method \"glShaderBinary\" not available"); +JavaPrologue glShaderBinary } + +JavaPrologue glGetShaderPrecisionFormat if ( !_context.isGLES2Compatible() ) { +JavaPrologue glGetShaderPrecisionFormat throw new GLException("Method \"glGetShaderPrecisionFormat\" not available"); +JavaPrologue glGetShaderPrecisionFormat } + diff --git a/make/config/jogl/gl2_es2-common.cfg b/make/config/jogl/gl2_es2-common.cfg index b769f3b29..2ad7fd3fd 100644 --- a/make/config/jogl/gl2_es2-common.cfg +++ b/make/config/jogl/gl2_es2-common.cfg @@ -1,13 +1,11 @@ -JavaPrologue glReleaseShaderCompiler if ( !_context.isGLES2Compatible() ) { -JavaPrologue glReleaseShaderCompiler return; -JavaPrologue glReleaseShaderCompiler } +RenameExtensionIntoCore GL_KHR_debug +RenameExtensionIntoCore GL_OES_texture_3D +RenameExtensionIntoCore GL_OES_get_program_binary +RenameExtensionIntoCore GL_OES_required_internalformat +RenameExtensionIntoCore GL_EXT_unpack_subimage -JavaPrologue glShaderBinary if ( !_context.isGLES2Compatible() ) { -JavaPrologue glShaderBinary throw new GLException("Method \"glShaderBinary\" not available"); -JavaPrologue glShaderBinary } +ForceExtension GL_EXT_occlusion_query_boolean -JavaPrologue glGetShaderPrecisionFormat if ( !_context.isGLES2Compatible() ) { -JavaPrologue glGetShaderPrecisionFormat throw new GLException("Method \"glGetShaderPrecisionFormat\" not available"); -JavaPrologue glGetShaderPrecisionFormat } +ForceExtension GL_ARB_ES2_compatibility diff --git a/make/config/jogl/gl2_es3-common.cfg b/make/config/jogl/gl2_es3-common.cfg new file mode 100644 index 000000000..b5326b159 --- /dev/null +++ b/make/config/jogl/gl2_es3-common.cfg @@ -0,0 +1,9 @@ + +RenameExtensionIntoCore GL_KHR_debug +RenameExtensionIntoCore GL_OES_texture_3D +IgnoreExtension GL_OES_get_program_binary +RenameExtensionIntoCore GL_OES_required_internalformat +RenameExtensionIntoCore GL_EXT_unpack_subimage + +ForceExtension GL_EXT_occlusion_query_boolean + diff --git a/make/config/jogl/gl3-common.cfg b/make/config/jogl/gl3-common.cfg new file mode 100644 index 000000000..e11c50aa3 --- /dev/null +++ b/make/config/jogl/gl3-common.cfg @@ -0,0 +1,9 @@ + +ForceExtension GL_ARB_debug_output +RenameExtensionIntoCore GL_KHR_debug + +RenameExtensionIntoCore GL_OES_texture_3D +IgnoreExtension GL_OES_get_program_binary +RenameExtensionIntoCore GL_OES_required_internalformat +RenameExtensionIntoCore GL_EXT_unpack_subimage + diff --git a/make/config/jogl/gl3-desktop.cfg b/make/config/jogl/gl3-desktop.cfg index 96e59aa05..4a2c53371 100644 --- a/make/config/jogl/gl3-desktop.cfg +++ b/make/config/jogl/gl3-desktop.cfg @@ -1,11 +1,6 @@ # This .cfg file provides common options used by the desktop OpenGL # implementation on all platforms. -# Inform the glue code generator of the association between #defines -# and functions and the extensions in which they are defined -GLHeader GL3/gl3.h -GLHeader GL3/gl3ext.h - #Include gl-desktop-tracker.cfg # diff --git a/make/config/jogl/gl3-headers.cfg b/make/config/jogl/gl3-headers.cfg index 8b35a07b4..7ab5099c9 100644 --- a/make/config/jogl/gl3-headers.cfg +++ b/make/config/jogl/gl3-headers.cfg @@ -1,7 +1,6 @@ CustomCCode #include <stdio.h> /* android */ -CustomCCode /* Define GL3_PROTOTYPES so that the OpenGL extension prototypes in -CustomCCode "gl3.h" are parsed. */ -CustomCCode #define GL3_PROTOTYPES +CustomCCode /** Define GL_GLEXT_PROTOTYPES so that the OpenGL extension prototypes are parsed. */ +CustomCCode #define GL_GLEXT_PROTOTYPES CustomCCode #if defined(_WIN32) CustomCCode #define WIN32_LEAN_AND_MEAN CustomCCode #include <windows.h> @@ -9,11 +8,13 @@ CustomCCode #undef WIN32_LEAN_AND_MEAN CustomCCode #include <stdlib.h> CustomCCode #include <stddef.h> CustomCCode #include <malloc.h> -CustomCCode #include <GL3/gl3.h> +CustomCCode #include <GL/glcorearb.h> +CustomCCode #include <GL/glcorearbext.h> CustomCCode #elif defined(macosx) CustomCCode #include <inttypes.h> CustomCCode #include <stdlib.h> -CustomCCode #include <GL3/gl3.h> +CustomCCode #include <GL/glcorearb.h> +CustomCCode #include <GL/glcorearbext.h> CustomCCode #include </usr/include/machine/types.h> CustomCCode /* Provide Windows typedefs */ CustomCCode typedef void* LPVOID; @@ -22,5 +23,6 @@ CustomCCode #elif defined(__unix__) CustomCCode #include <inttypes.h> CustomCCode #include <stdlib.h> CustomCCode #include <X11/Xlib.h> -CustomCCode #include <GL3/gl3.h> +CustomCCode #include <GL/glcorearb.h> +CustomCCode #include <GL/glcorearbext.h> CustomCCode #endif diff --git a/make/config/jogl/gl3ext-headers.cfg b/make/config/jogl/gl3ext-headers.cfg index 5e2c7aa37..24b1ba518 100644 --- a/make/config/jogl/gl3ext-headers.cfg +++ b/make/config/jogl/gl3ext-headers.cfg @@ -1,6 +1,4 @@ CustomCCode #include <stdio.h> /* android */ -CustomCCode /* Define GL_GL3EXT_PROTOTYPES so that the OpenGL extension prototypes in -CustomCCode "gl3ext.h" are parsed. */ -CustomCCode #define GL_GL3EXT_PROTOTYPES -CustomCCode #include <GL3/gl3ext.h> -CustomCCode #include <GL3/gl3ext.h> +CustomCCode /** Define GL_GLEXT_PROTOTYPES so that the OpenGL extension prototypes are parsed. */ +CustomCCode #define GL_GLEXT_PROTOTYPES +CustomCCode #include <GL/glcorearbext.h> diff --git a/make/config/jogl/glx-x11.cfg b/make/config/jogl/glx-x11.cfg index 017b1e00b..5955e0a38 100644 --- a/make/config/jogl/glx-x11.cfg +++ b/make/config/jogl/glx-x11.cfg @@ -20,7 +20,6 @@ NIODirectOnly __ALL__ ForceProcAddressGen __ALL__ LocalProcAddressCallingConvention __ALL__ APIENTRY -AllowNonGLExtensions true EmitProcAddressTable true ProcAddressTableClassName GLXProcAddressTable GetProcAddressTableExpr glxProcAddressTable |