Bug 1097 - AWTGLReadBufferUtil.readPixelsToBufferedImage() causes exception on SWT
Summary: AWTGLReadBufferUtil.readPixelsToBufferedImage() causes exception on SWT
Status: UNCONFIRMED
Alias: None
Product: Jogl
Classification: JogAmp
Component: core (show other bugs)
Version: 2
Hardware: pc_all linux
: --- normal
Assignee: Sven Gothel
URL:
Depends on:
Blocks:
 
Reported: 2014-10-24 15:49 CEST by Paul
Modified: 2015-06-09 02:00 CEST (History)
2 users (show)

See Also:
Type: ---
SCM Refs:
Workaround: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul 2014-10-24 15:49:43 CEST
When org.eclipse.swt.opengl.GLCanvas is used together with capturing screenshot by AWTGLReadBufferUtil.readPixelsToBufferedImage() expection is thrown

javax.media.opengl.GLException: Should not call this
	at jogamp.opengl.windows.wgl.WindowsExternalWGLContext$Drawable.getSurfaceWidth(WindowsExternalWGLContext.java:133) ~[jogl-all-2.2.4.jar:2.2.4]
	at com.jogamp.opengl.util.awt.AWTGLReadBufferUtil.readPixelsToBufferedImage(AWTGLReadBufferUtil.java:94) ~[jogl-all-2.2.4.jar:2.2.4]
	at com.jogamp.opengl.util.awt.AWTGLReadBufferUtil.readPixelsToBufferedImage(AWTGLReadBufferUtil.java:71) ~[jogl-all-2.2.4.jar:2.2.4]

Windows x64, SWT 4.4, Java 1.8.0_20 (x64), JOGL 2.2.4
Comment 1 Michael James 2015-06-09 02:00:17 CEST
I am also experiencing this bug, and it is preventing my Eclipse RCP application from exporting a screenshot.   It may or may not be related to how I am using canvases and contexts, but finding this bug filed here gives me hope that I am using AWTGLReadBufferUtil and BufferedImage correctly.

This is with jogl 2.3.2 and Eclipse SWT.



GLProfile glp = GLProfile.getDefault();
AWTGLReadBufferUtil screenshot = new AWTGLReadBufferUtil(glp, false);
BufferedImage bi = screenshot.readPixelsToBufferedImage(gl, true);



com.jogamp.opengl.GLException: Should not call this
	at jogamp.opengl.x11.glx.X11ExternalGLXContext$Drawable.getSurfaceWidth(X11ExternalGLXContext.java:145)
	at com.jogamp.opengl.util.awt.AWTGLReadBufferUtil.readPixelsToBufferedImage(AWTGLReadBufferUtil.java:94)
	at com.jogamp.opengl.util.awt.AWTGLReadBufferUtil.readPixelsToBufferedImage(AWTGLReadBufferUtil.java:71)
	at com.raytheon.viz.core.gl.internal.GLTarget.screenshot(GLTarget.java:1248)