aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/javax/media/opengl/awt
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-12-15 23:25:12 +0100
committerSven Gothel <[email protected]>2012-12-15 23:25:12 +0100
commite7064ece049705e013d80985eae698ce0ee3c4e3 (patch)
treed6b7c347f6835f6ead6a0fb2fe1089451db09ed9 /src/jogl/classes/javax/media/opengl/awt
parent36a6cfb5b346f3b0cda7326f61bf22fb60486fd2 (diff)
Cleanup GLContext special entries: getOffscreenContextPixelDataType(), getOffscreenContextReadBuffer(), .. ; Add GLFBODrawable API entries for multi buffering (no impl. yet); GLJPanel 1st simplification using offscreen drawable
- Cleanup GLContext special entries: getOffscreenContextPixelDataType(), getOffscreenContextReadBuffer(), .. ; - add: getDefaultReadBuffer() (-> exposed via GLBase as well) - add: isGLOrientationFlippedVertical() - add: getDefaultPixelDataType() - removed impl: getOffscreenContextPixelDataType() - removed impl: getOffscreenContextReadBuffer() - removed impl: offscreenImageNeedsVerticalFlip() - Add GLFBODrawable API entries for multi buffering (no impl. yet); - TODO: Add implementation code in GLFBODrawableImpl - GLJPanel 1st simplification using FBO - Use above new GL/GLContext entries - Fix: getNativeSurface() and getHandle() - TODO: - Remove distinction of 'pbuffer' and 'software', - Use GLDrawableFactory.createOffscreenDrawable(..) - Use GL for FBO swapping
Diffstat (limited to 'src/jogl/classes/javax/media/opengl/awt')
-rw-r--r--src/jogl/classes/javax/media/opengl/awt/GLJPanel.java20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java
index dcfc1f0dd..a9d4989dc 100644
--- a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java
+++ b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java
@@ -618,12 +618,18 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
@Override
public NativeSurface getNativeSurface() {
- throw new GLException("FIXME");
+ if(null != backend) {
+ return backend.getDrawable().getNativeSurface();
+ }
+ return null;
}
@Override
public long getHandle() {
- throw new GLException("FIXME");
+ if(null != backend) {
+ return backend.getDrawable().getNativeSurface().getSurfaceHandle();
+ }
+ return 0;
}
@Override
@@ -657,6 +663,8 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
if (oglPipelineEnabled) {
backend = new J2DOGLBackend();
} else {
+ backend = new SoftwareBackend();
+ /**
if (!hardwareAccelerationDisabled &&
factory.canCreateGLPbuffer(null)) {
backend = new PbufferBackend();
@@ -665,7 +673,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
throw new GLException("Fallback to software rendering disabled by user");
}
backend = new SoftwareBackend();
- }
+ } */
}
}
@@ -996,7 +1004,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
gl.glPixelStorei(GL2.GL_PACK_ALIGNMENT, 1);
// Actually read the pixels.
- gl.glReadBuffer(GL2.GL_FRONT);
+ gl.glReadBuffer(gl.getDefaultReadBuffer());
if (readBackBytes != null) {
gl.glReadPixels(0, 0, readBackWidthInPixels, readBackHeightInPixels, glFormat, glType, readBackBytes);
} else if (readBackInts != null) {
@@ -1173,12 +1181,12 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
@Override
protected int getGLPixelType() {
- return offscreenContext.getOffscreenContextPixelDataType();
+ return offscreenContext.getDefaultPixelDataType();
}
@Override
protected boolean flipVertically() {
- return offscreenContext.offscreenImageNeedsVerticalFlip();
+ return offscreenContext.isGLOrientationFlippedVertical();
}
}