<?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>378</bug_id>
          
          <creation_ts>2009-08-27 05:04:52 +0200</creation_ts>
          <short_desc>TextureData incorrectly requires GL context</short_desc>
          <delta_ts>2010-03-24 22:38:56 +0100</delta_ts>
          <reporter_accessible>0</reporter_accessible>
          <cclist_accessible>0</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>JogAmp</classification>
          <product>Jogl</product>
          <component>core</component>
          <version>2</version>
          <rep_platform>All</rep_platform>
          <op_sys>all</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Sven Gothel">sgothel</reporter>
          <assigned_to name="Sven Gothel">sgothel</assigned_to>
          <cc>bienator</cc>
          
          <cf_type>DEFECT</cf_type>
          <cf_scm_refs>8b8e270788b50636e48ee17cc9e5fc8f29d44f5c
def4bf0d2f6ff9bf77418d26807bdcb187a3b033</cf_scm_refs>
          <cf_workaround>---</cf_workaround>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>394</commentid>
    <comment_count>0</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2010-03-24 07:51:51 +0100</bug_when>
    <thetext>


---- Reported by qwerty999 2009-08-27 17:04:52 ----

Hi, in JOGL2 there is an issue with creating a TextureData. TextureData for some reason requires the GL 
context to be available. But the whole point of having TextureData was to separate texture preparation 
from the GL context. 

You can see for instance in the class AWTTextureData.java one method requires an open GL context 
simply to determine the GLProfile.

GLProfile glp = GLContext.getCurrentGL().getGLProfile();
if (glp.isGL2()) { ... }

So, calling a method via the TextureIO class such as:

TextureIO.newTextureData(myFile, false, null);

will throw this exception:

Exception in thread &quot;main&quot; javax.media.opengl.GLException: No OpenGL context current on this thread
        at javax.media.opengl.GLContext.getCurrentGL(GLContext.java:159)
        at com.sun.opengl.util.texture.awt.AWTTextureData.createFromImage(AWTTextureData.java:173)
        at com.sun.opengl.util.texture.awt.AWTTextureData.&lt;init&gt;(AWTTextureData.java:102)
        at 
com.sun.opengl.util.texture.spi.awt.IIOTextureProvider.newTextureData(IIOTextureProvider.java:69)
        at com.sun.opengl.util.texture.TextureIO.newTextureDataImpl(TextureIO.java:765)
        at com.sun.opengl.util.texture.TextureIO.newTextureData(TextureIO.java:180)



--- Bug imported by sgothel@jausoft.com 2010-03-24 07:51 EDT  ---

This bug was previously known as _bug_ 378 at https://jogl.dev.java.net/bugs/show_bug.cgi?id=378
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>421</commentid>
    <comment_count>1</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2010-03-24 09:16:52 +0100</bug_when>
    <thetext>*** Bug 380 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>423</commentid>
    <comment_count>2</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2010-03-24 18:54:55 +0100</bug_when>
    <thetext>Moved to JOGL2 ..</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>424</commentid>
    <comment_count>3</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2010-03-24 22:30:04 +0100</bug_when>
    <thetext>git: 8b8e270788b50636e48ee17cc9e5fc8f29d44f5c

Solution: Pending data initialization if GL dependencies, see git log.

Also: Added JUNIT tests (compile and run) in JOGL.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>425</commentid>
    <comment_count>4</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2010-03-24 22:38:56 +0100</bug_when>
    <thetext>git: def4bf0d2f6ff9bf77418d26807bdcb187a3b033

forgot to check-in the tests ..</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>