aboutsummaryrefslogtreecommitdiffstats
path: root/src/classes/win32
diff options
context:
space:
mode:
authorChien Yang <[email protected]>2004-10-28 21:22:10 +0000
committerChien Yang <[email protected]>2004-10-28 21:22:10 +0000
commit2ce93668c57e29a6d2ea992f8675afdd0719c820 (patch)
treeb2a42e5956025c0da23bd716dd407c9f15b3baaa /src/classes/win32
parentcc979689cf50222764a085f775dc39c583add82d (diff)
1) Fixed issue 77 : Scene antialiasing is disabled on Windows / OpenGL
2) For Win32-OGL : Apply similar technique, used in fix to 77, to Stereo, DoubleBuffer and Accum. 3) For Unix and Win32-OGL : Automat multisample density request in chooseFBConfig/ChoosePixelFormat if ARB_multisample is supported. It starts with sample density = 8 and move down if it can't find one. git-svn-id: https://svn.java.net/svn/j3d-core~svn/trunk@63 ba19aa83-45c5-6ac9-afd3-db810772062c
Diffstat (limited to 'src/classes/win32')
-rw-r--r--src/classes/win32/javax/media/j3d/NativeConfigTemplate3D.java60
1 files changed, 17 insertions, 43 deletions
diff --git a/src/classes/win32/javax/media/j3d/NativeConfigTemplate3D.java b/src/classes/win32/javax/media/j3d/NativeConfigTemplate3D.java
index 2759ea5..eca5def 100644
--- a/src/classes/win32/javax/media/j3d/NativeConfigTemplate3D.java
+++ b/src/classes/win32/javax/media/j3d/NativeConfigTemplate3D.java
@@ -49,10 +49,10 @@ class NativeConfigTemplate3D {
static native void freePixelFormatInfo(long pFormatInfo);
// Native methods to return whether a particular attribute is available
- native boolean isStereoAvailable(long ctx, long display, int screen, int pixelFormat);
- native boolean isDoubleBufferAvailable(long ctx, long display, int screen, int pixelFormat);
- native boolean isSceneAntialiasingAccumAvailable(long ctx, long display, int screen, int pixelFormat);
- native boolean isSceneAntialiasingMultiSamplesAvailable(long ctx, long display, int screen, int pixelFormat);
+ native boolean isStereoAvailable(long pFormatInfo, boolean offScreen);
+ native boolean isDoubleBufferAvailable(long pFormatInfo, boolean offScreen);
+ native boolean isSceneAntialiasingAccumAvailable(long pFormatInfo, boolean offScreen);
+ native boolean isSceneAntialiasingMultisampleAvailable(long pFormatInfo, boolean offScreen, int screen);
/**
* Chooses the best PixelFormat for Java 3D apps.
@@ -179,56 +179,30 @@ class NativeConfigTemplate3D {
// Return whether stereo is available.
- boolean hasStereo(GraphicsConfiguration gc) {
- Win32GraphicsDevice gd =
- (Win32GraphicsDevice)((Win32GraphicsConfig)gc).getDevice();
- NativeScreenInfo nativeScreenInfo = new NativeScreenInfo(gd);
-
- int display = nativeScreenInfo.getDisplay();
- int screen = nativeScreenInfo.getScreen();
- // Temporary until Win32 GraphicsConfig stuff complete
- int pixelFormat = ((J3dGraphicsConfig) gc).getPixelFormat();
-
- return isStereoAvailable(0, display, screen, pixelFormat);
+ boolean hasStereo(Canvas3D c3d) {
+ return isStereoAvailable(c3d.fbConfig, c3d.offScreen);
}
// Return whether a double buffer is available.
- boolean hasDoubleBuffer(GraphicsConfiguration gc) {
- Win32GraphicsDevice gd =
- (Win32GraphicsDevice)((Win32GraphicsConfig)gc).getDevice();
- NativeScreenInfo nativeScreenInfo = new NativeScreenInfo(gd);
- int display = nativeScreenInfo.getDisplay();
- int screen = nativeScreenInfo.getScreen();
- // Temporary until Win32 GraphicsConfig stuff complete
- int pixelFormat = ((J3dGraphicsConfig) gc).getPixelFormat();
-
- return isDoubleBufferAvailable(0, display, screen, pixelFormat);
+ boolean hasDoubleBuffer(Canvas3D c3d) {
+ return isDoubleBufferAvailable(c3d.fbConfig, c3d.offScreen);
}
// Return whether scene antialiasing is available.
- boolean hasSceneAntialiasingAccum(GraphicsConfiguration gc) {
- Win32GraphicsDevice gd =
- (Win32GraphicsDevice)((Win32GraphicsConfig)gc).getDevice();
- NativeScreenInfo nativeScreenInfo = new NativeScreenInfo(gd);
- int display = nativeScreenInfo.getDisplay();
- int screen = nativeScreenInfo.getScreen();
- // Temporary until Win32 GraphicsConfig stuff complete
- int pixelFormat = ((J3dGraphicsConfig) gc).getPixelFormat();
-
- return isSceneAntialiasingAccumAvailable(0, display, screen, pixelFormat);
+ boolean hasSceneAntialiasingAccum(Canvas3D c3d) {
+ return isSceneAntialiasingAccumAvailable(c3d.fbConfig, c3d.offScreen);
}
// Return whether scene antialiasing is available.
- boolean hasSceneAntialiasingMultiSamples(GraphicsConfiguration gc) {
+ boolean hasSceneAntialiasingMultisample(Canvas3D c3d) {
+ GraphicsConfiguration gc = c3d.graphicsConfiguration;
+
Win32GraphicsDevice gd =
- (Win32GraphicsDevice)((Win32GraphicsConfig)gc).getDevice();
- NativeScreenInfo nativeScreenInfo = new NativeScreenInfo(gd);
- int display = nativeScreenInfo.getDisplay();
+ (Win32GraphicsDevice)((Win32GraphicsConfig)gc).getDevice();
+ NativeScreenInfo nativeScreenInfo = new NativeScreenInfo(gd);
int screen = nativeScreenInfo.getScreen();
- // Temporary until Win32 GraphicsConfig stuff complete
- int pixelFormat = ((J3dGraphicsConfig) gc).getPixelFormat();
-
- return isSceneAntialiasingMultiSamplesAvailable(0, display, screen, pixelFormat);
+ /* Fix to issue 77 */
+ return isSceneAntialiasingMultisampleAvailable(c3d.fbConfig, c3d.offScreen, screen);
}
// Ensure that the native libraries are loaded