aboutsummaryrefslogtreecommitdiffstats
path: root/make/config
diff options
context:
space:
mode:
Diffstat (limited to 'make/config')
-rwxr-xr-xmake/config/jogl/cg-common-CustomJavaCode.java2
-rw-r--r--make/config/jogl/cg-common.cfg8
-rw-r--r--make/config/jogl/cgl-macosx.cfg2
-rwxr-xr-xmake/config/jogl/cglext.cfg4
-rw-r--r--make/config/jogl/egl-common.cfg3
-rwxr-xr-xmake/config/jogl/egl.cfg6
-rwxr-xr-xmake/config/jogl/eglext.cfg6
-rw-r--r--make/config/jogl/gl-common.cfg11
-rwxr-xr-xmake/config/jogl/gl-desktop.cfg2
-rwxr-xr-xmake/config/jogl/gl-es1.cfg4
-rwxr-xr-xmake/config/jogl/gl-es2.cfg4
-rw-r--r--make/config/jogl/gl-gl2.cfg48
-rw-r--r--make/config/jogl/gl-gl2es12.cfg4
-rw-r--r--make/config/jogl/gl-gl3.cfg45
-rw-r--r--make/config/jogl/gl-gl3bc.cfg65
-rw-r--r--make/config/jogl/gl-gl4.cfg37
-rw-r--r--make/config/jogl/gl-gl4bc.cfg110
-rw-r--r--make/config/jogl/gl-impl-CustomCCode-gl2es12.c8
-rw-r--r--make/config/jogl/gl-impl-CustomCCode-gl3.c24
-rw-r--r--make/config/jogl/gl-impl-CustomCCode-gl3bc.c24
-rw-r--r--make/config/jogl/gl-impl-CustomCCode-gl4bc.c (renamed from make/config/jogl/gl-impl-CustomCCode-gl2.c)8
-rw-r--r--make/config/jogl/gl-impl-CustomCCode-gles1.c8
-rw-r--r--make/config/jogl/gl-impl-CustomCCode-gles2.c8
-rw-r--r--make/config/jogl/gl-impl-CustomJavaCode-common.java74
-rw-r--r--make/config/jogl/gl-impl-CustomJavaCode-desktop.java250
-rw-r--r--make/config/jogl/gl-impl-CustomJavaCode-gl2.java498
-rw-r--r--make/config/jogl/gl-impl-CustomJavaCode-gl2es12.java49
-rw-r--r--make/config/jogl/gl-impl-CustomJavaCode-gl4.java (renamed from make/config/jogl/gl-impl-CustomJavaCode-gl3.java)113
-rw-r--r--make/config/jogl/gl-impl-CustomJavaCode-gl4bc.java (renamed from make/config/jogl/gl-impl-CustomJavaCode-gl3bc.java)117
-rwxr-xr-xmake/config/jogl/gl-impl-CustomJavaCode-gles1.java51
-rwxr-xr-xmake/config/jogl/gl-impl-CustomJavaCode-gles2.java51
-rw-r--r--make/config/jogl/gl3-common.cfg3
-rwxr-xr-xmake/config/jogl/gl3-desktop.cfg2
-rwxr-xr-xmake/config/jogl/gl3ext-headers.cfg5
-rw-r--r--make/config/jogl/gl4-common.cfg5
-rw-r--r--make/config/jogl/gl4-desktop-tracker.cfg (renamed from make/config/jogl/gl3-desktop-tracker.cfg)0
-rwxr-xr-xmake/config/jogl/glu-CustomJavaCode-base.java4
-rwxr-xr-xmake/config/jogl/glu-CustomJavaCode-gl2es1.java2
-rwxr-xr-xmake/config/jogl/glu-base.cfg4
-rw-r--r--make/config/jogl/glu-common.cfg9
-rwxr-xr-xmake/config/jogl/glu-gl2.cfg14
-rwxr-xr-xmake/config/jogl/glu-gl2es1.cfg2
-rwxr-xr-xmake/config/jogl/glx-CustomCCode.c31
-rw-r--r--make/config/jogl/glx-CustomJavaCode.java8
-rw-r--r--make/config/jogl/glx-x11.cfg4
-rwxr-xr-xmake/config/jogl/glxext.cfg8
-rw-r--r--make/config/jogl/wgl-win32.cfg2
-rw-r--r--make/config/jogl/wglext.cfg4
-rwxr-xr-xmake/config/nativewindow/jawt-DrawingSurfaceInfo-CustomJavaCode.java6
-rw-r--r--make/config/nativewindow/jawt-macosx.cfg6
-rw-r--r--make/config/nativewindow/jawt-win32.cfg6
-rw-r--r--make/config/nativewindow/jawt-x11.cfg6
-rwxr-xr-xmake/config/nativewindow/x11-CustomCCode.c169
-rw-r--r--make/config/nativewindow/x11-CustomJavaCode.java16
-rw-r--r--make/config/nativewindow/x11-lib.cfg21
55 files changed, 580 insertions, 1401 deletions
diff --git a/make/config/jogl/cg-common-CustomJavaCode.java b/make/config/jogl/cg-common-CustomJavaCode.java
index 1f109d9f6..d1e4f8bf5 100755
--- a/make/config/jogl/cg-common-CustomJavaCode.java
+++ b/make/config/jogl/cg-common-CustomJavaCode.java
@@ -1,5 +1,5 @@
static {
- com.sun.opengl.impl.NativeLibLoader.loadCgImpl();
+ com.jogamp.opengl.impl.GLJNILibLoader.loadCgImpl();
}
/** A convenience method which reads all available data from the InputStream and then calls cgCreateProgram. */
diff --git a/make/config/jogl/cg-common.cfg b/make/config/jogl/cg-common.cfg
index 9b8dba079..927d233a8 100644
--- a/make/config/jogl/cg-common.cfg
+++ b/make/config/jogl/cg-common.cfg
@@ -1,6 +1,6 @@
# This .cfg file provides common options used among all Cg glue code
# generated for Jogl on all platforms.
-Package com.sun.opengl.cg
+Package com.jogamp.opengl.cg
JavaClass CgGL
Style AllStatic
JavaOutputDir gensrc/classes
@@ -92,12 +92,8 @@ Ignore cgGetIntStateAssignmentValues
Ignore cgGetParameterValues
Ignore cgGetProgramOptions
-#
-# Need to import New IO for Buffer classes
-#
-Import java.nio.*
# And NativeLibLoader for help loading the native libraries
-Import com.sun.opengl.impl.*
+Import com.jogamp.opengl.impl.*
#
# NIODirectOnly directives for routines requiring them for semantic reasons
diff --git a/make/config/jogl/cgl-macosx.cfg b/make/config/jogl/cgl-macosx.cfg
index 54b4be171..f2af29e00 100644
--- a/make/config/jogl/cgl-macosx.cfg
+++ b/make/config/jogl/cgl-macosx.cfg
@@ -3,7 +3,7 @@
JavaOutputDir gensrc/classes
NativeOutputDir gensrc/native/jogl/MacOSX
-Package com.sun.opengl.impl.macosx.cgl
+Package com.jogamp.opengl.impl.macosx.cgl
JavaClass CGL
Style allstatic
Include gl-common.cfg
diff --git a/make/config/jogl/cglext.cfg b/make/config/jogl/cglext.cfg
index 3bd027c84..404a852b0 100755
--- a/make/config/jogl/cglext.cfg
+++ b/make/config/jogl/cglext.cfg
@@ -6,10 +6,10 @@
JavaOutputDir gensrc/classes
NativeOutputDir gensrc/native/jogl/MacOSX
-Package com.sun.opengl.impl.macosx.cgl
+Package com.jogamp.opengl.impl.macosx.cgl
Style InterfaceAndImpl
JavaClass CGLExt
-ImplPackage com.sun.opengl.impl.macosx.cgl
+ImplPackage com.jogamp.opengl.impl.macosx.cgl
ImplJavaClass CGLExtImpl
Include gl-common.cfg
Include gl-desktop.cfg
diff --git a/make/config/jogl/egl-common.cfg b/make/config/jogl/egl-common.cfg
index bcda00b07..fd65d5c10 100644
--- a/make/config/jogl/egl-common.cfg
+++ b/make/config/jogl/egl-common.cfg
@@ -4,11 +4,10 @@ GLHeader EGL/egl.h
GLHeader EGL/eglext.h
# Imports needed by all glue code
-Import java.nio.*
Import java.util.*
Import javax.media.opengl.*
Import javax.media.opengl.fixedfunc.*
-Import com.sun.opengl.impl.*
+Import com.jogamp.opengl.impl.*
# Treat all of the EGL types as opaque longs
# Opaque long EGLConfig
diff --git a/make/config/jogl/egl.cfg b/make/config/jogl/egl.cfg
index 26979fb6d..74047072b 100755
--- a/make/config/jogl/egl.cfg
+++ b/make/config/jogl/egl.cfg
@@ -3,7 +3,7 @@
JavaOutputDir gensrc/classes
NativeOutputDir gensrc/native/jogl/egl
-Package com.sun.opengl.impl.egl
+Package com.jogamp.opengl.impl.egl
JavaClass EGL
Style allstatic
# Shouldn't matter which one of these we pick up
@@ -43,8 +43,8 @@ CustomJavaCode EGL {
CustomJavaCode EGL if (eglGetProcAddressHandle == 0) {
CustomJavaCode EGL throw new GLException("Passed null pointer for method \"eglGetProcAddress\"");
CustomJavaCode EGL }
-CustomJavaCode EGL return dispatch_eglGetProcAddress0(procname, eglGetProcAddressHandle);
+CustomJavaCode EGL return dispatch_eglGetProcAddress1(procname, eglGetProcAddressHandle);
CustomJavaCode EGL }
-Import com.sun.gluegen.runtime.opengl.GLProcAddressHelper
+Import com.jogamp.gluegen.runtime.opengl.GLProcAddressHelper
diff --git a/make/config/jogl/eglext.cfg b/make/config/jogl/eglext.cfg
index fedff35e9..40239371d 100755
--- a/make/config/jogl/eglext.cfg
+++ b/make/config/jogl/eglext.cfg
@@ -3,15 +3,15 @@
JavaOutputDir gensrc/classes
NativeOutputDir gensrc/native/jogl/egl
-Package com.sun.opengl.impl.egl
+Package com.jogamp.opengl.impl.egl
Style InterfaceAndImpl
JavaClass EGLExt
-ImplPackage com.sun.opengl.impl.egl
+ImplPackage com.jogamp.opengl.impl.egl
ImplJavaClass EGLExtImpl
# Shouldn't matter which one of these we pick up
Include egl-common.cfg
-ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/com/sun/opengl/impl/egl/EGL.java
+ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/com/jogamp/opengl/impl/egl/EGL.java
HierarchicalNativeOutput false
diff --git a/make/config/jogl/gl-common.cfg b/make/config/jogl/gl-common.cfg
index d9d66323a..8d726c4bf 100644
--- a/make/config/jogl/gl-common.cfg
+++ b/make/config/jogl/gl-common.cfg
@@ -8,11 +8,10 @@ RuntimeExceptionType GLException
UnsupportedExceptionType GLException
# Imports needed by all glue code
-Import java.nio.*
Import java.util.*
Import javax.media.opengl.*
Import javax.media.opengl.fixedfunc.*
-Import com.sun.opengl.impl.*
+Import com.jogamp.opengl.impl.*
#####################################################################
# Mostly desktop OpenGL stuff below
@@ -389,8 +388,12 @@ ArgumentIsString glTransformFeedbackVaryings 2
# Use cached GL_EXTENSION if possible,
# which also allows GL3 compatibility.
#
-JavaPrologue glGetString if(GL.GL_EXTENSIONS==name && _context.isExtensionCacheInitialized()) {
-JavaPrologue glGetString return _context.getGLExtensions();
+JavaPrologue glGetString if(_context.isExtensionCacheInitialized()) {
+JavaPrologue glGetString if(GL.GL_EXTENSIONS==name) {
+JavaPrologue glGetString return _context.getGLExtensions();
+JavaPrologue glGetString } /* else if(GL.GL_VERSION==name) {
+JavaPrologue glGetString return _context.getGLVersion();
+JavaPrologue glGetString } */
JavaPrologue glGetString }
#
diff --git a/make/config/jogl/gl-desktop.cfg b/make/config/jogl/gl-desktop.cfg
index 7e500a4f0..f35ed254b 100755
--- a/make/config/jogl/gl-desktop.cfg
+++ b/make/config/jogl/gl-desktop.cfg
@@ -65,6 +65,6 @@ TemporaryCVariableDeclaration glXChooseFBConfigSGIX int count;
TemporaryCVariableAssignment glXChooseFBConfigSGIX count = _ptr3[0];
ReturnValueCapacity glXChooseFBConfigSGIX count * sizeof(GLXFBConfig)
TemporaryCVariableDeclaration glXGetFBConfigs int count;
-TemporaryCVariableAssignment glXGetFBConfigs count = _ptr2[0];
+TemporaryCVariableAssignment glXGetFBConfigs count = _nelements_ptr[0];
ReturnValueCapacity glXGetFBConfigs count * sizeof(GLXFBConfig)
diff --git a/make/config/jogl/gl-es1.cfg b/make/config/jogl/gl-es1.cfg
index 867ef8a83..da2267186 100755
--- a/make/config/jogl/gl-es1.cfg
+++ b/make/config/jogl/gl-es1.cfg
@@ -17,7 +17,7 @@ JavaClass GLES1
Extends GLES1 GLBase
Extends GLES1 GL
Extends GLES1 GL2ES1
-ImplPackage com.sun.opengl.impl.es1
+ImplPackage com.jogamp.opengl.impl.es1
ImplJavaClass GLES1Impl
Implements GLES1Impl GLBase
Implements GLES1Impl GL
@@ -97,4 +97,4 @@ IncludeAs CustomCCode gl-impl-CustomCCode-gles1.c
Import javax.media.opengl.GLES1
Import javax.media.opengl.GLES2
Import javax.media.opengl.GL2
-Import com.sun.opengl.impl.InternalBufferUtil
+Import com.jogamp.opengl.impl.InternalBufferUtil
diff --git a/make/config/jogl/gl-es2.cfg b/make/config/jogl/gl-es2.cfg
index f78001dee..fd11ffcf0 100755
--- a/make/config/jogl/gl-es2.cfg
+++ b/make/config/jogl/gl-es2.cfg
@@ -12,7 +12,7 @@ JavaClass GLES2
Extends GLES2 GLBase
Extends GLES2 GL
Extends GLES2 GL2ES2
-ImplPackage com.sun.opengl.impl.es2
+ImplPackage com.jogamp.opengl.impl.es2
ImplJavaClass GLES2Impl
Implements GLES2Impl GLBase
Implements GLES2Impl GL
@@ -79,6 +79,6 @@ Import javax.media.opengl.GLES2
Import javax.media.opengl.GL2
Import javax.media.opengl.GLArrayData
Import javax.media.opengl.GLUniformData
-Import com.sun.opengl.impl.InternalBufferUtil
+Import com.jogamp.opengl.impl.InternalBufferUtil
Import java.io.PrintStream
diff --git a/make/config/jogl/gl-gl2.cfg b/make/config/jogl/gl-gl2.cfg
index 820243ff5..48dd8eda6 100644
--- a/make/config/jogl/gl-gl2.cfg
+++ b/make/config/jogl/gl-gl2.cfg
@@ -12,72 +12,32 @@ ExtendedInterfaceSymbolsIgnore ../src/jogl/classes/javax/media/opengl/fixedfunc/
ExtendedInterfaceSymbolsIgnore ../src/jogl/classes/javax/media/opengl/fixedfunc/GLLightingFunc.java
Package javax.media.opengl
-Style InterfaceAndImpl
+Style InterfaceOnly
JavaClass GL2
Extends GL2 GLBase
Extends GL2 GL
Extends GL2 GL2ES1
Extends GL2 GL2ES2
Extends GL2 GL2GL3
-ImplPackage com.sun.opengl.impl.gl2
-ImplJavaClass GL2Impl
-Implements GL2Impl GLBase
-Implements GL2Impl GL
-Implements GL2Impl GL2ES1
-Implements GL2Impl GL2ES2
-Implements GL2Impl GL2GL3
Include gl-common.cfg
Include gl-common-extensions.cfg
Include gl-desktop.cfg
-EmitProcAddressTable true
-ProcAddressTableClassName GL2ProcAddressTable
-GetProcAddressTableExpr ((GL2ProcAddressTable)_context.getGLProcAddressTable())
-
# Pick up on-line OpenGL javadoc thanks to user cylab on javagaming.org forums
TagNativeBinding true
# Ignore extensions that are already picked up via the GL2ES1 interface
IgnoreExtension GL_EXT_point_parameters
-# Add PixelStorei StateTracker
-#
-CustomJavaCode GL2Impl private static final int params_offset = 0; // just a helper for JavaPrologue ..
-
-JavaPrologue glPixelStorei glStateTracker.setInt(pname, param);
-
-JavaPrologue glGetIntegerv if ( glStateTracker.getInt(pname, params, params_offset) ) { return; }
-
CustomJavaCode GL2 public boolean glIsPBOPackEnabled();
CustomJavaCode GL2 public boolean glIsPBOUnpackEnabled();
IncludeAs CustomJavaCode GL2 gl-if-CustomJavaCode-gl2.java
-CustomJavaCode GL2Impl public void glFrustumf(float left, float right, float bottom, float top, float zNear, float zFar) {
-CustomJavaCode GL2Impl glFrustum((double)left, (double)right, (double)bottom, (double)top, (double)zNear, (double)zFar); }
-
-CustomJavaCode GL2Impl public void glOrthof(float left, float right, float bottom, float top, float zNear, float zFar) {
-CustomJavaCode GL2Impl glOrtho((double)left, (double)right, (double)bottom, (double)top, (double)zNear, (double)zFar); }
-
-CustomJavaCode GL2Impl public void glClearDepthf(float depth) {
-CustomJavaCode GL2Impl glClearDepth((double)depth); }
-
-CustomJavaCode GL2Impl public void glDepthRangef(float zNear, float zFar) {
-CustomJavaCode GL2Impl glDepthRange((double)zNear, (double)zFar); }
-
Include gl-headers.cfg
Include ../intptr.cfg
-IncludeAs CustomJavaCode GL2Impl gl-impl-CustomJavaCode-common.java
-IncludeAs CustomJavaCode GL2Impl gl-impl-CustomJavaCode-gl2.java
-IncludeAs CustomJavaCode GL2Impl gl-impl-CustomJavaCode-desktop.java
-IncludeAs CustomJavaCode GL2Impl gl-impl-CustomJavaCode-gl2_es2.java
-IncludeAs CustomCCode gl-impl-CustomCCode-gl2.c
+EmitProcAddressTable false
+ProcAddressTableClassName DontGenerateProcAddressTableStuff
+GetProcAddressTableExpr DontGenerateProcAddressTableStuff
-Import javax.media.opengl.GLES1
-Import javax.media.opengl.GLES2
-Import javax.media.opengl.GL2
-Import javax.media.opengl.GLArrayData
-Import javax.media.opengl.GLUniformData
-Import com.sun.opengl.impl.InternalBufferUtil
-Import java.io.PrintStream
diff --git a/make/config/jogl/gl-gl2es12.cfg b/make/config/jogl/gl-gl2es12.cfg
index 232116a61..3942b1419 100644
--- a/make/config/jogl/gl-gl2es12.cfg
+++ b/make/config/jogl/gl-gl2es12.cfg
@@ -11,7 +11,7 @@ ExtendedInterfaceSymbolsOnly ../src/jogl/classes/javax/media/opengl/fixedfunc/GL
ExtendedInterfaceSymbolsOnly ../src/jogl/classes/javax/media/opengl/fixedfunc/GLLightingFunc.java
Style ImplOnly
-ImplPackage com.sun.opengl.impl.gl2es12
+ImplPackage com.jogamp.opengl.impl.gl2es12
ImplJavaClass GL2ES12Impl
Implements GL2ES12Impl GLBase
Implements GL2ES12Impl GL
@@ -86,5 +86,5 @@ IncludeAs CustomCCode gl-impl-CustomCCode-gl2es12.c
Import javax.media.opengl.GLES1
Import javax.media.opengl.GLES2
-Import com.sun.opengl.impl.InternalBufferUtil
+Import com.jogamp.opengl.impl.InternalBufferUtil
Import java.io.PrintStream
diff --git a/make/config/jogl/gl-gl3.cfg b/make/config/jogl/gl-gl3.cfg
index 9f0ea05a8..d5e0003d4 100644
--- a/make/config/jogl/gl-gl3.cfg
+++ b/make/config/jogl/gl-gl3.cfg
@@ -8,13 +8,13 @@ ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/G
ExtendedInterfaceSymbolsIgnore ../src/jogl/classes/javax/media/opengl/GLBase.java
Package javax.media.opengl
-Style InterfaceAndImpl
+Style InterfaceOnly
JavaClass GL3
Extends GL3 GLBase
Extends GL3 GL
Extends GL3 GL2ES2
Extends GL3 GL2GL3
-ImplPackage com.sun.opengl.impl.gl3
+ImplPackage com.jogamp.opengl.impl.gl3
ImplJavaClass GL3Impl
Implements GL3Impl GLBase
Implements GL3Impl GL
@@ -27,48 +27,15 @@ Include gl3-desktop.cfg
IncludeAs CustomJavaCode GL3 gl-if-CustomJavaCode-gl3.java
-EmitProcAddressTable true
-ProcAddressTableClassName GL3ProcAddressTable
-GetProcAddressTableExpr ((GL3ProcAddressTable)_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
-# depend on the presence of an import library for a particular device
-ForceProcAddressGen __ALL__
-
-# Also force the calling conventions of the locally generated function
-# pointer typedefs for these routines to APIENTRY
-LocalProcAddressCallingConvention __ALL__ APIENTRY
+EmitProcAddressTable false
# Pick up on-line OpenGL javadoc thanks to user cylab on javagaming.org forums
TagNativeBinding true
-# Add PixelStorei StateTracker
-#
-CustomJavaCode GL3Impl private static final int params_offset = 0; // just a helper for JavaPrologue ..
-
-JavaPrologue glPixelStorei glStateTracker.setInt(pname, param);
-
-JavaPrologue glGetIntegerv if ( glStateTracker.getInt(pname, params, params_offset) ) { return; }
-
-CustomJavaCode GL3Impl public void glClearDepthf(float depth) {
-CustomJavaCode GL3Impl glClearDepth((double)depth); }
-
-CustomJavaCode GL3Impl public void glDepthRangef(float zNear, float zFar) {
-CustomJavaCode GL3Impl glDepthRange((double)zNear, (double)zFar); }
-
Include gl3-headers.cfg
Include ../intptr.cfg
-IncludeAs CustomJavaCode GL3Impl gl-impl-CustomJavaCode-common.java
-IncludeAs CustomJavaCode GL3Impl gl-impl-CustomJavaCode-gl3.java
-IncludeAs CustomJavaCode GL3Impl gl-impl-CustomJavaCode-desktop.java
-IncludeAs CustomJavaCode GL3Impl gl-impl-CustomJavaCode-gl2_es2.java
-IncludeAs CustomCCode gl-impl-CustomCCode-gl3.c
+EmitProcAddressTable false
+ProcAddressTableClassName DontGenerateProcAddressTableStuff
+GetProcAddressTableExpr DontGenerateProcAddressTableStuff
-Import javax.media.opengl.GLES2
-Import javax.media.opengl.GL3
-Import javax.media.opengl.GLArrayData
-Import javax.media.opengl.GLUniformData
-Import com.sun.opengl.impl.InternalBufferUtil
-Import java.io.PrintStream
diff --git a/make/config/jogl/gl-gl3bc.cfg b/make/config/jogl/gl-gl3bc.cfg
index d2525735e..7c53ea8d6 100644
--- a/make/config/jogl/gl-gl3bc.cfg
+++ b/make/config/jogl/gl-gl3bc.cfg
@@ -14,7 +14,7 @@ ExtendedInterfaceSymbolsIgnore ../src/jogl/classes/javax/media/opengl/fixedfunc/
ExtendedInterfaceSymbolsIgnore ../src/jogl/classes/javax/media/opengl/fixedfunc/GLLightingFunc.java
Package javax.media.opengl
-Style InterfaceAndImpl
+Style InterfaceOnly
JavaClass GL3bc
Extends GL3bc GLBase
Extends GL3bc GL
@@ -23,15 +23,6 @@ Extends GL3bc GL2ES2
Extends GL3bc GL2GL3
Extends GL3bc GL2
Extends GL3bc GL3
-ImplPackage com.sun.opengl.impl.gl3
-ImplJavaClass GL3bcImpl
-Implements GL3bcImpl GLBase
-Implements GL3bcImpl GL
-Implements GL3bcImpl GL2ES1
-Implements GL3bcImpl GL2ES2
-Implements GL3bcImpl GL2GL3
-Implements GL3bcImpl GL2
-Implements GL3bcImpl GL3
Include gl-common.cfg
Include gl-common-extensions.cfg
@@ -39,63 +30,17 @@ Include gl-desktop.cfg
Include gl3-common.cfg
Include gl3-desktop.cfg
-# Because we're manually implementing glMapBuffer but only producing
-# the implementing class, GlueGen doesn't notice that it has to emit a
-# proc address table entry for it. Force it to here.
-ForceProcAddressGen glMapBuffer
-
-# 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
-ForceProcAddressGen __ALL__
-
-# Also force the calling conventions of the locally generated function
-# pointer typedefs for these routines to APIENTRY
-LocalProcAddressCallingConvention __ALL__ APIENTRY
-
-EmitProcAddressTable true
-ProcAddressTableClassName GL3bcProcAddressTable
-GetProcAddressTableExpr ((GL3bcProcAddressTable)_context.getGLProcAddressTable())
-
# Pick up on-line OpenGL javadoc thanks to user cylab on javagaming.org forums
TagNativeBinding true
# Ignore extensions that are already picked up via the GL2ES1 interface
IgnoreExtension GL_EXT_point_parameters
-# Add PixelStorei StateTracker
-CustomJavaCode GL3bcImpl private static final int params_offset = 0; // just a helper for JavaPrologue ..
-
-JavaPrologue glPixelStorei glStateTracker.setInt(pname, param);
-
-JavaPrologue glGetIntegerv if ( glStateTracker.getInt(pname, params, params_offset) ) { return; }
-
-CustomJavaCode GL3bcImpl public void glFrustumf(float left, float right, float bottom, float top, float zNear, float zFar) {
-CustomJavaCode GL3bcImpl glFrustum((double)left, (double)right, (double)bottom, (double)top, (double)zNear, (double)zFar); }
-
-CustomJavaCode GL3bcImpl public void glOrthof(float left, float right, float bottom, float top, float zNear, float zFar) {
-CustomJavaCode GL3bcImpl glOrtho((double)left, (double)right, (double)bottom, (double)top, (double)zNear, (double)zFar); }
-
-CustomJavaCode GL3bcImpl public void glClearDepthf(float depth) {
-CustomJavaCode GL3bcImpl glClearDepth((double)depth); }
-
-CustomJavaCode GL3bcImpl public void glDepthRangef(float zNear, float zFar) {
-CustomJavaCode GL3bcImpl glDepthRange((double)zNear, (double)zFar); }
-
Include gl-headers.cfg
+Include gl3ext-headers.cfg
Include ../intptr.cfg
-IncludeAs CustomJavaCode GL3bcImpl gl-impl-CustomJavaCode-common.java
-IncludeAs CustomJavaCode GL3bcImpl gl-impl-CustomJavaCode-gl3bc.java
-IncludeAs CustomJavaCode GL3bcImpl gl-impl-CustomJavaCode-desktop.java
-IncludeAs CustomJavaCode GL3bcImpl gl-impl-CustomJavaCode-gl2_es2.java
-IncludeAs CustomCCode gl-impl-CustomCCode-gl3bc.c
+EmitProcAddressTable false
+ProcAddressTableClassName DontGenerateProcAddressTableStuff
+GetProcAddressTableExpr DontGenerateProcAddressTableStuff
-Import javax.media.opengl.GLES1
-Import javax.media.opengl.GLES2
-Import javax.media.opengl.GL2GL3
-Import javax.media.opengl.GL2
-Import javax.media.opengl.GL3
-Import javax.media.opengl.GL3bc
-Import com.sun.opengl.impl.InternalBufferUtil
-Import java.io.PrintStream
diff --git a/make/config/jogl/gl-gl4.cfg b/make/config/jogl/gl-gl4.cfg
new file mode 100644
index 000000000..1d4392899
--- /dev/null
+++ b/make/config/jogl/gl-gl4.cfg
@@ -0,0 +1,37 @@
+# This .cfg file is used to generate the GL interface and implementing class.
+JavaOutputDir gensrc/classes
+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/GL2GL3.java
+ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL3.java
+ExtendedInterfaceSymbolsIgnore ../src/jogl/classes/javax/media/opengl/GLBase.java
+
+Package javax.media.opengl
+Style InterfaceOnly
+JavaClass GL4
+Extends GL4 GLBase
+Extends GL4 GL
+Extends GL4 GL2ES2
+Extends GL4 GL2GL3
+Extends GL4 GL3
+Include gl-common.cfg
+Include gl-common-extensions.cfg
+Include gl3-common.cfg
+Include gl4-common.cfg
+Include gl3-desktop.cfg
+
+IncludeAs CustomJavaCode GL4 gl-if-CustomJavaCode-gl3.java
+
+EmitProcAddressTable false
+ProcAddressTableClassName DontGenerateProcAddressTableStuff
+GetProcAddressTableExpr DontGenerateProcAddressTableStuff
+
+
+# Pick up on-line OpenGL javadoc thanks to user cylab on javagaming.org forums
+TagNativeBinding true
+
+Include gl3-headers.cfg
+Include ../intptr.cfg
+
diff --git a/make/config/jogl/gl-gl4bc.cfg b/make/config/jogl/gl-gl4bc.cfg
new file mode 100644
index 000000000..3a3e02041
--- /dev/null
+++ b/make/config/jogl/gl-gl4bc.cfg
@@ -0,0 +1,110 @@
+# This .cfg file is used to generate the GL interface and implementing class.
+JavaOutputDir gensrc/classes
+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/GL2GL3.java
+ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL2.java
+ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL3.java
+ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL4.java
+ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL3bc.java
+ExtendedInterfaceSymbolsIgnore ../src/jogl/classes/javax/media/opengl/GLBase.java
+ExtendedInterfaceSymbolsIgnore ../src/jogl/classes/javax/media/opengl/fixedfunc/GLMatrixFunc.java
+ExtendedInterfaceSymbolsIgnore ../src/jogl/classes/javax/media/opengl/fixedfunc/GLPointerFunc.java
+ExtendedInterfaceSymbolsIgnore ../src/jogl/classes/javax/media/opengl/fixedfunc/GLLightingFunc.java
+
+Package javax.media.opengl
+Style InterfaceAndImpl
+JavaClass GL4bc
+Extends GL4bc GLBase
+Extends GL4bc GL
+Extends GL4bc GL2ES1
+Extends GL4bc GL2ES2
+Extends GL4bc GL2GL3
+Extends GL4bc GL2
+Extends GL4bc GL3
+Extends GL4bc GL3bc
+Extends GL4bc GL4
+ImplPackage com.jogamp.opengl.impl.gl4
+ImplJavaClass GL4bcImpl
+Implements GL4bcImpl GLBase
+Implements GL4bcImpl GL
+Implements GL4bcImpl GL2ES1
+Implements GL4bcImpl GL2ES2
+Implements GL4bcImpl GL2GL3
+Implements GL4bcImpl GL2
+Implements GL4bcImpl GL3
+Implements GL4bcImpl GL3bc
+Implements GL4bcImpl GL4
+
+Include gl-common.cfg
+Include gl-common-extensions.cfg
+Include gl-desktop.cfg
+Include gl3-common.cfg
+Include gl4-common.cfg
+Include gl3-desktop.cfg
+
+# Because we're manually implementing glMapBuffer but only producing
+# the implementing class, GlueGen doesn't notice that it has to emit a
+# proc address table entry for it. Force it to here.
+ForceProcAddressGen glMapBuffer
+
+# 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
+ForceProcAddressGen __ALL__
+
+# Also force the calling conventions of the locally generated function
+# pointer typedefs for these routines to APIENTRY
+LocalProcAddressCallingConvention __ALL__ APIENTRY
+
+EmitProcAddressTable true
+ProcAddressTableClassName GL4bcProcAddressTable
+GetProcAddressTableExpr ((GL4bcProcAddressTable)_context.getGLProcAddressTable())
+
+# Pick up on-line OpenGL javadoc thanks to user cylab on javagaming.org forums
+TagNativeBinding true
+
+# Ignore extensions that are already picked up via the GL2ES1 interface
+IgnoreExtension GL_EXT_point_parameters
+
+# Add PixelStorei StateTracker
+CustomJavaCode GL4bcImpl private static final int params_offset = 0; // just a helper for JavaPrologue ..
+
+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); }
+
+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); }
+
+CustomJavaCode GL4bcImpl public void glClearDepthf(float depth) {
+CustomJavaCode GL4bcImpl glClearDepth((double)depth); }
+
+CustomJavaCode GL4bcImpl public void glDepthRangef(float zNear, float zFar) {
+CustomJavaCode GL4bcImpl glDepthRange((double)zNear, (double)zFar); }
+
+Include gl-headers.cfg
+Include gl3ext-headers.cfg
+Include ../intptr.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.GL2GL3
+Import javax.media.opengl.GL2
+Import javax.media.opengl.GL3
+Import javax.media.opengl.GL3bc
+Import javax.media.opengl.GL4
+Import com.jogamp.opengl.impl.InternalBufferUtil
+Import java.io.PrintStream
diff --git a/make/config/jogl/gl-impl-CustomCCode-gl2es12.c b/make/config/jogl/gl-impl-CustomCCode-gl2es12.c
index e2d5cb58d..07b821802 100644
--- a/make/config/jogl/gl-impl-CustomCCode-gl2es12.c
+++ b/make/config/jogl/gl-impl-CustomCCode-gl2es12.c
@@ -1,10 +1,10 @@
/* Java->C glue code:
- * Java package: com.sun.opengl.impl.gl2es12.GL2ES12Impl
+ * Java package: com.jogamp.opengl.impl.gl2es12.GL2ES12Impl
* Java method: long dispatch_glMapBuffer(int target, int access)
* C function: void * glMapBuffer(GLenum target, GLenum access);
*/
JNIEXPORT jlong JNICALL
-Java_com_sun_opengl_impl_gl2es12_GL2ES12Impl_dispatch_1glMapBuffer(JNIEnv *env, jobject _unused, jint target, jint access, jlong glProcAddress) {
+Java_com_jogamp_opengl_impl_gl2es12_GL2ES12Impl_dispatch_1glMapBuffer(JNIEnv *env, jobject _unused, jint target, jint access, jlong glProcAddress) {
PFNGLMAPBUFFERPROC ptr_glMapBuffer;
void * _res;
ptr_glMapBuffer = (PFNGLMAPBUFFERPROC) (intptr_t) glProcAddress;
@@ -14,11 +14,11 @@ Java_com_sun_opengl_impl_gl2es12_GL2ES12Impl_dispatch_1glMapBuffer(JNIEnv *env,
}
/* Java->C glue code:
- * Java package: com.sun.opengl.impl.gl2es12.GL2ES12Impl
+ * Java package: com.jogamp.opengl.impl.gl2es12.GL2ES12Impl
* Java method: ByteBuffer newDirectByteBuffer(long addr, int capacity);
* C function: jobject newDirectByteBuffer(jlong addr, jint capacity);
*/
JNIEXPORT jobject JNICALL
-Java_com_sun_opengl_impl_gl2es12_GL2ES12Impl_newDirectByteBuffer(JNIEnv *env, jobject _unused, jlong addr, jint capacity) {
+Java_com_jogamp_opengl_impl_gl2es12_GL2ES12Impl_newDirectByteBuffer(JNIEnv *env, jobject _unused, jlong addr, jint capacity) {
return (*env)->NewDirectByteBuffer(env, (void*) (intptr_t) addr, capacity);
}
diff --git a/make/config/jogl/gl-impl-CustomCCode-gl3.c b/make/config/jogl/gl-impl-CustomCCode-gl3.c
deleted file mode 100644
index a5f78a460..000000000
--- a/make/config/jogl/gl-impl-CustomCCode-gl3.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Java->C glue code:
- * Java package: com.sun.opengl.impl.gl3.GL3Impl
- * Java method: long dispatch_glMapBuffer(int target, int access)
- * C function: void * glMapBuffer(GLenum target, GLenum access);
- */
-JNIEXPORT jlong JNICALL
-Java_com_sun_opengl_impl_gl3_GL3Impl_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: com.sun.opengl.impl.gl3.GL3Impl
- * Java method: ByteBuffer newDirectByteBuffer(long addr, int capacity);
- * C function: jobject newDirectByteBuffer(jlong addr, jint capacity);
- */
-JNIEXPORT jobject JNICALL
-Java_com_sun_opengl_impl_gl3_GL3Impl_newDirectByteBuffer(JNIEnv *env, jobject _unused, jlong addr, jint capacity) {
- return (*env)->NewDirectByteBuffer(env, (void*) (intptr_t) addr, capacity);
-}
diff --git a/make/config/jogl/gl-impl-CustomCCode-gl3bc.c b/make/config/jogl/gl-impl-CustomCCode-gl3bc.c
deleted file mode 100644
index a69204198..000000000
--- a/make/config/jogl/gl-impl-CustomCCode-gl3bc.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Java->C glue code:
- * Java package: com.sun.opengl.impl.gl3.GL3bcImpl
- * Java method: long dispatch_glMapBuffer(int target, int access)
- * C function: void * glMapBuffer(GLenum target, GLenum access);
- */
-JNIEXPORT jlong JNICALL
-Java_com_sun_opengl_impl_gl3_GL3bcImpl_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: com.sun.opengl.impl.gl3.GL3bcImpl
- * Java method: ByteBuffer newDirectByteBuffer(long addr, int capacity);
- * C function: jobject newDirectByteBuffer(jlong addr, jint capacity);
- */
-JNIEXPORT jobject JNICALL
-Java_com_sun_opengl_impl_gl3_GL3bcImpl_newDirectByteBuffer(JNIEnv *env, jobject _unused, jlong addr, jint capacity) {
- return (*env)->NewDirectByteBuffer(env, (void*) (intptr_t) addr, capacity);
-}
diff --git a/make/config/jogl/gl-impl-CustomCCode-gl2.c b/make/config/jogl/gl-impl-CustomCCode-gl4bc.c
index f97b8eaff..bcda20fa4 100644
--- a/make/config/jogl/gl-impl-CustomCCode-gl2.c
+++ b/make/config/jogl/gl-impl-CustomCCode-gl4bc.c
@@ -1,10 +1,10 @@
/* Java->C glue code:
- * Java package: com.sun.opengl.impl.gl2.GL2Impl
+ * Java package: com.jogamp.opengl.impl.gl4.GL4bcImpl
* Java method: long dispatch_glMapBuffer(int target, int access)
* C function: void * glMapBuffer(GLenum target, GLenum access);
*/
JNIEXPORT jlong JNICALL
-Java_com_sun_opengl_impl_gl2_GL2Impl_dispatch_1glMapBuffer(JNIEnv *env, jobject _unused, jint target, jint access, jlong glProcAddress) {
+Java_com_jogamp_opengl_impl_gl4_GL4bcImpl_dispatch_1glMapBuffer(JNIEnv *env, jobject _unused, jint target, jint access, jlong glProcAddress) {
PFNGLMAPBUFFERPROC ptr_glMapBuffer;
void * _res;
ptr_glMapBuffer = (PFNGLMAPBUFFERPROC) (intptr_t) glProcAddress;
@@ -14,11 +14,11 @@ Java_com_sun_opengl_impl_gl2_GL2Impl_dispatch_1glMapBuffer(JNIEnv *env, jobject
}
/* Java->C glue code:
- * Java package: com.sun.opengl.impl.gl2.GL2Impl
+ * Java package: com.jogamp.opengl.impl.gl4.GL4bcImpl
* Java method: ByteBuffer newDirectByteBuffer(long addr, int capacity);
* C function: jobject newDirectByteBuffer(jlong addr, jint capacity);
*/
JNIEXPORT jobject JNICALL
-Java_com_sun_opengl_impl_gl2_GL2Impl_newDirectByteBuffer(JNIEnv *env, jobject _unused, jlong addr, jint capacity) {
+Java_com_jogamp_opengl_impl_gl4_GL4bcImpl_newDirectByteBuffer(JNIEnv *env, jobject _unused, jlong addr, jint capacity) {
return (*env)->NewDirectByteBuffer(env, (void*) (intptr_t) addr, capacity);
}
diff --git a/make/config/jogl/gl-impl-CustomCCode-gles1.c b/make/config/jogl/gl-impl-CustomCCode-gles1.c
index efc614e64..a71ca4aae 100644
--- a/make/config/jogl/gl-impl-CustomCCode-gles1.c
+++ b/make/config/jogl/gl-impl-CustomCCode-gles1.c
@@ -1,11 +1,11 @@
typedef GLvoid* (GL_APIENTRY* PFNGLMAPBUFFERPROC) (GLenum target, GLenum access);
/* Java->C glue code:
- * Java package: com.sun.opengl.impl.es1.GLES1Impl
+ * Java package: com.jogamp.opengl.impl.es1.GLES1Impl
* Java method: long dispatch_glMapBuffer(int target, int access)
* C function: void * glMapBuffer(GLenum target, GLenum access);
*/
JNIEXPORT jlong JNICALL
-Java_com_sun_opengl_impl_es1_GLES1Impl_dispatch_1glMapBuffer(JNIEnv *env, jobject _unused, jint target, jint access, jlong glProcAddress) {
+Java_com_jogamp_opengl_impl_es1_GLES1Impl_dispatch_1glMapBuffer(JNIEnv *env, jobject _unused, jint target, jint access, jlong glProcAddress) {
PFNGLMAPBUFFERPROC ptr_glMapBuffer;
void * _res;
ptr_glMapBuffer = (PFNGLMAPBUFFERPROC) (intptr_t) glProcAddress;
@@ -15,11 +15,11 @@ Java_com_sun_opengl_impl_es1_GLES1Impl_dispatch_1glMapBuffer(JNIEnv *env, jobjec
}
/* Java->C glue code:
- * Java package: com.sun.opengl.impl.es1.GLES1Impl
+ * Java package: com.jogamp.opengl.impl.es1.GLES1Impl
* Java method: ByteBuffer newDirectByteBuffer(long addr, int capacity);
* C function: jobject newDirectByteBuffer(jlong addr, jint capacity);
*/
JNIEXPORT jobject JNICALL
-Java_com_sun_opengl_impl_es1_GLES1Impl_newDirectByteBuffer(JNIEnv *env, jobject _unused, jlong addr, jint capacity) {
+Java_com_jogamp_opengl_impl_es1_GLES1Impl_newDirectByteBuffer(JNIEnv *env, jobject _unused, jlong addr, jint capacity) {
return (*env)->NewDirectByteBuffer(env, (void*) (intptr_t) addr, capacity);
}
diff --git a/make/config/jogl/gl-impl-CustomCCode-gles2.c b/make/config/jogl/gl-impl-CustomCCode-gles2.c
index 27be04749..f99822d65 100644
--- a/make/config/jogl/gl-impl-CustomCCode-gles2.c
+++ b/make/config/jogl/gl-impl-CustomCCode-gles2.c
@@ -1,11 +1,11 @@
typedef GLvoid* (GL_APIENTRY* PFNGLMAPBUFFERPROC) (GLenum target, GLenum access);
/* Java->C glue code:
- * Java package: com.sun.opengl.impl.es2.GLES2Impl
+ * Java package: com.jogamp.opengl.impl.es2.GLES2Impl
* Java method: long dispatch_glMapBuffer(int target, int access)
* C function: void * glMapBuffer(GLenum target, GLenum access);
*/
JNIEXPORT jlong JNICALL
-Java_com_sun_opengl_impl_es2_GLES2Impl_dispatch_1glMapBuffer(JNIEnv *env, jobject _unused, jint target, jint access, jlong glProcAddress) {
+Java_com_jogamp_opengl_impl_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;
@@ -15,11 +15,11 @@ Java_com_sun_opengl_impl_es2_GLES2Impl_dispatch_1glMapBuffer(JNIEnv *env, jobjec
}
/* Java->C glue code:
- * Java package: com.sun.opengl.impl.es2.GLES2Impl
+ * Java package: com.jogamp.opengl.impl.es2.GLES2Impl
* Java method: ByteBuffer newDirectByteBuffer(long addr, int capacity);
* C function: jobject newDirectByteBuffer(jlong addr, jint capacity);
*/
JNIEXPORT jobject JNICALL
-Java_com_sun_opengl_impl_es2_GLES2Impl_newDirectByteBuffer(JNIEnv *env, jobject _unused, jlong addr, jint capacity) {
+Java_com_jogamp_opengl_impl_es2_GLES2Impl_newDirectByteBuffer(JNIEnv *env, jobject _unused, jlong addr, jint 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 564606799..4872490b0 100644
--- a/make/config/jogl/gl-impl-CustomJavaCode-common.java
+++ b/make/config/jogl/gl-impl-CustomJavaCode-common.java
@@ -1,16 +1,58 @@
- public GLProfile getGLProfile() {
- return this.glProfile;
- }
- private GLProfile glProfile;
-
- public int glGetBoundBuffer(int target) {
- return bufferStateTracker.getBoundBufferObject(target, this);
- }
-
- public boolean glIsVBOArrayEnabled() {
- return checkArrayVBOEnabled(false);
- }
-
- public boolean glIsVBOElementEnabled() {
- return checkElementVBOEnabled(false);
- }
+ public GLProfile getGLProfile() {
+ return this.glProfile;
+ }
+ private GLProfile glProfile;
+
+ public int glGetBoundBuffer(int target) {
+ return bufferStateTracker.getBoundBufferObject(target, this);
+ }
+
+ public boolean glIsVBOArrayEnabled() {
+ return checkArrayVBOEnabled(false);
+ }
+
+ public boolean glIsVBOElementEnabled() {
+ return checkElementVBOEnabled(false);
+ }
+
+ public final boolean isGL() {
+ return true;
+ }
+
+ public final GL getGL() throws GLException {
+ return this;
+ }
+
+ public boolean isFunctionAvailable(String glFunctionName) {
+ return _context.isFunctionAvailable(glFunctionName);
+ }
+
+ public boolean isExtensionAvailable(String glExtensionName) {
+ return _context.isExtensionAvailable(glExtensionName);
+ }
+
+ public Object getExtension(String extensionName) {
+ // At this point we don't expose any extensions using this mechanism
+ return null;
+ }
+
+ /** Returns the context this GL object is associated with for better
+ error checking by DebugGL. */
+ public GLContext getContext() {
+ return _context;
+ }
+
+ private GLContextImpl _context;
+
+ public void setSwapInterval(int interval) {
+ _context.setSwapInterval(interval);
+ }
+
+ public int getSwapInterval() {
+ return _context.getSwapInterval();
+ }
+
+ public Object getPlatformGLExtensions() {
+ return _context.getPlatformGLExtensions();
+ }
+
diff --git a/make/config/jogl/gl-impl-CustomJavaCode-desktop.java b/make/config/jogl/gl-impl-CustomJavaCode-desktop.java
index 04ba39c3d..93a275269 100644
--- a/make/config/jogl/gl-impl-CustomJavaCode-desktop.java
+++ b/make/config/jogl/gl-impl-CustomJavaCode-desktop.java
@@ -1,79 +1,191 @@
-private int[] imageSizeTemp = new int[1];
-
-/** Helper for more precise computation of number of bytes that will
- be touched by a pixel pack or unpack operation. */
-private int imageSizeInBytes(int bytesPerElement,
- int width, int height, int depth, boolean pack) {
- int rowLength = 0;
- int skipRows = 0;
- int skipPixels = 0;
- int alignment = 1;
- int imageHeight = 0;
- int skipImages = 0;
-
- if (pack) {
- glGetIntegerv(GL_PACK_ROW_LENGTH, imageSizeTemp, 0);
- rowLength = imageSizeTemp[0];
- glGetIntegerv(GL_PACK_SKIP_ROWS, imageSizeTemp, 0);
- skipRows = imageSizeTemp[0];
- glGetIntegerv(GL_PACK_SKIP_PIXELS, imageSizeTemp, 0);
- skipPixels = imageSizeTemp[0];
- glGetIntegerv(GL_PACK_ALIGNMENT, imageSizeTemp, 0);
- alignment = imageSizeTemp[0];
- if (depth > 1) {
- glGetIntegerv(GL_PACK_IMAGE_HEIGHT, imageSizeTemp, 0);
- imageHeight = imageSizeTemp[0];
- glGetIntegerv(GL_PACK_SKIP_IMAGES, imageSizeTemp, 0);
- skipImages = imageSizeTemp[0];
+ private int[] imageSizeTemp = new int[1];
+
+ /** Helper for more precise computation of number of bytes that will
+ be touched by a pixel pack or unpack operation. */
+ private int imageSizeInBytes(int bytesPerElement,
+ int width, int height, int depth, boolean pack) {
+ int rowLength = 0;
+ int skipRows = 0;
+ int skipPixels = 0;
+ int alignment = 1;
+ int imageHeight = 0;
+ int skipImages = 0;
+
+ if (pack) {
+ glGetIntegerv(GL_PACK_ROW_LENGTH, imageSizeTemp, 0);
+ rowLength = imageSizeTemp[0];
+ glGetIntegerv(GL_PACK_SKIP_ROWS, imageSizeTemp, 0);
+ skipRows = imageSizeTemp[0];
+ glGetIntegerv(GL_PACK_SKIP_PIXELS, imageSizeTemp, 0);
+ skipPixels = imageSizeTemp[0];
+ glGetIntegerv(GL_PACK_ALIGNMENT, imageSizeTemp, 0);
+ alignment = imageSizeTemp[0];
+ if (depth > 1) {
+ glGetIntegerv(GL_PACK_IMAGE_HEIGHT, imageSizeTemp, 0);
+ imageHeight = imageSizeTemp[0];
+ glGetIntegerv(GL_PACK_SKIP_IMAGES, imageSizeTemp, 0);
+ skipImages = imageSizeTemp[0];
+ }
+ } else {
+ glGetIntegerv(GL_UNPACK_ROW_LENGTH, imageSizeTemp, 0);
+ rowLength = imageSizeTemp[0];
+ glGetIntegerv(GL_UNPACK_SKIP_ROWS, imageSizeTemp, 0);
+ skipRows = imageSizeTemp[0];
+ glGetIntegerv(GL_UNPACK_SKIP_PIXELS, imageSizeTemp, 0);
+ skipPixels = imageSizeTemp[0];
+ glGetIntegerv(GL_UNPACK_ALIGNMENT, imageSizeTemp, 0);
+ alignment = imageSizeTemp[0];
+ if (depth > 1) {
+ glGetIntegerv(GL_UNPACK_IMAGE_HEIGHT, imageSizeTemp, 0);
+ imageHeight = imageSizeTemp[0];
+ glGetIntegerv(GL_UNPACK_SKIP_IMAGES, imageSizeTemp, 0);
+ skipImages = imageSizeTemp[0];
+ }
}
- } else {
- glGetIntegerv(GL_UNPACK_ROW_LENGTH, imageSizeTemp, 0);
- rowLength = imageSizeTemp[0];
- glGetIntegerv(GL_UNPACK_SKIP_ROWS, imageSizeTemp, 0);
- skipRows = imageSizeTemp[0];
- glGetIntegerv(GL_UNPACK_SKIP_PIXELS, imageSizeTemp, 0);
- skipPixels = imageSizeTemp[0];
- glGetIntegerv(GL_UNPACK_ALIGNMENT, imageSizeTemp, 0);
- alignment = imageSizeTemp[0];
- if (depth > 1) {
- glGetIntegerv(GL_UNPACK_IMAGE_HEIGHT, imageSizeTemp, 0);
- imageHeight = imageSizeTemp[0];
- glGetIntegerv(GL_UNPACK_SKIP_IMAGES, imageSizeTemp, 0);
- skipImages = imageSizeTemp[0];
+ // Try to deal somewhat correctly with potentially invalid values
+ width = Math.max(0, width );
+ height = Math.max(1, height); // min 1D
+ depth = Math.max(1, depth ); // min 1 * imageSize
+ skipRows = Math.max(0, skipRows);
+ skipPixels = Math.max(0, skipPixels);
+ alignment = Math.max(1, alignment);
+ skipImages = Math.max(0, skipImages);
+
+ imageHeight = ( imageHeight > 0 ) ? imageHeight : height;
+ rowLength = ( rowLength > 0 ) ? rowLength : width;
+
+ int rowLengthInBytes = rowLength * bytesPerElement;
+
+ if (alignment > 1) {
+ int padding = rowLengthInBytes % alignment;
+ if (padding > 0) {
+ rowLengthInBytes += alignment - padding;
+ }
}
+
+ /**
+ * skipPixels and skipRows is a static one time offset.
+ *
+ * skipImages and depth are in multiples of image size.
+ *
+ * rowlenght is the actual repeating offset
+ * to go from line n to line n+1 at the same x-axis position.
+ */
+ return
+ ( skipImages + depth - 1 ) * imageHeight * rowLengthInBytes + // whole images
+ ( skipRows + height - 1 ) * rowLengthInBytes + // lines with padding
+ ( skipPixels + width ) * bytesPerElement; // last line
+ }
+
+ public final boolean isGL4bc() {
+ return _context.isGL4bc();
+ }
+
+ public final boolean isGL4() {
+ return _context.isGL4();
+ }
+
+ public final boolean isGL3bc() {
+ return _context.isGL3bc();
+ }
+
+ public final boolean isGL3() {
+ return _context.isGL3();
}
- // Try to deal somewhat correctly with potentially invalid values
- width = Math.max(0, width );
- height = Math.max(1, height); // min 1D
- depth = Math.max(1, depth ); // min 1 * imageSize
- skipRows = Math.max(0, skipRows);
- skipPixels = Math.max(0, skipPixels);
- alignment = Math.max(1, alignment);
- skipImages = Math.max(0, skipImages);
- imageHeight = ( imageHeight > 0 ) ? imageHeight : height;
- rowLength = ( rowLength > 0 ) ? rowLength : width;
+ public final boolean isGL2() {
+ return _context.isGL2();
+ }
+
+ public final boolean isGL2ES1() {
+ return _context.isGL2ES1();
+ }
- int rowLengthInBytes = rowLength * bytesPerElement;
+ public final boolean isGL2ES2() {
+ return _context.isGL2ES2();
+ }
- if (alignment > 1) {
- int padding = rowLengthInBytes % alignment;
- if (padding > 0) {
- rowLengthInBytes += alignment - padding;
+ public final boolean isGL2GL3() {
+ return _context.isGL2GL3();
+ }
+
+ public final boolean hasGLSL() {
+ return _context.hasGLSL();
+ }
+
+ public final GL4bc getGL4bc() throws GLException {
+ if(!isGL4bc()) {
+ throw new GLException("Not a GL4bc implementation");
+ }
+ return this;
+ }
+
+ public final GL4 getGL4() throws GLException {
+ if(!isGL4bc()) {
+ throw new GLException("Not a GL4 implementation");
}
+ return this;
}
- /**
- * skipPixels and skipRows is a static one time offset.
- *
- * skipImages and depth are in multiples of image size.
- *
- * rowlenght is the actual repeating offset
- * to go from line n to line n+1 at the same x-axis position.
- */
- return
- ( skipImages + depth - 1 ) * imageHeight * rowLengthInBytes + // whole images
- ( skipRows + height - 1 ) * rowLengthInBytes + // lines with padding
- ( skipPixels + width ) * bytesPerElement; // last line
-}
+ public final GL3bc getGL3bc() throws GLException {
+ if(!isGL3bc()) {
+ throw new GLException("Not a GL3bc implementation");
+ }
+ return this;
+ }
+
+ public final GL3 getGL3() throws GLException {
+ if(!isGL3()) {
+ throw new GLException("Not a GL3 implementation");
+ }
+ return this;
+ }
+
+ public final GL2 getGL2() throws GLException {
+ if(!isGL2()) {
+ throw new GLException("Not a GL2 implementation");
+ }
+ return this;
+ }
+
+ public final GL2ES1 getGL2ES1() throws GLException {
+ if(!isGL2ES1()) {
+ throw new GLException("Not a GL2ES1 implementation");
+ }
+ return this;
+ }
+
+ public final GL2ES2 getGL2ES2() throws GLException {
+ if(!isGL2ES2()) {
+ throw new GLException("Not a GL2ES2 implementation");
+ }
+ return this;
+ }
+
+ public final GL2GL3 getGL2GL3() throws GLException {
+ if(!isGL2GL3()) {
+ throw new GLException("Not a GL2GL3 implementation");
+ }
+ return this;
+ }
+
+ public final boolean isGLES1() {
+ return false;
+ }
+
+ public final boolean isGLES2() {
+ return false;
+ }
+
+ public final boolean isGLES() {
+ return false;
+ }
+
+ public final GLES1 getGLES1() throws GLException {
+ throw new GLException("Not a GLES1 implementation");
+ }
+
+ public final GLES2 getGLES2() throws GLException {
+ throw new GLException("Not a GLES2 implementation");
+ }
diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gl2.java b/make/config/jogl/gl-impl-CustomJavaCode-gl2.java
deleted file mode 100644
index cd1a24459..000000000
--- a/make/config/jogl/gl-impl-CustomJavaCode-gl2.java
+++ /dev/null
@@ -1,498 +0,0 @@
-// Tracks glBegin/glEnd calls to determine whether it is legal to
-// query Vertex Buffer Object state
-private boolean inBeginEndPair;
-
-/* FIXME: refactor dependence on Java 2D / JOGL bridge
-
-// Tracks creation and destruction of server-side OpenGL objects when
-// the Java2D/OpenGL pipeline is enabled and it is using frame buffer
-// objects (FBOs) to do its rendering
-private GLObjectTracker tracker;
-
-public void setObjectTracker(GLObjectTracker tracker) {
- this.tracker = tracker;
-}
-
-*/
-
-
-public GL2Impl(GLProfile glp, GLContextImpl context) {
- this._context = context;
- this.bufferSizeTracker = context.getBufferSizeTracker();
- this.bufferStateTracker = context.getBufferStateTracker();
- this.glStateTracker = context.getGLStateTracker();
- this.glProfile = glp;
-}
-
-public final boolean isGL() {
- return true;
-}
-
-public final boolean isGL3bc() {
- return false;
-}
-
-public final boolean isGL3() {
- return false;
-}
-
-public final boolean isGL2() {
- return true;
-}
-
-public final boolean isGLES1() {
- return false;
-}
-
-public final boolean isGLES2() {
- return false;
-}
-
-public final boolean isGLES() {
- return false;
-}
-
-public final boolean isGL2ES1() {
- return true;
-}
-
-public final boolean isGL2ES2() {
- return true;
-}
-
-public final boolean isGL2GL3() {
- return true;
-}
-
-public final boolean hasGLSL() {
- return true;
-}
-
-public final GL getGL() throws GLException {
- return this;
-}
-
-public final GL3bc getGL3bc() throws GLException {
- throw new GLException("Not a GL3bc implementation");
-}
-
-public final GL3 getGL3() throws GLException {
- throw new GLException("Not a GL3 implementation");
-}
-
-public final GL2 getGL2() throws GLException {
- return this;
-}
-
-public final GLES1 getGLES1() throws GLException {
- throw new GLException("Not a GLES1 implementation");
-}
-
-public final GLES2 getGLES2() throws GLException {
- throw new GLException("Not a GLES2 implementation");
-}
-
-public final GL2ES1 getGL2ES1() throws GLException {
- return this;
-}
-
-public final GL2ES2 getGL2ES2() throws GLException {
- return this;
-}
-
-public final GL2GL3 getGL2GL3() throws GLException {
- return this;
-}
-
-public boolean isFunctionAvailable(String glFunctionName) {
- return _context.isFunctionAvailable(glFunctionName);
-}
-
-public boolean isExtensionAvailable(String glExtensionName) {
- return _context.isExtensionAvailable(glExtensionName);
-}
-
-public Object getExtension(String extensionName) {
- // At this point we don't expose any extensions using this mechanism
- return null;
-}
-
-/** Returns the context this GL object is associated with for better
- error checking by DebugGL. */
-public GLContext getContext() {
- return _context;
-}
-
-private GLContextImpl _context;
-
-/**
- * Provides platform-independent access to the wglAllocateMemoryNV /
- * glXAllocateMemoryNV extension.
- */
-public java.nio.ByteBuffer glAllocateMemoryNV(int arg0, float arg1, float arg2, float arg3) {
- return _context.glAllocateMemoryNV(arg0, arg1, arg2, arg3);
-}
-
-public void setSwapInterval(int interval) {
- _context.setSwapInterval(interval);
-}
-
-public int getSwapInterval() {
- return _context.getSwapInterval();
-}
-
-public Object getPlatformGLExtensions() {
- return _context.getPlatformGLExtensions();
-}
-
-//
-// Helpers for ensuring the correct amount of texture data
-//
-
-/** Returns the number of bytes required to fill in the appropriate
- texture. This is computed as closely as possible based on the
- pixel pack or unpack parameters. The logic in this routine is
- based on code in the SGI OpenGL sample implementation. */
-
-private int imageSizeInBytes(int format, int type, int w, int h, int d,
- boolean pack) {
- int elements = 0;
- int esize = 0;
-
- if (w < 0) return 0;
- if (h < 0) return 0;
- if (d < 0) return 0;
- switch (format) {
- case GL_COLOR_INDEX:
- case GL_STENCIL_INDEX:
- elements = 1;
- break;
- case GL_RED:
- case GL_GREEN:
- case GL_BLUE:
- case GL_ALPHA:
- case GL_LUMINANCE:
- case GL_DEPTH_COMPONENT:
- elements = 1;
- break;
- case GL_LUMINANCE_ALPHA:
- elements = 2;
- break;
- case GL_RGB:
- case GL_BGR:
- elements = 3;
- break;
- case GL_RGBA:
- case GL_BGRA:
- case GL_ABGR_EXT:
- elements = 4;
- break;
- /* FIXME ??
- case GL_HILO_NV:
- elements = 2;
- break; */
- default:
- return 0;
- }
- switch (type) {
- case GL_BITMAP:
- if (format == GL_COLOR_INDEX) {
- return (d * (h * ((w+7)/8)));
- } else {
- return 0;
- }
- case GL_BYTE:
- case GL_UNSIGNED_BYTE:
- esize = 1;
- break;
- case GL_UNSIGNED_BYTE_3_3_2:
- case GL_UNSIGNED_BYTE_2_3_3_REV:
- esize = 1;
- elements = 1;
- break;
- case GL_SHORT:
- case GL_UNSIGNED_SHORT:
- esize = 2;
- break;
- case GL_UNSIGNED_SHORT_5_6_5:
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- case GL_UNSIGNED_SHORT_4_4_4_4:
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- case GL_UNSIGNED_SHORT_5_5_5_1:
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- esize = 2;
- elements = 1;
- break;
- case GL_INT:
- case GL_UNSIGNED_INT:
- case GL_FLOAT:
- esize = 4;
- break;
- case GL_UNSIGNED_INT_8_8_8_8:
- case GL_UNSIGNED_INT_8_8_8_8_REV:
- case GL_UNSIGNED_INT_10_10_10_2:
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- esize = 4;
- elements = 1;
- break;
- default:
- return 0;
- }
- return imageSizeInBytes(elements * esize, w, h, d, pack);
-}
-
-private GLBufferSizeTracker bufferSizeTracker;
-private GLBufferStateTracker bufferStateTracker;
-private GLStateTracker glStateTracker;
-
-private boolean bufferObjectExtensionsInitialized = false;
-private boolean haveARBPixelBufferObject;
-private boolean haveEXTPixelBufferObject;
-private boolean haveGL15;
-private boolean haveGL21;
-private boolean haveARBVertexBufferObject;
-
-private 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");
-}
-
-private boolean checkBufferObject(boolean extension1,
- boolean extension2,
- boolean extension3,
- boolean enabled,
- int state,
- String kind, boolean throwException) {
- if (inBeginEndPair) {
- throw new GLException("May not call this between glBegin and glEnd");
- }
- boolean avail = (extension1 || extension2 || extension3);
- if (!avail) {
- 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 (buffer == 0) {
- if(throwException) {
- throw new GLException(kind + " must be enabled to call this method");
- }
- return false;
- }
- } else {
- if (buffer != 0) {
- if(throwException) {
- throw new GLException(kind + " must be disabled to call this method");
- }
- return false;
- }
- }
- return true;
-}
-
-private boolean checkArrayVBODisabled(boolean throwException) {
- initBufferObjectExtensionChecks();
- return checkBufferObject(haveGL15,
- haveARBVertexBufferObject,
- false,
- false,
- GL.GL_ARRAY_BUFFER,
- "array vertex_buffer_object", throwException);
-}
-
-private boolean checkArrayVBOEnabled(boolean throwException) {
- initBufferObjectExtensionChecks();
- return checkBufferObject(haveGL15,
- haveARBVertexBufferObject,
- false,
- true,
- GL.GL_ARRAY_BUFFER,
- "array vertex_buffer_object", throwException);
-}
-
-private boolean checkElementVBODisabled(boolean throwException) {
- initBufferObjectExtensionChecks();
- return checkBufferObject(haveGL15,
- haveARBVertexBufferObject,
- false,
- false,
- GL.GL_ELEMENT_ARRAY_BUFFER,
- "element vertex_buffer_object", throwException);
-}
-
-private boolean checkElementVBOEnabled(boolean throwException) {
- initBufferObjectExtensionChecks();
- return checkBufferObject(haveGL15,
- haveARBVertexBufferObject,
- false,
- true,
- GL.GL_ELEMENT_ARRAY_BUFFER,
- "element vertex_buffer_object", throwException);
-}
-
-private boolean checkUnpackPBODisabled(boolean throwException) {
- initBufferObjectExtensionChecks();
- return checkBufferObject(haveARBPixelBufferObject,
- haveEXTPixelBufferObject,
- haveGL21,
- false,
- GL2.GL_PIXEL_UNPACK_BUFFER,
- "unpack pixel_buffer_object", throwException);
-}
-
-private boolean checkUnpackPBOEnabled(boolean throwException) {
- initBufferObjectExtensionChecks();
- return checkBufferObject(haveARBPixelBufferObject,
- haveEXTPixelBufferObject,
- haveGL21,
- true,
- GL2.GL_PIXEL_UNPACK_BUFFER,
- "unpack pixel_buffer_object", throwException);
-}
-
-private boolean checkPackPBODisabled(boolean throwException) {
- initBufferObjectExtensionChecks();
- return checkBufferObject(haveARBPixelBufferObject,
- haveEXTPixelBufferObject,
- haveGL21,
- false,
- GL2.GL_PIXEL_PACK_BUFFER,
- "pack pixel_buffer_object", throwException);
-}
-
-private boolean checkPackPBOEnabled(boolean throwException) {
- initBufferObjectExtensionChecks();
- return checkBufferObject(haveARBPixelBufferObject,
- haveEXTPixelBufferObject,
- haveGL21,
- true,
- GL2.GL_PIXEL_PACK_BUFFER,
- "pack pixel_buffer_object", throwException);
-}
-
-public boolean glIsPBOPackEnabled() {
- return checkPackPBOEnabled(false);
-}
-
-public boolean glIsPBOUnpackEnabled() {
- return checkUnpackPBOEnabled(false);
-}
-
-// Attempt to return the same ByteBuffer object from glMapBuffer if
-// the vertex buffer object's base address and size haven't changed
-private static class ARBVBOKey {
- private long addr;
- private int capacity;
-
- ARBVBOKey(long addr, int capacity) {
- this.addr = addr;
- this.capacity = capacity;
- }
-
- public int hashCode() {
- return (int) addr;
- }
-
- public boolean equals(Object o) {
- if ((o == null) || (!(o instanceof ARBVBOKey))) {
- return false;
- }
-
- ARBVBOKey other = (ARBVBOKey) o;
- return ((addr == other.addr) && (capacity == other.capacity));
- }
-}
-
-private Map/*<ARBVBOKey, ByteBuffer>*/ arbVBOCache = new HashMap();
-
-/** Entry point to C language function: <br> <code> LPVOID glMapBuffer(GLenum target, GLenum access); </code> */
-public java.nio.ByteBuffer glMapBuffer(int target, int access) {
- final long __addr_ = ((GL2ProcAddressTable)_context.getGLProcAddressTable())._addressof_glMapBuffer;
- if (__addr_ == 0) {
- throw new GLException("Method \"glMapBuffer\" not available");
- }
- int sz = bufferSizeTracker.getBufferSize(bufferStateTracker,
- target,
- this);
- long addr;
- addr = dispatch_glMapBuffer(target, access, __addr_);
- if (addr == 0 || sz == 0) {
- return null;
- }
- ARBVBOKey key = new ARBVBOKey(addr, sz);
- ByteBuffer _res = (ByteBuffer) arbVBOCache.get(key);
- if (_res == null) {
- _res = newDirectByteBuffer(addr, sz);
- InternalBufferUtil.nativeOrder(_res);
- arbVBOCache.put(key, _res);
- }
- _res.position(0);
- return _res;
-}
-
-/** 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, int capacity);
-
- /** Dummy implementation for the ES 2.0 function: <br> <code> void {@native glShaderBinary}(GLint n, const GLuint * shaders, GLenum binaryformat, const void * binary, GLint length); </code> <br> Always throws a GLException! */
- public void glShaderBinary(int n, java.nio.IntBuffer shaders, int binaryformat, java.nio.Buffer binary, int length) {
- throw new GLException("Method \"glShaderBinary\" not available");
- }
-
- /** Dummy implementation for the ES 2.0 function: <br> <code> void {@native glShaderBinary}(GLint n, const GLuint * shaders, GLenum binaryformat, const void * binary, GLint length); </code> <br> Always throws a GLException! */
- public void glShaderBinary(int n, int[] shaders, int shaders_offset, int binaryformat, java.nio.Buffer binary, int length) {
- throw new GLException("Method \"glShaderBinary\" not available");
- }
-
- public void glReleaseShaderCompiler() {
- // nothing to do
- }
-
- public void glVertexPointer(GLArrayData array) {
- if(array.getComponentNumber()==0) return;
- if(array.isVBO()) {
- glVertexPointer(array.getComponentNumber(), array.getComponentType(), array.getStride(), array.getOffset());
- } else {
- glVertexPointer(array.getComponentNumber(), array.getComponentType(), array.getStride(), array.getBuffer());
- }
- }
- public void glColorPointer(GLArrayData array) {
- if(array.getComponentNumber()==0) return;
- if(array.isVBO()) {
- glColorPointer(array.getComponentNumber(), array.getComponentType(), array.getStride(), array.getOffset());
- } else {
- glColorPointer(array.getComponentNumber(), array.getComponentType(), array.getStride(), array.getBuffer());
- }
-
- }
- public void glNormalPointer(GLArrayData array) {
- if(array.getComponentNumber()==0) return;
- if(array.getComponentNumber()!=3) {
- throw new GLException("Only 3 components per normal allowed");
- }
- if(array.isVBO()) {
- glNormalPointer(array.getComponentType(), array.getStride(), array.getOffset());
- } else {
- glNormalPointer(array.getComponentType(), array.getStride(), array.getBuffer());
- }
- }
- public void glTexCoordPointer(GLArrayData array) {
- if(array.getComponentNumber()==0) return;
- if(array.isVBO()) {
- glTexCoordPointer(array.getComponentNumber(), array.getComponentType(), array.getStride(), array.getOffset());
- } else {
- glTexCoordPointer(array.getComponentNumber(), array.getComponentType(), array.getStride(), array.getBuffer());
- }
- }
-
diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gl2es12.java b/make/config/jogl/gl-impl-CustomJavaCode-gl2es12.java
index 2eca2b6ab..4bc39b076 100644
--- a/make/config/jogl/gl-impl-CustomJavaCode-gl2es12.java
+++ b/make/config/jogl/gl-impl-CustomJavaCode-gl2es12.java
@@ -26,8 +26,12 @@ public GL2ES12Impl(GLProfile glp, GLContextImpl context) {
private boolean isGL2ES2;
-public final boolean isGL() {
- return true;
+public final boolean isGL4bc() {
+ return false;
+}
+
+public final boolean isGL4() {
+ return false;
}
public final boolean isGL3bc() {
@@ -70,8 +74,12 @@ public final boolean hasGLSL() {
return isGL2ES2;
}
-public final GL getGL() throws GLException {
- return this;
+public final GL4bc getGL4bc() throws GLException {
+ throw new GLException("Not a GL4bc implementation");
+}
+
+public final GL4 getGL4() throws GLException {
+ throw new GLException("Not a GL4 implementation");
}
public final GL3bc getGL3bc() throws GLException {
@@ -112,39 +120,6 @@ public final GL2GL3 getGL2GL3() throws GLException {
throw new GLException("Not a GL2GL3 implementation");
}
-public boolean isFunctionAvailable(String glFunctionName) {
- return _context.isFunctionAvailable(glFunctionName);
-}
-
-public boolean isExtensionAvailable(String glExtensionName) {
- return _context.isExtensionAvailable(glExtensionName);
-}
-
-public Object getExtension(String extensionName) {
- // At this point we don't expose any extensions using this mechanism
- return null;
-}
-
-/** Returns the context this GL object is associated with for better
- error checking by DebugGL. */
-public GLContext getContext() {
- return _context;
-}
-
-private GLContextImpl _context;
-
-public void setSwapInterval(int interval) {
- _context.setSwapInterval(interval);
-}
-
-public int getSwapInterval() {
- return _context.getSwapInterval();
-}
-
-public Object getPlatformGLExtensions() {
- return _context.getPlatformGLExtensions();
-}
-
//
// Helpers for ensuring the correct amount of texture data
//
diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gl3.java b/make/config/jogl/gl-impl-CustomJavaCode-gl4.java
index 16ff008cf..a2c70eeee 100644
--- a/make/config/jogl/gl-impl-CustomJavaCode-gl3.java
+++ b/make/config/jogl/gl-impl-CustomJavaCode-gl4.java
@@ -23,107 +23,6 @@ public GL3Impl(GLProfile glp, GLContextImpl context) {
this.glProfile = glp;
}
-public final boolean isGL() {
- return true;
-}
-
-public final boolean isGL3bc() {
- return false;
-}
-
-public final boolean isGL3() {
- return true;
-}
-
-public final boolean isGL2() {
- return false;
-}
-
-public final boolean isGLES1() {
- return false;
-}
-
-public final boolean isGLES2() {
- return false;
-}
-
-public final boolean isGLES() {
- return false;
-}
-
-public final boolean isGL2ES1() {
- return false;
-}
-
-public final boolean isGL2ES2() {
- return true;
-}
-
-public final boolean isGL2GL3() {
- return true;
-}
-
-public final boolean hasGLSL() {
- return true;
-}
-
-public final GL getGL() throws GLException {
- return this;
-}
-
-public final GL3bc getGL3bc() throws GLException {
- throw new GLException("Not a GL3bc implementation");
-}
-
-public final GL3 getGL3() throws GLException {
- return this;
-}
-
-public final GL2 getGL2() throws GLException {
- throw new GLException("Not a GL2 implementation");
-}
-
-public final GLES1 getGLES1() throws GLException {
- throw new GLException("Not a GLES1 implementation");
-}
-
-public final GLES2 getGLES2() throws GLException {
- throw new GLException("Not a GLES2 implementation");
-}
-
-public final GL2ES1 getGL2ES1() throws GLException {
- throw new GLException("Not a GLES2ES1 implementation");
-}
-
-public final GL2ES2 getGL2ES2() throws GLException {
- return this;
-}
-
-public final GL2GL3 getGL2GL3() throws GLException {
- return this;
-}
-
-public boolean isFunctionAvailable(String glFunctionName) {
- return _context.isFunctionAvailable(glFunctionName);
-}
-
-public boolean isExtensionAvailable(String glExtensionName) {
- return _context.isExtensionAvailable(glExtensionName);
-}
-
-public Object getExtension(String extensionName) {
- // At this point we don't expose any extensions using this mechanism
- return null;
-}
-
-/** Returns the context this GL object is associated with for better
- error checking by DebugGL. */
-public GLContext getContext() {
- return _context;
-}
-
-private GLContextImpl _context;
-
/**
* Provides platform-independent access to the wglAllocateMemoryNV /
* glXAllocateMemoryNV extension.
@@ -132,18 +31,6 @@ public java.nio.ByteBuffer glAllocateMemoryNV(int arg0, float arg1, float arg2,
return _context.glAllocateMemoryNV(arg0, arg1, arg2, arg3);
}
-public void setSwapInterval(int interval) {
- _context.setSwapInterval(interval);
-}
-
-public int getSwapInterval() {
- return _context.getSwapInterval();
-}
-
-public Object getPlatformGLExtensions() {
- return _context.getPlatformGLExtensions();
-}
-
//
// Helpers for ensuring the correct amount of texture data
//
diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gl3bc.java b/make/config/jogl/gl-impl-CustomJavaCode-gl4bc.java
index 2b7f14918..bceb12fe5 100644
--- a/make/config/jogl/gl-impl-CustomJavaCode-gl3bc.java
+++ b/make/config/jogl/gl-impl-CustomJavaCode-gl4bc.java
@@ -16,7 +16,7 @@ public void setObjectTracker(GLObjectTracker tracker) {
*/
-public GL3bcImpl(GLProfile glp, GLContextImpl context) {
+public GL4bcImpl(GLProfile glp, GLContextImpl context) {
this._context = context;
this.bufferSizeTracker = context.getBufferSizeTracker();
this.bufferStateTracker = context.getBufferStateTracker();
@@ -24,107 +24,6 @@ public GL3bcImpl(GLProfile glp, GLContextImpl context) {
this.glProfile = glp;
}
-public final boolean isGL() {
- return true;
-}
-
-public final boolean isGL3bc() {
- return true;
-}
-
-public final boolean isGL3() {
- return true;
-}
-
-public final boolean isGL2() {
- return true;
-}
-
-public final boolean isGLES1() {
- return false;
-}
-
-public final boolean isGLES2() {
- return false;
-}
-
-public final boolean isGLES() {
- return false;
-}
-
-public final boolean isGL2ES1() {
- return true;
-}
-
-public final boolean isGL2ES2() {
- return true;
-}
-
-public final boolean isGL2GL3() {
- return true;
-}
-
-public final boolean hasGLSL() {
- return true;
-}
-
-public final GL getGL() throws GLException {
- return this;
-}
-
-public final GL3bc getGL3bc() throws GLException {
- return this;
-}
-
-public final GL3 getGL3() throws GLException {
- return this;
-}
-
-public final GL2 getGL2() throws GLException {
- return this;
-}
-
-public final GLES1 getGLES1() throws GLException {
- throw new GLException("Not a GLES1 implementation");
-}
-
-public final GLES2 getGLES2() throws GLException {
- throw new GLException("Not a GLES2 implementation");
-}
-
-public final GL2ES1 getGL2ES1() throws GLException {
- return this;
-}
-
-public final GL2ES2 getGL2ES2() throws GLException {
- return this;
-}
-
-public final GL2GL3 getGL2GL3() throws GLException {
- return this;
-}
-
-public boolean isFunctionAvailable(String glFunctionName) {
- return _context.isFunctionAvailable(glFunctionName);
-}
-
-public boolean isExtensionAvailable(String glExtensionName) {
- return _context.isExtensionAvailable(glExtensionName);
-}
-
-public Object getExtension(String extensionName) {
- // At this point we don't expose any extensions using this mechanism
- return null;
-}
-
-/** Returns the context this GL object is associated with for better
- error checking by DebugGL. */
-public GLContext getContext() {
- return _context;
-}
-
-private GLContextImpl _context;
-
/**
* Provides platform-independent access to the wglAllocateMemoryNV /
* glXAllocateMemoryNV extension.
@@ -133,18 +32,6 @@ public java.nio.ByteBuffer glAllocateMemoryNV(int arg0, float arg1, float arg2,
return _context.glAllocateMemoryNV(arg0, arg1, arg2, arg3);
}
-public void setSwapInterval(int interval) {
- _context.setSwapInterval(interval);
-}
-
-public int getSwapInterval() {
- return _context.getSwapInterval();
-}
-
-public Object getPlatformGLExtensions() {
- return _context.getPlatformGLExtensions();
-}
-
//
// Helpers for ensuring the correct amount of texture data
//
@@ -417,7 +304,7 @@ private Map/*<ARBVBOKey, ByteBuffer>*/ arbVBOCache = new HashMap();
/** Entry point to C language function: <br> <code> LPVOID glMapBuffer(GLenum target, GLenum access); </code> */
public java.nio.ByteBuffer glMapBuffer(int target, int access) {
- final long __addr_ = ((GL3bcProcAddressTable)_context.getGLProcAddressTable())._addressof_glMapBuffer;
+ final long __addr_ = ((GL4bcProcAddressTable)_context.getGLProcAddressTable())._addressof_glMapBuffer;
if (__addr_ == 0) {
throw new GLException("Method \"glMapBuffer\" not available");
}
diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gles1.java b/make/config/jogl/gl-impl-CustomJavaCode-gles1.java
index dfef10ec9..b4efac8a1 100755
--- a/make/config/jogl/gl-impl-CustomJavaCode-gles1.java
+++ b/make/config/jogl/gl-impl-CustomJavaCode-gles1.java
@@ -6,10 +6,14 @@ public GLES1Impl(GLProfile glp, GLContextImpl context) {
this.glProfile = glp;
}
-public final boolean isGL() {
- return true;
+public final boolean isGL4bc() {
+ return false;
}
-
+
+public final boolean isGL4() {
+ return false;
+}
+
public final boolean isGL3bc() {
return false;
}
@@ -50,8 +54,12 @@ public final boolean hasGLSL() {
return false;
}
-public final GL getGL() throws GLException {
- return this;
+public final GL4bc getGL4bc() throws GLException {
+ throw new GLException("Not a GL4bc implementation");
+}
+
+public final GL4 getGL4() throws GLException {
+ throw new GLException("Not a GL4 implementation");
}
public final GL3bc getGL3bc() throws GLException {
@@ -86,39 +94,6 @@ public final GL2GL3 getGL2GL3() throws GLException {
throw new GLException("Not a GL2GL3 implementation");
}
-public boolean isFunctionAvailable(String glFunctionName) {
- return _context.isFunctionAvailable(glFunctionName);
-}
-
-public boolean isExtensionAvailable(String glExtensionName) {
- return _context.isExtensionAvailable(glExtensionName);
-}
-
-public Object getExtension(String extensionName) {
- // At this point we don't expose any extensions using this mechanism
- return null;
-}
-
-/** Returns the context this GL object is associated with for better
- error checking by DebugGL. */
-public GLContext getContext() {
- return _context;
-}
-
-private GLContextImpl _context;
-
-public void setSwapInterval(int interval) {
- _context.setSwapInterval(interval);
-}
-
-public int getSwapInterval() {
- return _context.getSwapInterval();
-}
-
-public Object getPlatformGLExtensions() {
- return _context.getPlatformGLExtensions();
-}
-
//
// Helpers for ensuring the correct amount of texture data
//
diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gles2.java b/make/config/jogl/gl-impl-CustomJavaCode-gles2.java
index 7287408a0..bb8ddb7ef 100755
--- a/make/config/jogl/gl-impl-CustomJavaCode-gles2.java
+++ b/make/config/jogl/gl-impl-CustomJavaCode-gles2.java
@@ -10,10 +10,14 @@ public GLES2Impl(GLProfile glp, GLContextImpl context) {
this.glProfile = glp;
}
-public final boolean isGL() {
- return true;
+public final boolean isGL4bc() {
+ return false;
}
-
+
+public final boolean isGL4() {
+ return false;
+}
+
public final boolean isGL3bc() {
return false;
}
@@ -54,8 +58,12 @@ public final boolean hasGLSL() {
return true;
}
-public final GL getGL() throws GLException {
- return this;
+public final GL4bc getGL4bc() throws GLException {
+ throw new GLException("Not a GL4bc implementation");
+}
+
+public final GL4 getGL4() throws GLException {
+ throw new GLException("Not a GL4 implementation");
}
public final GL3bc getGL3bc() throws GLException {
@@ -90,39 +98,6 @@ public final GL2GL3 getGL2GL3() throws GLException {
throw new GLException("Not a GL2GL3 implementation");
}
-public boolean isFunctionAvailable(String glFunctionName) {
- return _context.isFunctionAvailable(glFunctionName);
-}
-
-public boolean isExtensionAvailable(String glExtensionName) {
- return _context.isExtensionAvailable(glExtensionName);
-}
-
-public Object getExtension(String extensionName) {
- // At this point we don't expose any extensions using this mechanism
- return null;
-}
-
-/** Returns the context this GL object is associated with for better
- error checking by DebugGL. */
-public GLContext getContext() {
- return _context;
-}
-
-private GLContextImpl _context;
-
-public void setSwapInterval(int interval) {
- _context.setSwapInterval(interval);
-}
-
-public int getSwapInterval() {
- return _context.getSwapInterval();
-}
-
-public Object getPlatformGLExtensions() {
- return _context.getPlatformGLExtensions();
-}
-
//
// Helpers for ensuring the correct amount of texture data
//
diff --git a/make/config/jogl/gl3-common.cfg b/make/config/jogl/gl3-common.cfg
index fac8323bb..c2cc2968e 100644
--- a/make/config/jogl/gl3-common.cfg
+++ b/make/config/jogl/gl3-common.cfg
@@ -16,6 +16,9 @@ RenameExtensionIntoCore GL_ARB_geometry_shader4
RenameExtensionIntoCore GL_ARB_sync
# <<< OpenGL 3.2
+# >>> OpenGL 3.3
+# <<< OpenGL 3.3
+
# Ignore GL functions that deal with explicit pointer values in such a
# way that we cannot implement the functionality in Java
Ignore glMultiDrawElementsBaseVertex
diff --git a/make/config/jogl/gl3-desktop.cfg b/make/config/jogl/gl3-desktop.cfg
index c3dd180bb..ee741089e 100755
--- a/make/config/jogl/gl3-desktop.cfg
+++ b/make/config/jogl/gl3-desktop.cfg
@@ -61,6 +61,6 @@ TemporaryCVariableDeclaration glXChooseFBConfigSGIX int count;
TemporaryCVariableAssignment glXChooseFBConfigSGIX count = _ptr3[0];
ReturnValueCapacity glXChooseFBConfigSGIX count * sizeof(GLXFBConfig)
TemporaryCVariableDeclaration glXGetFBConfigs int count;
-TemporaryCVariableAssignment glXGetFBConfigs count = _ptr2[0];
+TemporaryCVariableAssignment glXGetFBConfigs count = _nelements_ptr[0];
ReturnValueCapacity glXGetFBConfigs count * sizeof(GLXFBConfig)
diff --git a/make/config/jogl/gl3ext-headers.cfg b/make/config/jogl/gl3ext-headers.cfg
new file mode 100755
index 000000000..dfc4ea796
--- /dev/null
+++ b/make/config/jogl/gl3ext-headers.cfg
@@ -0,0 +1,5 @@
+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>
diff --git a/make/config/jogl/gl4-common.cfg b/make/config/jogl/gl4-common.cfg
new file mode 100644
index 000000000..2c119da30
--- /dev/null
+++ b/make/config/jogl/gl4-common.cfg
@@ -0,0 +1,5 @@
+
+# >>> OpenGL 4.0
+# <<< OpenGL 4.0
+
+
diff --git a/make/config/jogl/gl3-desktop-tracker.cfg b/make/config/jogl/gl4-desktop-tracker.cfg
index 4b9a7edb7..4b9a7edb7 100644
--- a/make/config/jogl/gl3-desktop-tracker.cfg
+++ b/make/config/jogl/gl4-desktop-tracker.cfg
diff --git a/make/config/jogl/glu-CustomJavaCode-base.java b/make/config/jogl/glu-CustomJavaCode-base.java
index 78c067606..480f5d117 100755
--- a/make/config/jogl/glu-CustomJavaCode-base.java
+++ b/make/config/jogl/glu-CustomJavaCode-base.java
@@ -169,7 +169,7 @@ protected static boolean checkedGLUtessellatorImpl = false;
protected static final void validateGLUtessellatorImpl() {
if(!checkedGLUtessellatorImpl) {
- availableGLUtessellatorImpl = NWReflection.isClassAvailable("com.sun.opengl.impl.glu.tessellator.GLUtessellatorImpl");
+ availableGLUtessellatorImpl = ReflectionUtil.isClassAvailable("com.jogamp.opengl.impl.glu.tessellator.GLUtessellatorImpl");
checkedGLUtessellatorImpl = true;
}
if(!availableGLUtessellatorImpl) {
@@ -1220,7 +1220,7 @@ protected static final void validateGLUquadricImpl() {
if(!checkedGLUquadricImpl) {
synchronized (syncObject) {
if(!checkedGLUquadricImpl) {
- availableGLUquadricImpl = NWReflection.isClassAvailable("com.sun.opengl.impl.glu.GLUquadricImpl");
+ availableGLUquadricImpl = ReflectionUtil.isClassAvailable("com.jogamp.opengl.impl.glu.GLUquadricImpl");
checkedGLUquadricImpl = true;
}
}
diff --git a/make/config/jogl/glu-CustomJavaCode-gl2es1.java b/make/config/jogl/glu-CustomJavaCode-gl2es1.java
index 8afc28c15..f3b4322d9 100755
--- a/make/config/jogl/glu-CustomJavaCode-gl2es1.java
+++ b/make/config/jogl/glu-CustomJavaCode-gl2es1.java
@@ -86,7 +86,7 @@ protected static boolean checkedMipmap = false;
protected static final void validateMipmap() {
if(!checkedMipmap) {
- availableMipmap = NWReflection.isClassAvailable("com.sun.opengl.impl.glu.mipmap.Mipmap");
+ availableMipmap = ReflectionUtil.isClassAvailable("com.jogamp.opengl.impl.glu.mipmap.Mipmap");
checkedMipmap = true;
}
if(!availableMipmap) {
diff --git a/make/config/jogl/glu-base.cfg b/make/config/jogl/glu-base.cfg
index f67673a78..d859225ec 100755
--- a/make/config/jogl/glu-base.cfg
+++ b/make/config/jogl/glu-base.cfg
@@ -20,8 +20,8 @@ Ignore gluScaleImage
IncludeAs CustomJavaCode GLU glu-CustomJavaCode-base.java
# Imports for the Error and Registry classes
-Import com.sun.opengl.impl.glu.error.Error
-Import com.sun.opengl.impl.glu.registry.Registry
+Import com.jogamp.opengl.impl.glu.error.Error
+Import com.jogamp.opengl.impl.glu.registry.Registry
Include glu-common.cfg
diff --git a/make/config/jogl/glu-common.cfg b/make/config/jogl/glu-common.cfg
index df59175bb..f5fc7c1b3 100644
--- a/make/config/jogl/glu-common.cfg
+++ b/make/config/jogl/glu-common.cfg
@@ -9,13 +9,12 @@ TagNativeBinding true
#
# Imports needed by all glue code
#
-Import java.nio.*
Import javax.media.opengl.*
Import javax.media.opengl.glu.*
-Import com.sun.opengl.impl.*
-Import com.sun.opengl.impl.glu.*
-Import com.sun.opengl.impl.glu.tessellator.GLUtessellatorImpl
-Import com.sun.nativewindow.impl.NWReflection
+Import com.jogamp.opengl.impl.*
+Import com.jogamp.opengl.impl.glu.*
+Import com.jogamp.opengl.impl.glu.tessellator.GLUtessellatorImpl
+Import com.jogamp.common.util.ReflectionUtil
# Raise GLException instead of RuntimeException in glue code
RuntimeExceptionType GLException
diff --git a/make/config/jogl/glu-gl2.cfg b/make/config/jogl/glu-gl2.cfg
index 712f9a305..cc5b16f0f 100755
--- a/make/config/jogl/glu-gl2.cfg
+++ b/make/config/jogl/glu-gl2.cfg
@@ -25,7 +25,7 @@ CustomCCode #endif
Include ../intptr.cfg
EmitProcAddressTable true
-ProcAddressTablePackage com.sun.opengl.impl.glu.gl2
+ProcAddressTablePackage com.jogamp.opengl.impl.glu.gl2
ProcAddressTableClassName GLUgl2ProcAddressTable
GetProcAddressTableExpr getGLUProcAddressTable()
@@ -38,14 +38,14 @@ IncludeAs CustomJavaCode GLUgl2 glu-CustomJavaCode-gl2.java
# GLU needs access to the GLUtesselatorImpl class for GLUtesselator,
# to the Mipmap class for scaling and mipmap generation,
# and to the nurbs.* package for the NURBS functionality
-Import com.sun.opengl.impl.glu.nurbs.*
+Import com.jogamp.opengl.impl.glu.nurbs.*
Import java.security.*
-Import com.sun.gluegen.runtime.opengl.GLProcAddressHelper
-Import com.sun.opengl.impl.glu.gl2.nurbs.*
-Import com.sun.opengl.impl.glu.mipmap.Mipmap
-Import com.sun.opengl.impl.glu.gl2.*
+Import com.jogamp.gluegen.runtime.opengl.GLProcAddressHelper
+Import com.jogamp.opengl.impl.glu.gl2.nurbs.*
+Import com.jogamp.opengl.impl.glu.mipmap.Mipmap
+Import com.jogamp.opengl.impl.glu.gl2.*
Import javax.media.opengl.GL2
-Import com.sun.opengl.impl.gl2.ProjectDouble
+Import com.jogamp.opengl.impl.gl2.ProjectDouble
#
# ------------------------
diff --git a/make/config/jogl/glu-gl2es1.cfg b/make/config/jogl/glu-gl2es1.cfg
index 8927f96b9..af89014f4 100755
--- a/make/config/jogl/glu-gl2es1.cfg
+++ b/make/config/jogl/glu-gl2es1.cfg
@@ -20,7 +20,7 @@ Ignore gluScaleImage
IncludeAs CustomJavaCode GLUgl2es1 glu-CustomJavaCode-gl2es1.java
Import javax.media.opengl.GLES1
-Import com.sun.opengl.impl.glu.mipmap.Mipmap
+Import com.jogamp.opengl.impl.glu.mipmap.Mipmap
Include glu-common.cfg
diff --git a/make/config/jogl/glx-CustomCCode.c b/make/config/jogl/glx-CustomCCode.c
index a075c4852..1b30a7da6 100755
--- a/make/config/jogl/glx-CustomCCode.c
+++ b/make/config/jogl/glx-CustomCCode.c
@@ -15,7 +15,7 @@
/* We expect glXGetProcAddressARB to be defined */
extern void (*glXGetProcAddressARB(const GLubyte *procname))();
-static const char * clazzNameInternalBufferUtil = "com/sun/opengl/impl/InternalBufferUtil";
+static const char * clazzNameInternalBufferUtil = "com/jogamp/opengl/impl/InternalBufferUtil";
static const char * clazzNameInternalBufferUtilStaticCstrName = "copyByteBuffer";
static const char * clazzNameInternalBufferUtilStaticCstrSignature = "(Ljava/nio/ByteBuffer;)Ljava/nio/ByteBuffer;";
static const char * clazzNameByteBuffer = "java/nio/ByteBuffer";
@@ -30,29 +30,29 @@ static void _initClazzAccess(JNIEnv *env) {
c = (*env)->FindClass(env, clazzNameInternalBufferUtil);
if(NULL==c) {
- fprintf(stderr, "FatalError: Java_com_sun_opengl_impl_x11_glx_GLX: can't find %s\n", clazzNameInternalBufferUtil);
+ fprintf(stderr, "FatalError: Java_com_jogamp_opengl_impl_x11_glx_GLX: can't find %s\n", clazzNameInternalBufferUtil);
(*env)->FatalError(env, clazzNameInternalBufferUtil);
}
clazzInternalBufferUtil = (jclass)(*env)->NewGlobalRef(env, c);
if(NULL==clazzInternalBufferUtil) {
- fprintf(stderr, "FatalError: Java_com_sun_opengl_impl_x11_glx_GLX: can't use %s\n", clazzNameInternalBufferUtil);
+ fprintf(stderr, "FatalError: Java_com_jogamp_opengl_impl_x11_glx_GLX: can't use %s\n", clazzNameInternalBufferUtil);
(*env)->FatalError(env, clazzNameInternalBufferUtil);
}
c = (*env)->FindClass(env, clazzNameByteBuffer);
if(NULL==c) {
- fprintf(stderr, "FatalError: Java_com_sun_opengl_impl_x11_glx_GLX: can't find %s\n", clazzNameByteBuffer);
+ fprintf(stderr, "FatalError: Java_com_jogamp_opengl_impl_x11_glx_GLX: can't find %s\n", clazzNameByteBuffer);
(*env)->FatalError(env, clazzNameByteBuffer);
}
clazzByteBuffer = (jclass)(*env)->NewGlobalRef(env, c);
if(NULL==c) {
- fprintf(stderr, "FatalError: Java_com_sun_opengl_impl_x11_glx_GLX: can't use %s\n", clazzNameByteBuffer);
+ fprintf(stderr, "FatalError: Java_com_jogamp_opengl_impl_x11_glx_GLX: can't use %s\n", clazzNameByteBuffer);
(*env)->FatalError(env, clazzNameByteBuffer);
}
cstrInternalBufferUtil = (*env)->GetStaticMethodID(env, clazzInternalBufferUtil,
clazzNameInternalBufferUtilStaticCstrName, clazzNameInternalBufferUtilStaticCstrSignature);
if(NULL==cstrInternalBufferUtil) {
- fprintf(stderr, "FatalError: Java_com_sun_opengl_impl_x11_glx_GLX:: can't create %s.%s %s\n",
+ fprintf(stderr, "FatalError: Java_com_jogamp_opengl_impl_x11_glx_GLX:: can't create %s.%s %s\n",
clazzNameInternalBufferUtil,
clazzNameInternalBufferUtilStaticCstrName, clazzNameInternalBufferUtilStaticCstrSignature);
(*env)->FatalError(env, clazzNameInternalBufferUtilStaticCstrName);
@@ -60,12 +60,12 @@ static void _initClazzAccess(JNIEnv *env) {
}
/* Java->C glue code:
- * Java package: com.sun.opengl.impl.x11.glx.GLX
+ * Java package: com.jogamp.opengl.impl.x11.glx.GLX
* Java method: XVisualInfo glXGetVisualFromFBConfig(long dpy, long config)
* C function: XVisualInfo * glXGetVisualFromFBConfig(Display * dpy, GLXFBConfig config);
*/
JNIEXPORT jobject JNICALL
-Java_com_sun_opengl_impl_x11_glx_GLX_glXGetVisualFromFBConfigCopied0__JJ(JNIEnv *env, jclass _unused, jlong dpy, jlong config) {
+Java_com_jogamp_opengl_impl_x11_glx_GLX_glXGetVisualFromFBConfigCopied0__JJ(JNIEnv *env, jclass _unused, jlong dpy, jlong config) {
XVisualInfo * _res;
jobject jbyteSource;
jobject jbyteCopy;
@@ -78,19 +78,19 @@ Java_com_sun_opengl_impl_x11_glx_GLX_glXGetVisualFromFBConfigCopied0__JJ(JNIEnv
jbyteCopy = (*env)->CallStaticObjectMethod(env,
clazzInternalBufferUtil, cstrInternalBufferUtil, jbyteSource);
- // FIXME: remove reference/gc jbyteSource ??
+ (*env)->DeleteLocalRef(env, jbyteSource);
XFree(_res);
return jbyteCopy;
}
/* Java->C glue code:
- * Java package: com.sun.opengl.impl.x11.glx.GLX
+ * Java package: com.jogamp.opengl.impl.x11.glx.GLX
* Java method: java.nio.LongBuffer glXChooseFBConfig(long dpy, int screen, java.nio.IntBuffer attribList, java.nio.IntBuffer nitems)
* C function: GLXFBConfig * glXChooseFBConfig(Display * dpy, int screen, const int * attribList, int * nitems);
*/
JNIEXPORT jobject JNICALL
-Java_com_sun_opengl_impl_x11_glx_GLX_glXChooseFBConfigCopied1__JILjava_lang_Object_2ILjava_lang_Object_2I(JNIEnv *env, jclass _unused, jlong dpy, jint screen, jobject attribList, jint attribList_byte_offset, jobject nitems, jint nitems_byte_offset) {
+Java_com_jogamp_opengl_impl_x11_glx_GLX_glXChooseFBConfigCopied1__JILjava_lang_Object_2ILjava_lang_Object_2I(JNIEnv *env, jclass _unused, jlong dpy, jint screen, jobject attribList, jint attribList_byte_offset, jobject nitems, jint nitems_byte_offset) {
int * _ptr2 = NULL;
int * _ptr3 = NULL;
GLXFBConfig * _res;
@@ -118,20 +118,19 @@ Java_com_sun_opengl_impl_x11_glx_GLX_glXChooseFBConfigCopied1__JILjava_lang_Obje
jbyteSource = (*env)->NewDirectByteBuffer(env, _res, count * sizeof(GLXFBConfig));
jbyteCopy = (*env)->CallStaticObjectMethod(env,
clazzInternalBufferUtil, cstrInternalBufferUtil, jbyteSource);
-
- // FIXME: remove reference/gc jbyteSource ??
+ (*env)->DeleteLocalRef(env, jbyteSource);
XFree(_res);
return jbyteCopy;
}
/* Java->C glue code:
- * Java package: com.sun.opengl.impl.x11.glx.GLX
+ * Java package: com.jogamp.opengl.impl.x11.glx.GLX
* Java method: XVisualInfo glXChooseVisual(long dpy, int screen, java.nio.IntBuffer attribList)
* C function: XVisualInfo * glXChooseVisual(Display * dpy, int screen, int * attribList);
*/
JNIEXPORT jobject JNICALL
-Java_com_sun_opengl_impl_x11_glx_GLX_glXChooseVisualCopied1__JILjava_lang_Object_2I(JNIEnv *env, jclass _unused, jlong dpy, jint screen, jobject attribList, jint attribList_byte_offset) {
+Java_com_jogamp_opengl_impl_x11_glx_GLX_glXChooseVisualCopied1__JILjava_lang_Object_2I(JNIEnv *env, jclass _unused, jlong dpy, jint screen, jobject attribList, jint attribList_byte_offset) {
int * _ptr2 = NULL;
XVisualInfo * _res;
jobject jbyteSource;
@@ -151,7 +150,7 @@ Java_com_sun_opengl_impl_x11_glx_GLX_glXChooseVisualCopied1__JILjava_lang_Object
jbyteCopy = (*env)->CallStaticObjectMethod(env,
clazzInternalBufferUtil, cstrInternalBufferUtil, jbyteSource);
- // FIXME: remove reference/gc jbyteSource ??
+ (*env)->DeleteLocalRef(env, jbyteSource);
XFree(_res);
return jbyteCopy;
diff --git a/make/config/jogl/glx-CustomJavaCode.java b/make/config/jogl/glx-CustomJavaCode.java
index 25a6156b7..fe81cd64a 100644
--- a/make/config/jogl/glx-CustomJavaCode.java
+++ b/make/config/jogl/glx-CustomJavaCode.java
@@ -13,17 +13,17 @@
/** Interface to C language function: <br> - Alias for: <br> <code> GLXFBConfig * glXChooseFBConfigSGIX, glXChooseFBConfig(Display * dpy, int screen, const int * attribList, int * nitems); </code> */
- public static com.sun.gluegen.runtime.PointerBuffer glXChooseFBConfigCopied(long dpy, int screen, int[] attribList, int attribList_offset, int[] nitems, int nitems_offset)
+ public static com.jogamp.common.nio.PointerBuffer glXChooseFBConfigCopied(long dpy, int screen, int[] attribList, int attribList_offset, int[] nitems, int nitems_offset)
{
if(attribList != null && attribList.length <= attribList_offset)
throw new GLException("array offset argument \"attribList_offset\" (" + attribList_offset + ") equals or exceeds array length (" + attribList.length + ")");
if(nitems != null && nitems.length <= nitems_offset)
throw new GLException("array offset argument \"nitems_offset\" (" + nitems_offset + ") equals or exceeds array length (" + nitems.length + ")");
java.nio.ByteBuffer _res;
- _res = glXChooseFBConfigCopied1(dpy, screen, attribList, BufferFactory.SIZEOF_INT * attribList_offset, nitems, BufferFactory.SIZEOF_INT * nitems_offset);
+ _res = glXChooseFBConfigCopied1(dpy, screen, attribList, Buffers.SIZEOF_INT * attribList_offset, nitems, Buffers.SIZEOF_INT * nitems_offset);
if (_res == null) return null;
- return PointerBuffer.wrapNative2Java(_res, false);
+ return PointerBuffer.wrap(_res);
}
/** Entry point to C language function: - Alias for: <br> <code> GLXFBConfig * glXChooseFBConfigSGIX, glXChooseFBConfig(Display * dpy, int screen, const int * attribList, int * nitems); </code> */
@@ -35,7 +35,7 @@
if(attribList != null && attribList.length <= attribList_offset)
throw new GLException("array offset argument \"attribList_offset\" (" + attribList_offset + ") equals or exceeds array length (" + attribList.length + ")");
java.nio.ByteBuffer _res;
- _res = glXChooseVisualCopied1(dpy, screen, attribList, BufferFactory.SIZEOF_INT * attribList_offset);
+ _res = glXChooseVisualCopied1(dpy, screen, attribList, Buffers.SIZEOF_INT * attribList_offset);
if (_res == null) return null;
return XVisualInfo.create(_res);
diff --git a/make/config/jogl/glx-x11.cfg b/make/config/jogl/glx-x11.cfg
index c9079b84f..bbe805a04 100644
--- a/make/config/jogl/glx-x11.cfg
+++ b/make/config/jogl/glx-x11.cfg
@@ -3,7 +3,7 @@
JavaOutputDir gensrc/classes
NativeOutputDir gensrc/native/jogl/X11
-Package com.sun.opengl.impl.x11.glx
+Package com.jogamp.opengl.impl.x11.glx
JavaClass GLX
Style allstatic
Include gl-common.cfg
@@ -19,7 +19,7 @@ GetProcAddressTableExpr glxProcAddressTable
# This must be present for bootstrapping
SkipProcAddressGen glXGetProcAddressARB
-Import com.sun.nativewindow.impl.x11.*
+Import com.jogamp.nativewindow.impl.x11.*
CustomJavaCode GLX private static GLXProcAddressTable glxProcAddressTable = new GLXProcAddressTable();
diff --git a/make/config/jogl/glxext.cfg b/make/config/jogl/glxext.cfg
index 39ba379c4..1dfc8fccd 100755
--- a/make/config/jogl/glxext.cfg
+++ b/make/config/jogl/glxext.cfg
@@ -3,13 +3,13 @@
JavaOutputDir gensrc/classes
NativeOutputDir gensrc/native/jogl/X11
-Package com.sun.opengl.impl.x11.glx
+Package com.jogamp.opengl.impl.x11.glx
Style InterfaceAndImpl
JavaClass GLXExt
-ImplPackage com.sun.opengl.impl.x11.glx
+ImplPackage com.jogamp.opengl.impl.x11.glx
ImplJavaClass GLXExtImpl
-ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/com/sun/opengl/impl/x11/glx/GLX.java
+ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/com/jogamp/opengl/impl/x11/glx/GLX.java
Include gl-common.cfg
Include gl-desktop.cfg
@@ -20,7 +20,7 @@ EmitProcAddressTable true
ProcAddressTableClassName GLXExtProcAddressTable
GetProcAddressTableExpr _context.getGLXExtProcAddressTable()
-Import com.sun.nativewindow.impl.x11.*
+Import com.jogamp.nativewindow.impl.x11.*
# Ignore everything that doesn't start with glX or GLX
IgnoreNot ^(glX|GLX).+
diff --git a/make/config/jogl/wgl-win32.cfg b/make/config/jogl/wgl-win32.cfg
index 6cd4fd412..2a69290a4 100644
--- a/make/config/jogl/wgl-win32.cfg
+++ b/make/config/jogl/wgl-win32.cfg
@@ -3,7 +3,7 @@
JavaOutputDir gensrc/classes
NativeOutputDir gensrc/native/jogl/Windows
-Package com.sun.opengl.impl.windows.wgl
+Package com.jogamp.opengl.impl.windows.wgl
JavaClass WGL
Style allstatic
Include gl-common.cfg
diff --git a/make/config/jogl/wglext.cfg b/make/config/jogl/wglext.cfg
index ea9a0257e..35c43cb86 100644
--- a/make/config/jogl/wglext.cfg
+++ b/make/config/jogl/wglext.cfg
@@ -3,10 +3,10 @@
JavaOutputDir gensrc/classes
NativeOutputDir gensrc/native/jogl/Windows
-Package com.sun.opengl.impl.windows.wgl
+Package com.jogamp.opengl.impl.windows.wgl
Style InterfaceAndImpl
JavaClass WGLExt
-ImplPackage com.sun.opengl.impl.windows.wgl
+ImplPackage com.jogamp.opengl.impl.windows.wgl
ImplJavaClass WGLExtImpl
Include gl-common.cfg
Include gl-desktop.cfg
diff --git a/make/config/nativewindow/jawt-DrawingSurfaceInfo-CustomJavaCode.java b/make/config/nativewindow/jawt-DrawingSurfaceInfo-CustomJavaCode.java
index dab377ad4..aad0ab261 100755
--- a/make/config/nativewindow/jawt-DrawingSurfaceInfo-CustomJavaCode.java
+++ b/make/config/nativewindow/jawt-DrawingSurfaceInfo-CustomJavaCode.java
@@ -16,12 +16,12 @@ private static JAWT_PlatformInfo newPlatformInfo(ByteBuffer buf) {
try {
Class factoryClass;
if (osName.startsWith("wind")) {
- factoryClass = Class.forName("com.sun.nativewindow.impl.jawt.windows.JAWT_Win32DrawingSurfaceInfo");
+ factoryClass = Class.forName("com.jogamp.nativewindow.impl.jawt.windows.JAWT_Win32DrawingSurfaceInfo");
} else if (osName.startsWith("mac os x")) {
- factoryClass = Class.forName("com.sun.nativewindow.impl.jawt.macosx.JAWT_MacOSXDrawingSurfaceInfo");
+ factoryClass = Class.forName("com.jogamp.nativewindow.impl.jawt.macosx.JAWT_MacOSXDrawingSurfaceInfo");
} else {
// Assume Linux, Solaris, etc. Should probably test for these explicitly.
- factoryClass = Class.forName("com.sun.nativewindow.impl.jawt.x11.JAWT_X11DrawingSurfaceInfo");
+ factoryClass = Class.forName("com.jogamp.nativewindow.impl.jawt.x11.JAWT_X11DrawingSurfaceInfo");
}
platformInfoFactoryMethod = factoryClass.getMethod("create",
new Class[] { ByteBuffer.class });
diff --git a/make/config/nativewindow/jawt-macosx.cfg b/make/config/nativewindow/jawt-macosx.cfg
index b047ecdff..dea1a27b7 100644
--- a/make/config/nativewindow/jawt-macosx.cfg
+++ b/make/config/nativewindow/jawt-macosx.cfg
@@ -1,7 +1,7 @@
# This .cfg file is used to generate the interface to the JAWT, which
# is used by the MacOSXOnscreenGLContext.
Style AllStatic
-Package com.sun.nativewindow.impl.jawt
+Package com.jogamp.nativewindow.impl.jawt
JavaClass JAWTFactory
JavaOutputDir gensrc/classes
NativeOutputDir gensrc/native/MacOSX
@@ -22,8 +22,8 @@ CustomCCode #include <jawt.h>
CustomCCode #include </usr/include/machine/types.h>
import java.security.*
-import com.sun.nativewindow.impl.jawt.*
-StructPackage JAWT_MacOSXDrawingSurfaceInfo com.sun.nativewindow.impl.jawt.macosx
+import com.jogamp.nativewindow.impl.jawt.*
+StructPackage JAWT_MacOSXDrawingSurfaceInfo com.jogamp.nativewindow.impl.jawt.macosx
EmitStruct JAWT_MacOSXDrawingSurfaceInfo
Implements JAWT_MacOSXDrawingSurfaceInfo JAWT_PlatformInfo
diff --git a/make/config/nativewindow/jawt-win32.cfg b/make/config/nativewindow/jawt-win32.cfg
index e7754843e..af0c7ce29 100644
--- a/make/config/nativewindow/jawt-win32.cfg
+++ b/make/config/nativewindow/jawt-win32.cfg
@@ -1,7 +1,7 @@
# This .cfg file is used to generate the interface to the JAWT, which
# is used by the WindowsOnscreenGLContext.
Style AllStatic
-Package com.sun.nativewindow.impl.jawt
+Package com.jogamp.nativewindow.impl.jawt
JavaClass JAWTFactory
JavaOutputDir gensrc/classes
NativeOutputDir gensrc/native/Windows
@@ -22,8 +22,8 @@ CustomCCode #include <jawt.h>
Include ../intptr.cfg
import java.security.*
-import com.sun.nativewindow.impl.jawt.*
-StructPackage JAWT_Win32DrawingSurfaceInfo com.sun.nativewindow.impl.jawt.windows
+import com.jogamp.nativewindow.impl.jawt.*
+StructPackage JAWT_Win32DrawingSurfaceInfo com.jogamp.nativewindow.impl.jawt.windows
EmitStruct JAWT_Win32DrawingSurfaceInfo
Implements JAWT_Win32DrawingSurfaceInfo JAWT_PlatformInfo
diff --git a/make/config/nativewindow/jawt-x11.cfg b/make/config/nativewindow/jawt-x11.cfg
index 25df57a1f..ccfe009dd 100644
--- a/make/config/nativewindow/jawt-x11.cfg
+++ b/make/config/nativewindow/jawt-x11.cfg
@@ -1,7 +1,7 @@
# This .cfg file is used to generate the interface to the JAWT, which
# is used by the X11OnscreenGLContext.
Style AllStatic
-Package com.sun.nativewindow.impl.jawt
+Package com.jogamp.nativewindow.impl.jawt
JavaClass JAWTFactory
JavaOutputDir gensrc/classes
NativeOutputDir gensrc/native/X11
@@ -22,8 +22,8 @@ CustomCCode #include <inttypes.h>
CustomCCode #include <jawt.h>
import java.security.*
-import com.sun.nativewindow.impl.jawt.*
-StructPackage JAWT_X11DrawingSurfaceInfo com.sun.nativewindow.impl.jawt.x11
+import com.jogamp.nativewindow.impl.jawt.*
+StructPackage JAWT_X11DrawingSurfaceInfo com.jogamp.nativewindow.impl.jawt.x11
EmitStruct JAWT_X11DrawingSurfaceInfo
Implements JAWT_X11DrawingSurfaceInfo JAWT_PlatformInfo
diff --git a/make/config/nativewindow/x11-CustomCCode.c b/make/config/nativewindow/x11-CustomCCode.c
deleted file mode 100755
index c1f66fee1..000000000
--- a/make/config/nativewindow/x11-CustomCCode.c
+++ /dev/null
@@ -1,169 +0,0 @@
-#include <inttypes.h>
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-/* Linux headers don't work properly */
-#define __USE_GNU
-#include <dlfcn.h>
-#undef __USE_GNU
-
-/* Current versions of Solaris don't expose the XF86 extensions,
- although with the recent transition to Xorg this will probably
- happen in an upcoming release */
-#if !defined(__sun) && !defined(_HPUX)
-#include <X11/extensions/xf86vmode.h>
-#else
-/* Need to provide stubs for these */
-Bool XF86VidModeGetGammaRampSize(
- Display *display,
- int screen,
- int* size)
-{
- return False;
-}
-
-Bool XF86VidModeGetGammaRamp(
- Display *display,
- int screen,
- int size,
- unsigned short *red_array,
- unsigned short *green_array,
- unsigned short *blue_array) {
- return False;
-}
-Bool XF86VidModeSetGammaRamp(
- Display *display,
- int screen,
- int size,
- unsigned short *red_array,
- unsigned short *green_array,
- unsigned short *blue_array) {
- return False;
-}
-#endif
-
-/* HP-UX doesn't define RTLD_DEFAULT. */
-#if defined(_HPUX) && !defined(RTLD_DEFAULT)
-#define RTLD_DEFAULT NULL
-#endif
-
-/* Need to expose DefaultScreen and RootWindow macros to Java */
-JNIEXPORT jlong JNICALL
-Java_com_sun_nativewindow_impl_x11_X11Lib_DefaultScreen(JNIEnv *env, jclass _unused, jlong display) {
- return DefaultScreen((Display*) (intptr_t) display);
-}
-
-JNIEXPORT jlong JNICALL
-Java_com_sun_nativewindow_impl_x11_X11Lib_DefaultVisualID(JNIEnv *env, jclass _unused, jlong display, jint screen) {
- return (jlong) XVisualIDFromVisual( DefaultVisual( (Display*) (intptr_t) display, screen ) );
-}
-
-JNIEXPORT jlong JNICALL
-Java_com_sun_nativewindow_impl_x11_X11Lib_RootWindow(JNIEnv *env, jclass _unused, jlong display, jint screen) {
- return RootWindow((Display*) (intptr_t) display, screen);
-}
-
-JNIEXPORT jlong JNICALL
-Java_com_sun_nativewindow_impl_x11_X11Lib_dlopen(JNIEnv *env, jclass _unused, jstring name) {
- const jbyte* chars;
- void* res;
- chars = (*env)->GetStringUTFChars(env, name, NULL);
- res = dlopen(chars, RTLD_LAZY | RTLD_GLOBAL);
- (*env)->ReleaseStringUTFChars(env, name, chars);
- return (jlong) ((intptr_t) res);
-}
-
-JNIEXPORT jlong JNICALL
-Java_com_sun_nativewindow_impl_x11_X11Lib_dlsym(JNIEnv *env, jclass _unused, jstring name) {
- const jbyte* chars;
- void* res;
- chars = (*env)->GetStringUTFChars(env, name, NULL);
- res = dlsym(RTLD_DEFAULT, chars);
- (*env)->ReleaseStringUTFChars(env, name, chars);
- return (jlong) ((intptr_t) res);
-}
-
-/* Need to pull this in as we don't have a stub header for it */
-extern Bool XineramaEnabled(Display* display);
-
-static const char * clazzNameInternalBufferUtil = "com/sun/nativewindow/impl/InternalBufferUtil";
-static const char * clazzNameInternalBufferUtilStaticCstrName = "copyByteBuffer";
-static const char * clazzNameInternalBufferUtilStaticCstrSignature = "(Ljava/nio/ByteBuffer;)Ljava/nio/ByteBuffer;";
-static const char * clazzNameByteBuffer = "java/nio/ByteBuffer";
-static jclass clazzInternalBufferUtil = NULL;
-static jmethodID cstrInternalBufferUtil = NULL;
-static jclass clazzByteBuffer = NULL;
-
-static void _initClazzAccess(JNIEnv *env) {
- jclass c;
-
- if(NULL!=cstrInternalBufferUtil) return ;
-
- c = (*env)->FindClass(env, clazzNameInternalBufferUtil);
- if(NULL==c) {
- fprintf(stderr, "FatalError: Java_com_sun_nativewindow_impl_x11_X11Lib: can't find %s\n", clazzNameInternalBufferUtil);
- (*env)->FatalError(env, clazzNameInternalBufferUtil);
- }
- clazzInternalBufferUtil = (jclass)(*env)->NewGlobalRef(env, c);
- if(NULL==clazzInternalBufferUtil) {
- fprintf(stderr, "FatalError: Java_com_sun_nativewindow_impl_x11_X11Lib: can't use %s\n", clazzNameInternalBufferUtil);
- (*env)->FatalError(env, clazzNameInternalBufferUtil);
- }
- c = (*env)->FindClass(env, clazzNameByteBuffer);
- if(NULL==c) {
- fprintf(stderr, "FatalError: Java_com_sun_nativewindow_impl_x11_X11Lib: can't find %s\n", clazzNameByteBuffer);
- (*env)->FatalError(env, clazzNameByteBuffer);
- }
- clazzByteBuffer = (jclass)(*env)->NewGlobalRef(env, c);
- if(NULL==c) {
- fprintf(stderr, "FatalError: Java_com_sun_nativewindow_impl_x11_X11Lib: can't use %s\n", clazzNameByteBuffer);
- (*env)->FatalError(env, clazzNameByteBuffer);
- }
-
- cstrInternalBufferUtil = (*env)->GetStaticMethodID(env, clazzInternalBufferUtil,
- clazzNameInternalBufferUtilStaticCstrName, clazzNameInternalBufferUtilStaticCstrSignature);
- if(NULL==cstrInternalBufferUtil) {
- fprintf(stderr, "FatalError: Java_com_sun_nativewindow_impl_x11_X11Lib:: can't create %s.%s %s\n",
- clazzNameInternalBufferUtil,
- clazzNameInternalBufferUtilStaticCstrName, clazzNameInternalBufferUtilStaticCstrSignature);
- (*env)->FatalError(env, clazzNameInternalBufferUtilStaticCstrName);
- }
-}
-
-/* Java->C glue code:
- * Java package: com.sun.nativewindow.impl.x11.X11Lib
- * Java method: XVisualInfo XGetVisualInfo(long arg0, long arg1, XVisualInfo arg2, java.nio.IntBuffer arg3)
- * C function: XVisualInfo * XGetVisualInfo(Display * , long, XVisualInfo * , int * );
- */
-JNIEXPORT jobject JNICALL
-Java_com_sun_nativewindow_impl_x11_X11Lib_XGetVisualInfoCopied1__JJLjava_nio_ByteBuffer_2Ljava_lang_Object_2I(JNIEnv *env, jclass _unused, jlong arg0, jlong arg1, jobject arg2, jobject arg3, jint arg3_byte_offset) {
- XVisualInfo * _ptr2 = NULL;
- int * _ptr3 = NULL;
- XVisualInfo * _res;
- int count;
- jobject jbyteSource;
- jobject jbyteCopy;
- if (arg2 != NULL) {
- _ptr2 = (XVisualInfo *) (((char*) (*env)->GetDirectBufferAddress(env, arg2)) + 0);
- }
- if (arg3 != NULL) {
- _ptr3 = (int *) (((char*) (*env)->GetPrimitiveArrayCritical(env, arg3, NULL)) + arg3_byte_offset);
- }
- _res = XGetVisualInfo((Display *) (intptr_t) arg0, (long) arg1, (XVisualInfo *) _ptr2, (int *) _ptr3);
- count = _ptr3[0];
- if (arg3 != NULL) {
- (*env)->ReleasePrimitiveArrayCritical(env, arg3, _ptr3, 0);
- }
- if (_res == NULL) return NULL;
-
- _initClazzAccess(env);
-
- jbyteSource = (*env)->NewDirectByteBuffer(env, _res, count * sizeof(XVisualInfo));
- jbyteCopy = (*env)->CallStaticObjectMethod(env,
- clazzInternalBufferUtil, cstrInternalBufferUtil, jbyteSource);
-
- // FIXME: remove reference/gc jbyteSource ??
- XFree(_res);
-
- return jbyteCopy;
-}
-
diff --git a/make/config/nativewindow/x11-CustomJavaCode.java b/make/config/nativewindow/x11-CustomJavaCode.java
index b1ee3a6c3..44bb1e8d0 100644
--- a/make/config/nativewindow/x11-CustomJavaCode.java
+++ b/make/config/nativewindow/x11-CustomJavaCode.java
@@ -5,10 +5,10 @@
if(arg3 != null && arg3.length <= arg3_offset)
throw new RuntimeException("array offset argument \"arg3_offset\" (" + arg3_offset + ") equals or exceeds array length (" + arg3.length + ")");
java.nio.ByteBuffer _res;
- _res = XGetVisualInfoCopied1(arg0, arg1, ((arg2 == null) ? null : arg2.getBuffer()), arg3, BufferFactory.SIZEOF_INT * arg3_offset);
+ _res = XGetVisualInfoCopied1(arg0, arg1, ((arg2 == null) ? null : arg2.getBuffer()), arg3, Buffers.SIZEOF_INT * arg3_offset);
if (_res == null) return null;
- BufferFactory.nativeOrder(_res);
+ Buffers.nativeOrder(_res);
XVisualInfo[] _retarray = new XVisualInfo[getFirstElement(arg3, arg3_offset)];
for (int _count = 0; _count < getFirstElement(arg3, arg3_offset); _count++) {
_res.position(_count * XVisualInfo.size());
@@ -24,3 +24,15 @@
/** Entry point to C language function: <code> XVisualInfo * XGetVisualInfo(Display * , long, XVisualInfo * , int * ); </code> */
private static native java.nio.ByteBuffer XGetVisualInfoCopied1(long arg0, long arg1, java.nio.ByteBuffer arg2, Object arg3, int arg3_byte_offset);
+ public static native long DefaultVisualID(long display, int screen);
+
+ public static native long CreateDummyWindow(long display, int screen_index, long visualID);
+ public static native void DestroyDummyWindow(long display, long window);
+
+ public static native long dlopen(String name);
+ public static native long dlsym(String name);
+
+ public static native int XCloseDisplay(long display);
+ public static native void XUnlockDisplay(long display);
+ public static native void XLockDisplay(long display);
+
diff --git a/make/config/nativewindow/x11-lib.cfg b/make/config/nativewindow/x11-lib.cfg
index 321444725..cf9642398 100644
--- a/make/config/nativewindow/x11-lib.cfg
+++ b/make/config/nativewindow/x11-lib.cfg
@@ -1,6 +1,6 @@
# This .cfg file is used to generate the interface to the GLX routines
# used internally by the X11GLContext implementation.
-Package com.sun.nativewindow.impl.x11
+Package com.jogamp.nativewindow.impl.x11
JavaClass X11Lib
Style allstatic
@@ -20,24 +20,25 @@ Opaque long Display *
Opaque boolean Bool
Opaque long GLXFBConfig
-CustomJavaCode X11Lib public static native long dlopen(String name);
-CustomJavaCode X11Lib public static native long dlsym(String name);
-
IncludeAs CustomJavaCode X11Lib x11-CustomJavaCode.java
-IncludeAs CustomCCode x11-CustomCCode.c
+# Now resides in x11/Xmisc.c: IncludeAs CustomCCode x11-CustomCCode.c
ArgumentIsString XOpenDisplay 0
-# Need to expose DefaultScreen and RootWindow macros to Java
-CustomJavaCode X11Lib public static native int DefaultScreen(long display);
-CustomJavaCode X11Lib public static native long DefaultVisualID(long display, int screen);
-CustomJavaCode X11Lib public static native long RootWindow(long display, int screen);
-
# We have Custom code for the following
Ignore XGetVisualInfo
+ManuallyImplement XCloseDisplay
+ManuallyImplement XUnlockDisplay
+ManuallyImplement XLockDisplay
+
# Helper routine to make the ReturnedArrayLength expression below work correctly
CustomJavaCode X11Lib private static int getFirstElement(IntBuffer buf) { return buf.get(buf.position()); }
CustomJavaCode X11Lib private static int getFirstElement(int[] arr, int offset) { return arr[offset]; }
CustomJavaCode XVisualInfo public static XVisualInfo create(XVisualInfo s) { XVisualInfo d = XVisualInfo.create(); d.getBuffer().put(s.getBuffer()); d.getBuffer().rewind(); s.getBuffer().rewind(); return d; }
+
+CustomCCode #include <inttypes.h>
+CustomCCode #include <X11/Xlib.h>
+CustomCCode #include <X11/Xutil.h>
+