<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://jogamp.org/bugzilla/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.2"
          urlbase="https://jogamp.org/bugzilla/"
          
          maintainer="sgothel@jausoft.com"
>

    <bug>
          <bug_id>1097</bug_id>
          
          <creation_ts>2014-10-24 15:49:43 +0200</creation_ts>
          <short_desc>AWTGLReadBufferUtil.readPixelsToBufferedImage() causes exception on SWT</short_desc>
          <delta_ts>2015-06-09 02:00:17 +0200</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>JogAmp</classification>
          <product>Jogl</product>
          <component>core</component>
          <version>2</version>
          <rep_platform>pc_all</rep_platform>
          <op_sys>linux</op_sys>
          <bug_status>UNCONFIRMED</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>---</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Paul">someuser</reporter>
          <assigned_to name="Sven Gothel">sgothel</assigned_to>
          <cc>mjames</cc>
    
    <cc>sgothel</cc>
          
          <cf_type>---</cf_type>
          <cf_scm_refs></cf_scm_refs>
          <cf_workaround>---</cf_workaround>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>4419</commentid>
    <comment_count>0</comment_count>
    <who name="Paul">someuser</who>
    <bug_when>2014-10-24 15:49:43 +0200</bug_when>
    <thetext>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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>4723</commentid>
    <comment_count>1</comment_count>
    <who name="Michael James">mjames</who>
    <bug_when>2015-06-09 02:00:17 +0200</bug_when>
    <thetext>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)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>