aboutsummaryrefslogtreecommitdiffstats
path: root/src/classes/share
diff options
context:
space:
mode:
authorChien Yang <[email protected]>2004-10-15 23:33:45 +0000
committerChien Yang <[email protected]>2004-10-15 23:33:45 +0000
commit14b52db7ab4c4be2bd39ff944cec056c291f999a (patch)
tree3bf6c274a97828b9ca4cd28de6ed602dfeac9af3 /src/classes/share
parentcdf24368541b18e5ffc56f5c9449310e874f4a2f (diff)
Issue number: 4, 28, 71 and 76
Windows OpenGL only : This fix will use hardware Pbuffer for offScreenBuffer rendering if the graphics hardware support it, else BitMap is use as a fallback. 1) Fixed issue 4 - Speed of OffScreen Canvas3D 2) Fixed issue 28 - Combine Mode & Missing Texture in OffScreen snapshot on Win/XP 3) Fixed issue 71 - OGL: OffScreen canvas ignore GraphicsConfigTemplate under windows. 4) Fixed issue 76 - OffScreen rendering should use Pbuffer on Windows / OpenGL 5) Cleanup native ChoosePixelFormat code. git-svn-id: https://svn.java.net/svn/j3d-core~svn/trunk@56 ba19aa83-45c5-6ac9-afd3-db810772062c
Diffstat (limited to 'src/classes/share')
-rw-r--r--src/classes/share/javax/media/j3d/Canvas3D.java31
-rw-r--r--src/classes/share/javax/media/j3d/Renderer.java2
2 files changed, 24 insertions, 9 deletions
diff --git a/src/classes/share/javax/media/j3d/Canvas3D.java b/src/classes/share/javax/media/j3d/Canvas3D.java
index eb979e6..50ee073 100644
--- a/src/classes/share/javax/media/j3d/Canvas3D.java
+++ b/src/classes/share/javax/media/j3d/Canvas3D.java
@@ -559,13 +559,27 @@ public class Canvas3D extends Canvas {
// the visual id.
int vid = 0;
- // Fix for issue 20.
+
+ // fbConfig is a pointer to the fbConfig object that is associated with
+ // the GraphicsConfiguration object used to create this Canvas.
+ //
+ // For Unix : Fix for issue 20.
// The fbConfig is only used when running X11. It contains a pointer
// to the native GLXFBConfig structure list, since in some cases the visual id
// alone isn't sufficient for the native OpenGL renderer (e.g., when using
// Solaris OpenGL with Xinerama mode disabled).
+ //
+ // For Windows : Fix for issue 76. This is use as a holder of the
+ // PixelFormat structure ( see also gldef.h ) to allow value such
+ // as offScreen's pixelformat, and ARB function pointers to be stored.
long fbConfig = 0;
+ // offScreenBufferInfo is a pointer to additional information about the
+ // offScreenBuffer in this Canvas.
+ //
+ // For Windows : Fix for issue 76.
+ long offScreenBufferInfo = 0;
+
// fbConfigTable is a static hashtable which allows getBestConfiguration()
// in NativeConfigTemplate3D to map a GraphicsConfiguration to the pointer
// to the actual GLXFBConfig that glXChooseFBConfig() returns. The Canvas3D
@@ -812,7 +826,7 @@ public class Canvas3D extends Canvas {
native static void destroyContext(long display, int window, long context);
// This is the native for creating offscreen buffer
- native int createOffScreenBuffer(long ctx, long display, int window, long fbConfig, int width, int height);
+ native int createOffScreenBuffer(long ctx, long display, int vid, long fbConfig, int width, int height);
native void destroyOffScreenBuffer(long ctx, long display, long fbConfig, int window);
@@ -1117,7 +1131,7 @@ public class Canvas3D extends Canvas {
this.offScreen = offScreen;
this.graphicsConfiguration = graphicsConfiguration;
- // Needed for Win32 only.
+ // Needed for Win32 only.
vid = nativeWSobj.getCanvasVid(graphicsConfiguration);
// Fix for issue 20.
@@ -1127,15 +1141,16 @@ public class Canvas3D extends Canvas {
if ((fbConfigObject != null) &&
(fbConfigObject instanceof Long)) {
fbConfig = ((Long)fbConfigObject).longValue();
- // System.out.println("Canvas3D creation FBConfig = " + fbConfig);
-
+ /* System.out.println("Canvas3D creation FBConfig = " + fbConfig +
+ " offScreen is " + offScreen );
+ */
+ // This check is needed for Unix and Win-ogl only. fbConfig should
+ // remain as -1, default value, for D3D case.
if (fbConfig == 0) {
throw new IllegalArgumentException
(J3dI18N.getString("Canvas3D23"));
}
}
-
-
if (offScreen) {
screen = new Screen3D(graphicsConfiguration, offScreen);
@@ -3388,7 +3403,7 @@ public class Canvas3D extends Canvas {
// inside the native code after setting the various
// fields in this object
createQueryContext(screen.display, window, vid,
- fbConfig, offScreen, 10, 10);
+ fbConfig, offScreen, 1, 1);
}
/**
diff --git a/src/classes/share/javax/media/j3d/Renderer.java b/src/classes/share/javax/media/j3d/Renderer.java
index 12b4dce..cd47249 100644
--- a/src/classes/share/javax/media/j3d/Renderer.java
+++ b/src/classes/share/javax/media/j3d/Renderer.java
@@ -450,7 +450,7 @@ class Renderer extends J3dThread {
canvas.window =
canvas.createOffScreenBuffer(canvas.ctx,
canvas.screen.display,
- canvas.window,
+ canvas.vid,
canvas.fbConfig,
canvas.offScreenCanvasSize.width,
canvas.offScreenCanvasSize.height);