summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/classes/share/javax/media/j3d/MasterControl.java2
-rw-r--r--src/classes/share/javax/media/j3d/NativeConfigTemplate3D.java108
-rw-r--r--src/classes/share/javax/media/j3d/NativePipeline.java32
-rw-r--r--src/classes/share/javax/media/j3d/NativeScreenInfo.java69
-rw-r--r--src/classes/win32/javax/media/j3d/Win32NativeConfigTemplate3D.java (renamed from src/classes/win32/javax/media/j3d/NativeConfigTemplate3D.java)44
-rw-r--r--src/classes/win32/javax/media/j3d/Win32NativeScreenInfo.java (renamed from src/classes/win32/javax/media/j3d/NativeScreenInfo.java)17
-rw-r--r--src/classes/x11/javax/media/j3d/X11NativeConfigTemplate3D.java (renamed from src/classes/x11/javax/media/j3d/NativeConfigTemplate3D.java)68
-rw-r--r--src/classes/x11/javax/media/j3d/X11NativeScreenInfo.java (renamed from src/classes/x11/javax/media/j3d/NativeScreenInfo.java)19
-rw-r--r--src/native/build.xml42
-rw-r--r--src/native/d3d/NativeConfigTemplate3D.cpp16
-rw-r--r--src/native/ogl/NativeConfigTemplate3D.c28
-rw-r--r--src/native/ogl/NativeScreenInfo.c16
-rw-r--r--src/native/ogl/gldefs.h8
13 files changed, 349 insertions, 120 deletions
diff --git a/src/classes/share/javax/media/j3d/MasterControl.java b/src/classes/share/javax/media/j3d/MasterControl.java
index c503697..f1f1687 100644
--- a/src/classes/share/javax/media/j3d/MasterControl.java
+++ b/src/classes/share/javax/media/j3d/MasterControl.java
@@ -1253,7 +1253,7 @@ class MasterControl {
* Returns whether we are running on Windows
* TODO: most code that cares about this should move into the pipeline
*/
- final boolean isWindows() {
+ static final boolean isWindows() {
return isWindowsOs;
}
diff --git a/src/classes/share/javax/media/j3d/NativeConfigTemplate3D.java b/src/classes/share/javax/media/j3d/NativeConfigTemplate3D.java
new file mode 100644
index 0000000..d16c0a2
--- /dev/null
+++ b/src/classes/share/javax/media/j3d/NativeConfigTemplate3D.java
@@ -0,0 +1,108 @@
+/*
+ * $RCSfile$
+ *
+ * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
+ *
+ * Use is subject to license terms.
+ *
+ * $Revision$
+ * $Date$
+ * $State$
+ */
+
+package javax.media.j3d;
+
+import java.awt.GraphicsConfiguration;
+
+/**
+ * Native config template class. A singleton instance of the appropriate
+ * concrete subclass is created by a factory method using reflection.
+ */
+abstract class NativeConfigTemplate3D {
+ // These definitions are used by both the X11 and Win32 subclasses
+ final static int RED_SIZE = 0;
+ final static int GREEN_SIZE = 1;
+ final static int BLUE_SIZE = 2;
+ final static int ALPHA_SIZE = 3;
+ final static int ACCUM_BUFFER = 4;
+ final static int DEPTH_SIZE = 5;
+ final static int DOUBLEBUFFER = 6;
+ final static int STEREO = 7;
+ final static int ANTIALIASING = 8;
+ final static int STENCIL_SIZE = 9;
+ final static int NUM_ITEMS = 10;
+
+ private static final String x11ClassName = "javax.media.j3d.X11NativeConfigTemplate3D";
+ private static final String win32ClassName = "javax.media.j3d.Win32NativeConfigTemplate3D";
+
+ // The singleton instance of this class
+ private static NativeConfigTemplate3D nativeConfigTemplate3D = null;
+
+ protected NativeConfigTemplate3D() {
+ }
+
+ // This method is called exactly once by the initialization method of
+ // the NativePipeline class
+ synchronized static void createNativeConfigTemplate3D() {
+ String className;
+ if (MasterControl.isWindows()) {
+ className = win32ClassName;
+ } else {
+ className = x11ClassName;
+ }
+
+ final String templateClassName = className;
+ nativeConfigTemplate3D = (NativeConfigTemplate3D)
+ java.security.AccessController.doPrivileged(new
+ java.security.PrivilegedAction() {
+ public Object run() {
+ try {
+ Class templateClass = Class.forName(templateClassName);
+ return templateClass.newInstance();
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+ });
+ }
+
+ static NativeConfigTemplate3D getNativeConfigTemplate3D() {
+ return nativeConfigTemplate3D;
+ }
+
+
+ /*
+ * Chooses the best FBConfig for Java 3D apps.
+ */
+ abstract GraphicsConfiguration getBestConfiguration(GraphicsConfigTemplate3D template,
+ GraphicsConfiguration[] gc);
+
+ /*
+ * Determine if a given GraphicsConfiguration object can be used
+ * by Java 3D.
+ */
+ abstract boolean isGraphicsConfigSupported(GraphicsConfigTemplate3D template,
+ GraphicsConfiguration gc);
+
+
+ // Return whether stereo is available.
+ abstract boolean hasStereo(Canvas3D c3d);
+
+ // Return the stencil of this canvas.
+ abstract int getStencilSize(Canvas3D c3d);
+
+ // Return whether a double buffer is available.
+ abstract boolean hasDoubleBuffer(Canvas3D c3d);
+
+ // Return whether scene antialiasing is available.
+ abstract boolean hasSceneAntialiasingAccum(Canvas3D c3d);
+
+
+ // Return whether scene antialiasing is available.
+ abstract boolean hasSceneAntialiasingMultisample(Canvas3D c3d);
+
+ // Ensure that the native libraries are loaded
+ static {
+ VirtualUniverse.loadLibraries();
+ }
+}
diff --git a/src/classes/share/javax/media/j3d/NativePipeline.java b/src/classes/share/javax/media/j3d/NativePipeline.java
index d8341df..0ac3b73 100644
--- a/src/classes/share/javax/media/j3d/NativePipeline.java
+++ b/src/classes/share/javax/media/j3d/NativePipeline.java
@@ -43,13 +43,6 @@ class NativePipeline extends Pipeline {
private boolean cgLibraryAvailable = false;
private boolean glslLibraryAvailable = false;
- /**
- * The platform dependent template. Since there is no
- * template-specific instance data in the NativeConfigTemplate3D
- * class, we can create one statically.
- */
- private static NativeConfigTemplate3D nativeTemplate = new NativeConfigTemplate3D();
-
// Flag indicating that the ogl-chk library has been loaded
private static boolean oglChkLibraryLoaded = false;
@@ -86,7 +79,7 @@ class NativePipeline extends Pipeline {
*/
void initialize(Pipeline.Type pipelineType) {
super.initialize(pipelineType);
-
+
// This works around a native load library bug
try {
java.awt.Toolkit toolkit = java.awt.Toolkit.getDefaultToolkit();
@@ -106,6 +99,11 @@ class NativePipeline extends Pipeline {
default:
assert false; // Should never get here
}
+
+ // Create the singleton, OS-dependent NativeConfigTemplate3D and
+ // NativeScreenInfo objects.
+ NativeConfigTemplate3D.createNativeConfigTemplate3D();
+ NativeScreenInfo.createNativeScreenInfo();
}
/**
@@ -3263,42 +3261,42 @@ class NativePipeline extends Pipeline {
// Get best graphics config from pipeline
GraphicsConfiguration getBestConfiguration(GraphicsConfigTemplate3D gct,
GraphicsConfiguration[] gc) {
- return nativeTemplate.getBestConfiguration(gct, gc);
+ return NativeConfigTemplate3D.getNativeConfigTemplate3D().getBestConfiguration(gct, gc);
}
// Determine whether specified graphics config is supported by pipeline
boolean isGraphicsConfigSupported(GraphicsConfigTemplate3D gct,
GraphicsConfiguration gc) {
- return nativeTemplate.isGraphicsConfigSupported(gct, gc);
+ return NativeConfigTemplate3D.getNativeConfigTemplate3D().isGraphicsConfigSupported(gct, gc);
}
// Methods to get actual capabilities from Canvas3D
boolean hasDoubleBuffer(Canvas3D cv) {
- return nativeTemplate.hasDoubleBuffer(cv);
+ return NativeConfigTemplate3D.getNativeConfigTemplate3D().hasDoubleBuffer(cv);
}
boolean hasStereo(Canvas3D cv) {
- return nativeTemplate.hasStereo(cv);
+ return NativeConfigTemplate3D.getNativeConfigTemplate3D().hasStereo(cv);
}
int getStencilSize(Canvas3D cv) {
- return nativeTemplate.getStencilSize(cv);
+ return NativeConfigTemplate3D.getNativeConfigTemplate3D().getStencilSize(cv);
}
boolean hasSceneAntialiasingMultisample(Canvas3D cv) {
- return nativeTemplate.hasSceneAntialiasingMultisample(cv);
+ return NativeConfigTemplate3D.getNativeConfigTemplate3D().hasSceneAntialiasingMultisample(cv);
}
boolean hasSceneAntialiasingAccum(Canvas3D cv) {
- return nativeTemplate.hasSceneAntialiasingAccum(cv);
+ return NativeConfigTemplate3D.getNativeConfigTemplate3D().hasSceneAntialiasingAccum(cv);
}
// Methods to get native WS display and screen
long getDisplay() {
- return NativeScreenInfo.getDisplay();
+ return NativeScreenInfo.getNativeScreenInfo().getDisplay();
}
int getScreen(GraphicsDevice graphicsDevice) {
- return NativeScreenInfo.getScreen(graphicsDevice);
+ return NativeScreenInfo.getNativeScreenInfo().getScreen(graphicsDevice);
}
// ---------------------------------------------------------------------
diff --git a/src/classes/share/javax/media/j3d/NativeScreenInfo.java b/src/classes/share/javax/media/j3d/NativeScreenInfo.java
new file mode 100644
index 0000000..94502f4
--- /dev/null
+++ b/src/classes/share/javax/media/j3d/NativeScreenInfo.java
@@ -0,0 +1,69 @@
+/*
+ * $RCSfile$
+ *
+ * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
+ *
+ * Use is subject to license terms.
+ *
+ * $Revision$
+ * $Date$
+ * $State$
+ */
+
+package javax.media.j3d;
+
+import java.awt.GraphicsDevice;
+
+/**
+ * Native screen info class. A singleton instance of the appropriate
+ * concrete subclass is created by a factory method using reflection.
+ */
+abstract class NativeScreenInfo {
+ private static final String x11ClassName = "javax.media.j3d.X11NativeScreenInfo";
+ private static final String win32ClassName = "javax.media.j3d.Win32NativeScreenInfo";
+
+ // The singleton instance of this class
+ private static NativeScreenInfo nativeScreenInfo = null;
+
+ protected NativeScreenInfo() {
+ }
+
+ // This method is called exactly once by the initialization method of
+ // the NativePipeline class
+ synchronized static void createNativeScreenInfo() {
+ String className;
+ if (MasterControl.isWindows()) {
+ className = win32ClassName;
+ } else {
+ className = x11ClassName;
+ }
+
+ final String scrInfoClassName = className;
+ nativeScreenInfo = (NativeScreenInfo)
+ java.security.AccessController.doPrivileged(new
+ java.security.PrivilegedAction() {
+ public Object run() {
+ try {
+ Class scrInfoClass = Class.forName(scrInfoClassName);
+ return scrInfoClass.newInstance();
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+ });
+ }
+
+ static NativeScreenInfo getNativeScreenInfo() {
+ return nativeScreenInfo;
+ }
+
+ /**
+ * Get the display handle
+ */
+ abstract long getDisplay();
+
+ /**
+ * Get the screen number for the given graphics device
+ */
+ abstract int getScreen(GraphicsDevice graphicsDevice);
+}
diff --git a/src/classes/win32/javax/media/j3d/NativeConfigTemplate3D.java b/src/classes/win32/javax/media/j3d/Win32NativeConfigTemplate3D.java
index f91986a..10edfd1 100644
--- a/src/classes/win32/javax/media/j3d/NativeConfigTemplate3D.java
+++ b/src/classes/win32/javax/media/j3d/Win32NativeConfigTemplate3D.java
@@ -18,25 +18,16 @@ import sun.awt.Win32GraphicsDevice;
import sun.awt.Win32GraphicsConfig;
import java.awt.GraphicsConfigTemplate;
-class NativeConfigTemplate3D {
+/**
+ * Native config template class. A singleton instance of this class is
+ * created by a factory method in the base class using reflection.
+ */
+class Win32NativeConfigTemplate3D extends NativeConfigTemplate3D {
private final static boolean debug = false;
- NativeConfigTemplate3D() {
+ Win32NativeConfigTemplate3D() {
}
- // This definition should match those in solaris NativeConfigTemplate3D.java
- final static int RED_SIZE = 0;
- final static int GREEN_SIZE = 1;
- final static int BLUE_SIZE = 2;
- final static int ALPHA_SIZE = 3;
- final static int ACCUM_BUFFER = 4;
- final static int DEPTH_SIZE = 5;
- final static int DOUBLEBUFFER = 6;
- final static int STEREO = 7;
- final static int ANTIALIASING = 8;
- final static int STENCIL_SIZE = 9;
- final static int NUM_ITEMS = 10;
-
/**
* selects the proper visual
*/
@@ -45,7 +36,7 @@ class NativeConfigTemplate3D {
// Native method to free an PixelFormatInfo struct. This is static since it
// may need to be called to clean up the Canvas3D graphicsConfigTable after the
- // NativeConfigTemplate3D has been disposed of.
+ // Win32NativeConfigTemplate3D has been disposed of.
static native void freePixelFormatInfo(long pFormatInfo);
// Native methods to return whether a particular attribute is available
@@ -58,6 +49,7 @@ class NativeConfigTemplate3D {
/**
* Chooses the best PixelFormat for Java 3D apps.
*/
+ @Override
GraphicsConfiguration
getBestConfiguration(GraphicsConfigTemplate3D template,
GraphicsConfiguration[] gc) {
@@ -69,7 +61,7 @@ class NativeConfigTemplate3D {
do so in J3D 1.4.
System.out.println("getBestConfiguration : Checking WGL ARB support\n");
- if (!NativeScreenInfo.isWglARB()) {
+ if (!Win32NativeScreenInfo.isWglARB()) {
Thread.dumpStack();
System.out.println("getBestConfiguration : WGL ARB support fail\n");
return null;
@@ -89,10 +81,10 @@ class NativeConfigTemplate3D {
attrList[STEREO] = template.getStereo();
attrList[ANTIALIASING] = template.getSceneAntialiasing();
attrList[STENCIL_SIZE] = template.getStencilSize();
- // System.out.println("NativeConfigTemplate3D : getStencilSize " +
+ // System.out.println("Win32NativeConfigTemplate3D : getStencilSize " +
// attrList[STENCIL_SIZE]);
- int screen = NativeScreenInfo.getScreen(gd);
+ int screen = NativeScreenInfo.getNativeScreenInfo().getScreen(gd);
long[] pFormatInfo = new long[1];
@@ -139,6 +131,7 @@ class NativeConfigTemplate3D {
* Determine if a given GraphicsConfiguration object can be used
* by Java 3D.
*/
+ @Override
boolean isGraphicsConfigSupported(GraphicsConfigTemplate3D template,
GraphicsConfiguration gc) {
@@ -149,7 +142,7 @@ class NativeConfigTemplate3D {
do so in J3D 1.4.
System.out.println("isGraphicsConfigSupported : Checking WGL ARB support\n");
- if (!NativeScreenInfo.isWglARB()) {
+ if (!Win32NativeScreenInfo.isWglARB()) {
Thread.dumpStack();
System.out.println("isGraphicsConfigSupported : WGL ARB support fail\n");
return false;
@@ -169,10 +162,10 @@ class NativeConfigTemplate3D {
attrList[STEREO] = template.getStereo();
attrList[ANTIALIASING] = template.getSceneAntialiasing();
attrList[STENCIL_SIZE] = template.getStencilSize();
- // System.out.println("NativeConfigTemplate3D : getStencilSize " +
+ // System.out.println("Win32NativeConfigTemplate3D : getStencilSize " +
// attrList[STENCIL_SIZE]);
- int screen = NativeScreenInfo.getScreen(gd);
+ int screen = NativeScreenInfo.getNativeScreenInfo().getScreen(gd);
long[] pFormatInfo = new long[1];
@@ -192,32 +185,37 @@ class NativeConfigTemplate3D {
// Return whether stereo is available.
+ @Override
boolean hasStereo(Canvas3D c3d) {
return isStereoAvailable(c3d.fbConfig, c3d.offScreen);
}
// Return the stencil of this canvas.
+ @Override
int getStencilSize(Canvas3D c3d) {
return getStencilSize(c3d.fbConfig, c3d.offScreen);
}
// Return whether a double buffer is available.
+ @Override
boolean hasDoubleBuffer(Canvas3D c3d) {
return isDoubleBufferAvailable(c3d.fbConfig, c3d.offScreen);
}
// Return whether scene antialiasing is available.
+ @Override
boolean hasSceneAntialiasingAccum(Canvas3D c3d) {
return isSceneAntialiasingAccumAvailable(c3d.fbConfig, c3d.offScreen);
}
// Return whether scene antialiasing is available.
+ @Override
boolean hasSceneAntialiasingMultisample(Canvas3D c3d) {
GraphicsConfiguration gc = c3d.graphicsConfiguration;
Win32GraphicsDevice gd =
(Win32GraphicsDevice)((Win32GraphicsConfig)gc).getDevice();
- int screen = NativeScreenInfo.getScreen(gd);
+ int screen = NativeScreenInfo.getNativeScreenInfo().getScreen(gd);
/* Fix to issue 77 */
return isSceneAntialiasingMultisampleAvailable(c3d.fbConfig, c3d.offScreen, screen);
}
diff --git a/src/classes/win32/javax/media/j3d/NativeScreenInfo.java b/src/classes/win32/javax/media/j3d/Win32NativeScreenInfo.java
index 61066b9..0a6a105 100644
--- a/src/classes/win32/javax/media/j3d/NativeScreenInfo.java
+++ b/src/classes/win32/javax/media/j3d/Win32NativeScreenInfo.java
@@ -15,7 +15,11 @@ package javax.media.j3d;
import java.awt.GraphicsDevice;
import sun.awt.Win32GraphicsDevice;
-class NativeScreenInfo {
+/**
+ * Native screen info class. A singleton instance of this class is created by
+ * a factory method in the base class using reflection.
+ */
+class Win32NativeScreenInfo extends NativeScreenInfo {
private static final long display = 0; // unused for Win32
private static boolean wglARBChecked = false;
@@ -23,8 +27,7 @@ class NativeScreenInfo {
private static native boolean queryWglARB();
- private NativeScreenInfo() {
- throw new AssertionError("constructor should never be called");
+ Win32NativeScreenInfo() {
}
// This method will return true if wglGetExtensionsStringARB is supported,
@@ -39,16 +42,18 @@ class NativeScreenInfo {
return isWglARB;
}
- static long getDisplay() {
+ @Override
+ long getDisplay() {
return display;
}
- static int getScreen(GraphicsDevice graphicsDevice) {
+ @Override
+ int getScreen(GraphicsDevice graphicsDevice) {
return ((Win32GraphicsDevice)graphicsDevice).getScreen();
}
// Ensure that the native libraries are loaded
static {
- VirtualUniverse.loadLibraries();
+ VirtualUniverse.loadLibraries();
}
}
diff --git a/src/classes/x11/javax/media/j3d/NativeConfigTemplate3D.java b/src/classes/x11/javax/media/j3d/X11NativeConfigTemplate3D.java
index d1d2000..8a46d3b 100644
--- a/src/classes/x11/javax/media/j3d/NativeConfigTemplate3D.java
+++ b/src/classes/x11/javax/media/j3d/X11NativeConfigTemplate3D.java
@@ -19,25 +19,16 @@ import java.awt.Rectangle;
import sun.awt.X11GraphicsDevice;
import sun.awt.X11GraphicsConfig;
-class NativeConfigTemplate3D {
+/**
+ * Native config template class. A singleton instance of this class is
+ * created by a factory method in the base class using reflection.
+ */
+class X11NativeConfigTemplate3D extends NativeConfigTemplate3D {
private final static boolean debug = false;
- NativeConfigTemplate3D() {
+ X11NativeConfigTemplate3D() {
}
- // These definitions should match those in win32 NativeConfigTemplate3D.java
- final static int RED_SIZE = 0;
- final static int GREEN_SIZE = 1;
- final static int BLUE_SIZE = 2;
- final static int ALPHA_SIZE = 3;
- final static int ACCUM_BUFFER = 4;
- final static int DEPTH_SIZE = 5;
- final static int DOUBLEBUFFER = 6;
- final static int STEREO = 7;
- final static int ANTIALIASING = 8;
- final static int STENCIL_SIZE = 9;
- final static int NUM_ITEMS = 10;
-
// Native method to get an OpenGL visual id and a pointer to the
// GLXFBConfig structure list itself.
native int chooseOglVisual(long display, int screen,
@@ -45,7 +36,7 @@ class NativeConfigTemplate3D {
// Native method to free an GLXFBConfig struct. This is static since it
// may need to be called to clean up the Canvas3D graphicsConfigTable
- // after the NativeConfigTemplate3D has been disposed of.
+ // after the X11NativeConfigTemplate3D has been disposed of.
static native void freeFBConfig(long fbConfig);
// Native methods to return whether a particular attribute is available
@@ -58,21 +49,22 @@ class NativeConfigTemplate3D {
/*
* Chooses the best FBConfig for Java 3D apps.
*/
+ @Override
GraphicsConfiguration getBestConfiguration(GraphicsConfigTemplate3D template,
GraphicsConfiguration[] gc) {
X11GraphicsDevice gd =
(X11GraphicsDevice)((X11GraphicsConfig)gc[0]).getDevice();
- if (!NativeScreenInfo.isGLX13()) {
+ if (!X11NativeScreenInfo.isGLX13()) {
return null;
}
- long display = NativeScreenInfo.getDisplay();
- int screen = NativeScreenInfo.getScreen(gd);
+ long display = NativeScreenInfo.getNativeScreenInfo().getDisplay();
+ int screen = NativeScreenInfo.getNativeScreenInfo().getScreen(gd);
if (debug) {
- System.out.println(" NativeConfigTemplate3D: using device " + gd);
+ System.out.println(" X11NativeConfigTemplate3D: using device " + gd);
System.out.println(" display " + display + " screen " + screen);
System.out.println(" configuration count: " + gc.length);
for (int i = 0 ; i < gc.length ; i++) {
@@ -109,7 +101,7 @@ class NativeConfigTemplate3D {
attrList[STEREO] = template.getStereo();
attrList[ANTIALIASING] = template.getSceneAntialiasing();
attrList[STENCIL_SIZE] = template.getStencilSize();
- // System.out.println("NativeConfigTemplate3D : getStencilSize " +
+ // System.out.println("X11NativeConfigTemplate3D : getStencilSize " +
// attrList[STENCIL_SIZE]);
long[] fbConfig = new long[1];
@@ -162,18 +154,19 @@ class NativeConfigTemplate3D {
* Determine if a given GraphicsConfiguration object can be used
* by Java 3D.
*/
+ @Override
boolean isGraphicsConfigSupported(GraphicsConfigTemplate3D template,
GraphicsConfiguration gc) {
X11GraphicsDevice gd =
(X11GraphicsDevice)((X11GraphicsConfig)gc).getDevice();
- if (!NativeScreenInfo.isGLX13()) {
+ if (!X11NativeScreenInfo.isGLX13()) {
return false;
}
- long display = NativeScreenInfo.getDisplay();
- int screen = NativeScreenInfo.getScreen(gd);
+ long display = NativeScreenInfo.getNativeScreenInfo().getDisplay();
+ int screen = NativeScreenInfo.getNativeScreenInfo().getScreen(gd);
int[] attrList; // holds the list of attributes to be tramslated
// for glxChooseVisual call
@@ -190,7 +183,7 @@ class NativeConfigTemplate3D {
attrList[STEREO] = template.getStereo();
attrList[ANTIALIASING] = template.getSceneAntialiasing();
attrList[STENCIL_SIZE] = template.getStencilSize();
- // System.out.println("NativeConfigTemplate3D : getStencilSize " +
+ // System.out.println("X11NativeConfigTemplate3D : getStencilSize " +
// attrList[STENCIL_SIZE]);
long[] fbConfig = new long[1];
@@ -204,56 +197,60 @@ class NativeConfigTemplate3D {
// Return whether stereo is available.
+ @Override
boolean hasStereo(Canvas3D c3d) {
GraphicsConfiguration gc = c3d.graphicsConfiguration;
X11GraphicsDevice gd =
(X11GraphicsDevice)((X11GraphicsConfig)gc).getDevice();
- long display = NativeScreenInfo.getDisplay();
- int screen = NativeScreenInfo.getScreen(gd);
+ long display = NativeScreenInfo.getNativeScreenInfo().getDisplay();
+ int screen = NativeScreenInfo.getNativeScreenInfo().getScreen(gd);
int vid = ((X11GraphicsConfig)gc).getVisual();
return isStereoAvailable(display, screen, vid);
}
// Return the stencil of this canvas.
+ @Override
int getStencilSize(Canvas3D c3d) {
GraphicsConfiguration gc = c3d.graphicsConfiguration;
X11GraphicsDevice gd =
(X11GraphicsDevice)((X11GraphicsConfig)gc).getDevice();
- long display = NativeScreenInfo.getDisplay();
- int screen = NativeScreenInfo.getScreen(gd);
+ long display = NativeScreenInfo.getNativeScreenInfo().getDisplay();
+ int screen = NativeScreenInfo.getNativeScreenInfo().getScreen(gd);
int vid = ((X11GraphicsConfig)gc).getVisual();
return getStencilSize(display, screen, vid);
}
// Return whether a double buffer is available.
+ @Override
boolean hasDoubleBuffer(Canvas3D c3d) {
GraphicsConfiguration gc = c3d.graphicsConfiguration;
X11GraphicsDevice gd =
(X11GraphicsDevice)((X11GraphicsConfig)gc).getDevice();
- long display = NativeScreenInfo.getDisplay();
- int screen = NativeScreenInfo.getScreen(gd);
+ long display = NativeScreenInfo.getNativeScreenInfo().getDisplay();
+ int screen = NativeScreenInfo.getNativeScreenInfo().getScreen(gd);
int vid = ((X11GraphicsConfig)gc).getVisual();
return isDoubleBufferAvailable(display, screen, vid);
}
// Return whether scene antialiasing is available.
+ @Override
boolean hasSceneAntialiasingAccum(Canvas3D c3d) {
GraphicsConfiguration gc = c3d.graphicsConfiguration;
X11GraphicsDevice gd =
(X11GraphicsDevice)((X11GraphicsConfig)gc).getDevice();
- long display = NativeScreenInfo.getDisplay();
- int screen = NativeScreenInfo.getScreen(gd);
+ long display = NativeScreenInfo.getNativeScreenInfo().getDisplay();
+ int screen = NativeScreenInfo.getNativeScreenInfo().getScreen(gd);
int vid = ((X11GraphicsConfig)gc).getVisual();
return isSceneAntialiasingAccumAvailable(display, screen, vid);
@@ -261,14 +258,15 @@ class NativeConfigTemplate3D {
// Return whether scene antialiasing is available.
+ @Override
boolean hasSceneAntialiasingMultisample(Canvas3D c3d) {
GraphicsConfiguration gc = c3d.graphicsConfiguration;
X11GraphicsDevice gd =
(X11GraphicsDevice)((X11GraphicsConfig)gc).getDevice();
- long display = NativeScreenInfo.getDisplay();
- int screen = NativeScreenInfo.getScreen(gd);
+ long display = NativeScreenInfo.getNativeScreenInfo().getDisplay();
+ int screen = NativeScreenInfo.getNativeScreenInfo().getScreen(gd);
int vid = ((X11GraphicsConfig)gc).getVisual();
return isSceneAntialiasingMultisampleAvailable(display, screen, vid);
diff --git a/src/classes/x11/javax/media/j3d/NativeScreenInfo.java b/src/classes/x11/javax/media/j3d/X11NativeScreenInfo.java
index c352467..bb19002 100644
--- a/src/classes/x11/javax/media/j3d/NativeScreenInfo.java
+++ b/src/classes/x11/javax/media/j3d/X11NativeScreenInfo.java
@@ -15,7 +15,11 @@ package javax.media.j3d;
import java.awt.GraphicsDevice;
import sun.awt.X11GraphicsDevice;
-class NativeScreenInfo {
+/**
+ * Native screen info class. A singleton instance of this class is created by
+ * a factory method in the base class using reflection.
+ */
+class X11NativeScreenInfo extends NativeScreenInfo {
private static long display = 0;
private static boolean glxChecked = false;
private static boolean isGLX13;
@@ -23,8 +27,7 @@ class NativeScreenInfo {
private static native long openDisplay();
private static native boolean queryGLX13(long display);
- private NativeScreenInfo() {
- throw new AssertionError("constructor should never be called");
+ X11NativeScreenInfo() {
}
// Fix for issue 20.
@@ -36,7 +39,7 @@ class NativeScreenInfo {
getStaticDisplay();
// Query for glx1.3 support.
- isGLX13 = queryGLX13(getDisplay());
+ isGLX13 = queryGLX13(getStaticDisplay());
glxChecked = true;
}
@@ -50,18 +53,20 @@ class NativeScreenInfo {
return display;
}
- static long getDisplay() {
+ @Override
+ long getDisplay() {
// Open a new static display connection if one is not already opened
return getStaticDisplay();
}
- static int getScreen(GraphicsDevice graphicsDevice) {
+ @Override
+ int getScreen(GraphicsDevice graphicsDevice) {
// Get the screen number
return ((X11GraphicsDevice)graphicsDevice).getScreen();
}
// Ensure that the native libraries are loaded
static {
- VirtualUniverse.loadLibraries();
+ VirtualUniverse.loadLibraries();
}
}
diff --git a/src/native/build.xml b/src/native/build.xml
index c819ac5..76f0d25 100644
--- a/src/native/build.xml
+++ b/src/native/build.xml
@@ -20,37 +20,51 @@
<target name="nativeSetup-debug-solaris" if="isSolarisOnSparc">
<property name="bldFlag" value="-g -DDEBUG"/>
<property name="coreLibDependency" value="lib/sparc/libj3dcore-ogl.so"/>
+ <property name="osNativeConfigTemplate3D" value="X11NativeConfigTemplate3D"/>
+ <property name="osNativeScreenInfo" value="X11NativeScreenInfo"/>
</target>
<target name="nativeSetup-debug-solaris-x86" if="isSolarisOnX86">
<property name="bldFlag" value="-g -DDEBUG"/>
<property name="coreLibDependency" value="lib/i386/libj3dcore-ogl.so"/>
+ <property name="osNativeConfigTemplate3D" value="X11NativeConfigTemplate3D"/>
+ <property name="osNativeScreenInfo" value="X11NativeScreenInfo"/>
</target>
<target name="nativeSetup-debug-linux" if="isLinuxOnX86">
<property name="bldFlag" value="-g -DDEBUG"/>
<property name="coreLibDependency" value="lib/i386/libj3dcore-ogl.so"/>
+ <property name="osNativeConfigTemplate3D" value="X11NativeConfigTemplate3D"/>
+ <property name="osNativeScreenInfo" value="X11NativeScreenInfo"/>
</target>
<target name="nativeSetup-debug-linux-amd64" if="isLinuxOnAmd64">
<property name="bldFlag" value="-g -DDEBUG -fPIC -march=k8 -msse2 -mfpmath=sse"/>
<property name="coreLibDependency" value="lib/amd64/libj3dcore-ogl.so"/>
+ <property name="osNativeConfigTemplate3D" value="X11NativeConfigTemplate3D"/>
+ <property name="osNativeScreenInfo" value="X11NativeScreenInfo"/>
</target>
<target name="nativeSetup-debug-linux-ia64" if="isLinuxOnIA64">
<property name="bldFlag" value="-g -DDEBUG"/>
<property name="coreLibDependency" value="lib/ia64/libj3dcore-ogl.so"/>
+ <property name="osNativeConfigTemplate3D" value="X11NativeConfigTemplate3D"/>
+ <property name="osNativeScreenInfo" value="X11NativeScreenInfo"/>
</target>
<target name="nativeSetup-debug-linux-ppc" if="isLinuxOnPPC">
<property name="bldFlag" value="-g -DDEBUG"/>
<property name="coreLibDependency" value="lib/ppc/libj3dcore-ogl.so"/>
+ <property name="osNativeConfigTemplate3D" value="X11NativeConfigTemplate3D"/>
+ <property name="osNativeScreenInfo" value="X11NativeScreenInfo"/>
</target>
<target name="nativeSetup-debug-win32" if="isWindowsOnX86">
<property name="bldFlag"
value="-DDEBUG -DWIN32 -D_WINDOWS"/>
<property name="coreLibDependency" value="bin/j3dcore-${build.rend}.dll"/>
+ <property name="osNativeConfigTemplate3D" value="Win32NativeConfigTemplate3D"/>
+ <property name="osNativeScreenInfo" value="Win32NativeScreenInfo"/>
</target>
@@ -58,6 +72,8 @@
<property name="bldFlag"
value="-DDEBUG -DWIN32 -D_WINDOWS"/>
<property name="coreLibDependency" value="bin/j3dcore-${build.rend}.dll"/>
+ <property name="osNativeConfigTemplate3D" value="Win32NativeConfigTemplate3D"/>
+ <property name="osNativeScreenInfo" value="Win32NativeScreenInfo"/>
</target>
<target name="nativeSetup-debug" depends="nativeSetup-debug-solaris, nativeSetup-debug-solaris-x86, nativeSetup-debug-linux, nativeSetup-debug-linux-amd64, nativeSetup-debug-linux-ia64, nativeSetup-debug-linux-ppc, nativeSetup-debug-win32, nativeSetup-debug-winamd64">
@@ -71,43 +87,59 @@
<target name="nativeSetup-opt-solaris" if="isSolarisOnSparc">
<property name="bldFlag" value="-O"/>
<property name="coreLibDependency" value="lib/sparc/libj3dcore-ogl.so"/>
+ <property name="osNativeConfigTemplate3D" value="X11NativeConfigTemplate3D"/>
+ <property name="osNativeScreenInfo" value="X11NativeScreenInfo"/>
</target>
<target name="nativeSetup-opt-solaris-x86" if="isSolarisOnX86">
<property name="bldFlag" value="-O"/>
<property name="coreLibDependency" value="lib/i386/libj3dcore-ogl.so"/>
+ <property name="osNativeConfigTemplate3D" value="X11NativeConfigTemplate3D"/>
+ <property name="osNativeScreenInfo" value="X11NativeScreenInfo"/>
</target>
<target name="nativeSetup-opt-linux" if="isLinuxOnX86">
<property name="bldFlag" value="-O"/>
<property name="coreLibDependency" value="lib/i386/libj3dcore-ogl.so"/>
+ <property name="osNativeConfigTemplate3D" value="X11NativeConfigTemplate3D"/>
+ <property name="osNativeScreenInfo" value="X11NativeScreenInfo"/>
</target>
<target name="nativeSetup-opt-linux-amd64" if="isLinuxOnAmd64">
<property name="bldFlag" value="-O -fPIC -march=k8 -msse2 -mfpmath=sse"/>
<property name="coreLibDependency" value="lib/amd64/libj3dcore-ogl.so"/>
+ <property name="osNativeConfigTemplate3D" value="X11NativeConfigTemplate3D"/>
+ <property name="osNativeScreenInfo" value="X11NativeScreenInfo"/>
</target>
<target name="nativeSetup-opt-linux-ia64" if="isLinuxOnIA64">
<property name="bldFlag" value="-O"/>
<property name="coreLibDependency" value="lib/ia64/libj3dcore-ogl.so"/>
+ <property name="osNativeConfigTemplate3D" value="X11NativeConfigTemplate3D"/>
+ <property name="osNativeScreenInfo" value="X11NativeScreenInfo"/>
</target>
<target name="nativeSetup-opt-linux-ppc" if="isLinuxOnPPC">
<property name="bldFlag" value="-O"/>
<property name="coreLibDependency" value="lib/ppc/libj3dcore-ogl.so"/>
+ <property name="osNativeConfigTemplate3D" value="X11NativeConfigTemplate3D"/>
+ <property name="osNativeScreenInfo" value="X11NativeScreenInfo"/>
</target>
<target name="nativeSetup-opt-win32" if="isWindowsOnX86">
<property name="bldFlag"
value="-DWIN32 -D_WINDOWS"/>
<property name="coreLibDependency" value="bin/j3dcore-${build.rend}.dll"/>
+ <property name="osNativeConfigTemplate3D" value="Win32NativeConfigTemplate3D"/>
+ <property name="osNativeScreenInfo" value="Win32NativeScreenInfo"/>
</target>
<target name="nativeSetup-opt-winamd64" if="isWindowsOnAmd64">
<property name="bldFlag"
value="-DWIN32 -D_WINDOWS"/>
<property name="coreLibDependency" value="bin/j3dcore-${build.rend}.dll"/>
+ <property name="osNativeConfigTemplate3D" value="Win32NativeConfigTemplate3D"/>
+ <property name="osNativeScreenInfo" value="Win32NativeScreenInfo"/>
</target>
<target name="nativeSetup-opt" depends="nativeSetup-opt-solaris, nativeSetup-opt-solaris-x86, nativeSetup-opt-linux, nativeSetup-opt-linux-amd64, nativeSetup-opt-linux-ia64, nativeSetup-opt-linux-ppc, nativeSetup-opt-win32, nativeSetup-opt-winamd64">
@@ -202,8 +234,14 @@
srcfile="${javahCoreSrc}/NativePipeline.java"
targetfile="${javahCoreTarget}/javax_media_j3d_NativePipeline.h"/>
<uptodate
- srcfile="${src}/classes/${wstype}/javax/media/j3d/NativeConfigTemplate3D.java"
+ srcfile="${javahCoreSrc}/NativeConfigTemplate3D.java"
targetfile="${javahCoreTarget}/javax_media_j3d_NativeConfigTemplate3D.h"/>
+ <uptodate
+ srcfile="${src}/classes/${wstype}/javax/media/j3d/${osNativeConfigTemplate3D}.java"
+ targetfile="${javahCoreTarget}/javax_media_j3d_${osNativeConfigTemplate3D}.h"/>
+ <uptodate
+ srcfile="${src}/classes/${wstype}/javax/media/j3d/${osNativeScreenInfo}.java"
+ targetfile="${javahCoreTarget}/javax_media_j3d_${osNativeScreenInfo}.h"/>
<uptodate
srcfile="${javahCoreSrc}/NodeRetained.java"
targetfile="${javahCoreTarget}/javax_media_j3d_NodeRetained.h"/>
@@ -352,6 +390,8 @@
<class name="javax.media.j3d.ModelClipRetained"/>
<class name="javax.media.j3d.NativePipeline"/>
<class name="javax.media.j3d.NativeConfigTemplate3D"/>
+ <class name="javax.media.j3d.${osNativeConfigTemplate3D}"/>
+ <class name="javax.media.j3d.${osNativeScreenInfo}"/>
<class name="javax.media.j3d.NodeRetained"/>
<class name="javax.media.j3d.PointAttributesRetained"/>
<class name="javax.media.j3d.PointLightRetained"/>
diff --git a/src/native/d3d/NativeConfigTemplate3D.cpp b/src/native/d3d/NativeConfigTemplate3D.cpp
index b3851d2..230c35e 100644
--- a/src/native/d3d/NativeConfigTemplate3D.cpp
+++ b/src/native/d3d/NativeConfigTemplate3D.cpp
@@ -14,7 +14,7 @@
extern "C" JNIEXPORT
-jboolean JNICALL Java_javax_media_j3d_NativeConfigTemplate3D_isStereoAvailable(
+jboolean JNICALL Java_javax_media_j3d_Win32NativeConfigTemplate3D_isStereoAvailable(
JNIEnv *env,
jobject obj,
jlong pFormatInfo,
@@ -26,7 +26,7 @@ jboolean JNICALL Java_javax_media_j3d_NativeConfigTemplate3D_isStereoAvailable(
}
extern "C" JNIEXPORT
-jboolean JNICALL Java_javax_media_j3d_NativeConfigTemplate3D_isDoubleBufferAvailable(
+jboolean JNICALL Java_javax_media_j3d_Win32NativeConfigTemplate3D_isDoubleBufferAvailable(
JNIEnv *env,
jobject obj,
jlong pFormatInfo,
@@ -37,7 +37,7 @@ jboolean JNICALL Java_javax_media_j3d_NativeConfigTemplate3D_isDoubleBufferAvail
}
extern "C" JNIEXPORT
-jboolean JNICALL Java_javax_media_j3d_NativeConfigTemplate3D_isSceneAntialiasingMultisampleAvailable(
+jboolean JNICALL Java_javax_media_j3d_Win32NativeConfigTemplate3D_isSceneAntialiasingMultisampleAvailable(
JNIEnv *env,
jobject obj,
jlong pFormatInfo,
@@ -70,7 +70,7 @@ jboolean JNICALL Java_javax_media_j3d_NativeConfigTemplate3D_isSceneAntialiasing
return antialiasingSupport;
}
extern "C" JNIEXPORT
-jboolean JNICALL Java_javax_media_j3d_NativeConfigTemplate3D_isSceneAntialiasingAccumAvailable(JNIEnv *env,
+jboolean JNICALL Java_javax_media_j3d_Win32NativeConfigTemplate3D_isSceneAntialiasingAccumAvailable(JNIEnv *env,
jobject obj,
jlong pFormatInfo,
jboolean offScreen)
@@ -81,7 +81,7 @@ jboolean JNICALL Java_javax_media_j3d_NativeConfigTemplate3D_isSceneAntialiasing
extern "C" JNIEXPORT
-jint JNICALL Java_javax_media_j3d_NativeConfigTemplate3D_choosePixelFormat(
+jint JNICALL Java_javax_media_j3d_Win32NativeConfigTemplate3D_choosePixelFormat(
JNIEnv *env,
jobject obj,
jlong ctx,
@@ -141,7 +141,7 @@ jint JNICALL Java_javax_media_j3d_NativeConfigTemplate3D_choosePixelFormat(
if (mx_ptr[ANTIALIASING] == REQUIRED)
{
- if (Java_javax_media_j3d_NativeConfigTemplate3D_isSceneAntialiasingMultisampleAvailable(env, obj, 0, JNI_TRUE, screen) == JNI_TRUE)
+ if (Java_javax_media_j3d_Win32NativeConfigTemplate3D_isSceneAntialiasingMultisampleAvailable(env, obj, 0, JNI_TRUE, screen) == JNI_TRUE)
{
retValue |= (1 << 31);
}
@@ -156,11 +156,11 @@ jint JNICALL Java_javax_media_j3d_NativeConfigTemplate3D_choosePixelFormat(
/*
- * Class: javax_media_j3d_NativeConfigTemplate3D
+ * Class: javax_media_j3d_Win32NativeConfigTemplate3D
* Method: getStencilSize
* Signature: (JZ)I *
*/
-JNIEXPORT jint JNICALL Java_javax_media_j3d_NativeConfigTemplate3D_getStencilSize
+JNIEXPORT jint JNICALL Java_javax_media_j3d_Win32NativeConfigTemplate3D_getStencilSize
(JNIEnv *env, jobject obj, jlong pFormatInfo, jboolean offScreen)
{
jlong stencilSize = pFormatInfo;
diff --git a/src/native/ogl/NativeConfigTemplate3D.c b/src/native/ogl/NativeConfigTemplate3D.c
index bae85db..4e1313d 100644
--- a/src/native/ogl/NativeConfigTemplate3D.c
+++ b/src/native/ogl/NativeConfigTemplate3D.c
@@ -335,7 +335,7 @@ GLXFBConfig *find_DB_AA_S_S_FBConfigs(jlong display,
* combinations in hopes of finding an valid visual.
*/
JNIEXPORT
-jint JNICALL Java_javax_media_j3d_NativeConfigTemplate3D_chooseOglVisual(
+jint JNICALL Java_javax_media_j3d_X11NativeConfigTemplate3D_chooseOglVisual(
JNIEnv *env,
jobject obj,
jlong display,
@@ -464,7 +464,7 @@ jint JNICALL Java_javax_media_j3d_NativeConfigTemplate3D_chooseOglVisual(
JNIEXPORT
-void JNICALL Java_javax_media_j3d_NativeConfigTemplate3D_freeFBConfig(
+void JNICALL Java_javax_media_j3d_X11NativeConfigTemplate3D_freeFBConfig(
JNIEnv *env,
jclass class, /* this is a static native method */
jlong fbConfigListPtr)
@@ -475,7 +475,7 @@ void JNICALL Java_javax_media_j3d_NativeConfigTemplate3D_freeFBConfig(
JNIEXPORT
-jboolean JNICALL Java_javax_media_j3d_NativeConfigTemplate3D_isStereoAvailable(
+jboolean JNICALL Java_javax_media_j3d_X11NativeConfigTemplate3D_isStereoAvailable(
JNIEnv *env,
jobject obj,
jlong display,
@@ -511,7 +511,7 @@ jboolean JNICALL Java_javax_media_j3d_NativeConfigTemplate3D_isStereoAvailable(
return (stereoFlag ? JNI_TRUE : JNI_FALSE);
}
-JNIEXPORT jint JNICALL Java_javax_media_j3d_NativeConfigTemplate3D_getStencilSize(
+JNIEXPORT jint JNICALL Java_javax_media_j3d_X11NativeConfigTemplate3D_getStencilSize(
JNIEnv *env,
jobject obj,
jlong display,
@@ -535,7 +535,7 @@ JNIEXPORT jint JNICALL Java_javax_media_j3d_NativeConfigTemplate3D_getStencilSiz
}
JNIEXPORT
-jboolean JNICALL Java_javax_media_j3d_NativeConfigTemplate3D_isDoubleBufferAvailable(
+jboolean JNICALL Java_javax_media_j3d_X11NativeConfigTemplate3D_isDoubleBufferAvailable(
JNIEnv *env,
jobject obj,
jlong display,
@@ -559,7 +559,7 @@ jboolean JNICALL Java_javax_media_j3d_NativeConfigTemplate3D_isDoubleBufferAvail
}
JNIEXPORT
-jboolean JNICALL Java_javax_media_j3d_NativeConfigTemplate3D_isSceneAntialiasingAccumAvailable(
+jboolean JNICALL Java_javax_media_j3d_X11NativeConfigTemplate3D_isSceneAntialiasingAccumAvailable(
JNIEnv *env,
jobject obj,
jlong display,
@@ -583,7 +583,7 @@ jboolean JNICALL Java_javax_media_j3d_NativeConfigTemplate3D_isSceneAntialiasing
}
JNIEXPORT
-jboolean JNICALL Java_javax_media_j3d_NativeConfigTemplate3D_isSceneAntialiasingMultisampleAvailable(
+jboolean JNICALL Java_javax_media_j3d_X11NativeConfigTemplate3D_isSceneAntialiasingMultisampleAvailable(
JNIEnv *env,
jobject obj,
jlong display,
@@ -1408,7 +1408,7 @@ PixelFormatInfo * newPixelFormatInfo(HDC hdc, jboolean usePbuffer)
JNIEXPORT
-jint JNICALL Java_javax_media_j3d_NativeConfigTemplate3D_choosePixelFormat(
+jint JNICALL Java_javax_media_j3d_Win32NativeConfigTemplate3D_choosePixelFormat(
JNIEnv *env,
jobject obj,
jlong ctxInfo,
@@ -1633,7 +1633,7 @@ jint JNICALL Java_javax_media_j3d_NativeConfigTemplate3D_choosePixelFormat(
JNIEXPORT
-void JNICALL Java_javax_media_j3d_NativeConfigTemplate3D_freePixelFormatInfo(
+void JNICALL Java_javax_media_j3d_Win32NativeConfigTemplate3D_freePixelFormatInfo(
JNIEnv *env,
jclass class, /* this is a static native method */
jlong pFormatInfo)
@@ -1655,7 +1655,7 @@ void JNICALL Java_javax_media_j3d_NativeConfigTemplate3D_freePixelFormatInfo(
JNIEXPORT
-jboolean JNICALL Java_javax_media_j3d_NativeConfigTemplate3D_isStereoAvailable(
+jboolean JNICALL Java_javax_media_j3d_Win32NativeConfigTemplate3D_isStereoAvailable(
JNIEnv *env,
jobject obj,
jlong pFormatInfo,
@@ -1692,7 +1692,7 @@ jboolean JNICALL Java_javax_media_j3d_NativeConfigTemplate3D_isStereoAvailable(
}
-JNIEXPORT jint JNICALL Java_javax_media_j3d_NativeConfigTemplate3D_getStencilSize(
+JNIEXPORT jint JNICALL Java_javax_media_j3d_Win32NativeConfigTemplate3D_getStencilSize(
JNIEnv *env,
jobject obj,
jlong pFormatInfo,
@@ -1717,7 +1717,7 @@ JNIEXPORT jint JNICALL Java_javax_media_j3d_NativeConfigTemplate3D_getStencilSiz
JNIEXPORT
-jboolean JNICALL Java_javax_media_j3d_NativeConfigTemplate3D_isDoubleBufferAvailable(
+jboolean JNICALL Java_javax_media_j3d_Win32NativeConfigTemplate3D_isDoubleBufferAvailable(
JNIEnv *env,
jobject obj,
jlong pFormatInfo,
@@ -1741,7 +1741,7 @@ jboolean JNICALL Java_javax_media_j3d_NativeConfigTemplate3D_isDoubleBufferAvail
}
JNIEXPORT
-jboolean JNICALL Java_javax_media_j3d_NativeConfigTemplate3D_isSceneAntialiasingAccumAvailable(
+jboolean JNICALL Java_javax_media_j3d_Win32NativeConfigTemplate3D_isSceneAntialiasingAccumAvailable(
JNIEnv *env,
jobject obj,
jlong pFormatInfo,
@@ -1763,7 +1763,7 @@ jboolean JNICALL Java_javax_media_j3d_NativeConfigTemplate3D_isSceneAntialiasing
}
JNIEXPORT
-jboolean JNICALL Java_javax_media_j3d_NativeConfigTemplate3D_isSceneAntialiasingMultisampleAvailable(
+jboolean JNICALL Java_javax_media_j3d_Win32NativeConfigTemplate3D_isSceneAntialiasingMultisampleAvailable(
JNIEnv *env,
jobject obj,
jlong pFormatInfo,
diff --git a/src/native/ogl/NativeScreenInfo.c b/src/native/ogl/NativeScreenInfo.c
index 64396de..162820e 100644
--- a/src/native/ogl/NativeScreenInfo.c
+++ b/src/native/ogl/NativeScreenInfo.c
@@ -40,12 +40,12 @@
/*
- * Class: javax_media_j3d_NativeScreenInfo
+ * Class: javax_media_j3d_X11NativeScreenInfo
* Method: openDisplay
* Signature: ()J
*/
JNIEXPORT jlong JNICALL
-Java_javax_media_j3d_NativeScreenInfo_openDisplay(
+Java_javax_media_j3d_X11NativeScreenInfo_openDisplay(
JNIEnv *env,
jclass cls)
{
@@ -55,12 +55,12 @@ Java_javax_media_j3d_NativeScreenInfo_openDisplay(
}
/*
- * Class: javax_media_j3d_NativeScreenInfo
+ * Class: javax_media_j3d_X11NativeScreenInfo
* Method: getDefaultScreen
* Signature: (J)I
*/
JNIEXPORT jint JNICALL
-Java_javax_media_j3d_NativeScreenInfo_getDefaultScreen(
+Java_javax_media_j3d_X11NativeScreenInfo_getDefaultScreen(
JNIEnv *env,
jclass cls,
jlong display)
@@ -70,12 +70,12 @@ Java_javax_media_j3d_NativeScreenInfo_getDefaultScreen(
}
/*
- * Class: javax_media_j3d_NativeScreenInfo
+ * Class: javax_media_j3d_X11NativeScreenInfo
* Method: queryGLX13
* Signature: (J)Z
*/
JNIEXPORT jboolean JNICALL
-Java_javax_media_j3d_NativeScreenInfo_queryGLX13(
+Java_javax_media_j3d_X11NativeScreenInfo_queryGLX13(
JNIEnv *env,
jclass cls,
jlong display)
@@ -141,12 +141,12 @@ extern PIXELFORMATDESCRIPTOR getDummyPFD();
extern BOOL isSupportedWGL(const char *extensions, const char *extension_string);
/*
- * Class: javax_media_j3d_NativeScreenInfo
+ * Class: javax_media_j3d_Win32NativeScreenInfo
* Method: queryWglARB
* Signature: (J)Z
*/
JNIEXPORT jboolean JNICALL
-Java_javax_media_j3d_NativeScreenInfo_queryWglARB(
+Java_javax_media_j3d_Win32NativeScreenInfo_queryWglARB(
JNIEnv *env,
jclass cls)
{
diff --git a/src/native/ogl/gldefs.h b/src/native/ogl/gldefs.h
index edd5cdd..39ca6de 100644
--- a/src/native/ogl/gldefs.h
+++ b/src/native/ogl/gldefs.h
@@ -161,6 +161,14 @@
#include "javax_media_j3d_ShaderAttributeObjectRetained.h"
#include "javax_media_j3d_ShaderError.h"
+#ifdef WIN32
+#include "javax_media_j3d_Win32NativeConfigTemplate3D.h"
+#include "javax_media_j3d_Win32NativeScreenInfo.h"
+#else
+#include "javax_media_j3d_X11NativeConfigTemplate3D.h"
+#include "javax_media_j3d_X11NativeScreenInfo.h"
+#endif
+
/* Used to compare floating point values close to 0.0 */
#define J3D_SMALL_FLOAT 0.00001f