<?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>206</bug_id>
          
          <creation_ts>2006-02-22 06:10:16 +0100</creation_ts>
          <short_desc>glTexImage2D fails on external context</short_desc>
          <delta_ts>2010-03-24 07:48:30 +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>1</version>
          <rep_platform>All</rep_platform>
          <op_sys>linux</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>
          
          
          <cf_type>DEFECT</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>222</commentid>
    <comment_count>0</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2010-03-24 07:48:30 +0100</bug_when>
    <thetext>


---- Reported by gmueckl 2006-02-22 18:10:16 ----

When using JOGL with an external context (the context has an on screen 
drawable provided by SWT) glTexImage2D fails. The relevant part of the stack 
backtrace is included. 
 
javax.media.opengl.GLException: Context not current 
	at 
com.sun.opengl.impl.x11.X11GLContext.getPlatformExtensionsString(X11GLContext.java:212) 
	at 
com.sun.opengl.impl.FunctionAvailabilityCache.initAvailableExtensions(FunctionAvailabilityCache.java:116) 
	at 
com.sun.opengl.impl.FunctionAvailabilityCache.isExtensionAvailable(FunctionAvailabilityCache.java:104) 
	at 
com.sun.opengl.impl.GLContextImpl.isExtensionAvailable(GLContextImpl.java:314) 
	at 
com.sun.opengl.impl.x11.X11GLContext.isExtensionAvailable(X11GLContext.java:256) 
	at com.sun.opengl.impl.GLImpl.isExtensionAvailable(GLImpl.java:27851) 
	at com.sun.opengl.impl.GLImpl.checkBufferObject(GLImpl.java:27992) 
	at 
com.sun.opengl.impl.GLImpl.checkUnpackPBODisabled(GLImpl.java:28012) 
	at com.sun.opengl.impl.GLImpl.glTexImage2D(GLImpl.java:19578) 
 
Please note that glTexImage2D is indeed called on the correct (and cureent) 
context. Because of problems with generating the GLImpl code I cannot have a 
look at how you&apos;ve attempted to optimize texture loading, although the intent 
is obvious from the stack backtrace. 
 
To me this looks a lot like JOGL fails to catch that exception and therefore 
is unable to fall back to a plain call of glTexImage2D. If this is what 
happens, then this behaviour is clearly a bug.



---- Additional Comments From gmueckl 2006-02-22 18:12:48 ----

I forgot to mention that this happens with the nightly build from 2006-02-22. 



---- Additional Comments From kbr 2006-02-22 20:45:52 ----

It looks like there has been a bug basically forever in the X11ExternalGLContext
code where the mostRecentDisplay was never set, causing failure of extension
queries. I find it hard to believe that this could have been broken for this
long, but it&apos;s pretty clear a bug was there. It&apos;s been fixed in the JOGL tree
and will show up in the nightly build of 2/23. Please retest with that build or
later and verify the fix. Please also double-check that the application is
calling makeCurrent()/release() on the external GLContext, which is required
even though it will not change the actual underlying OpenGL context. FYI, this
had nothing to do with texturing specifically.




---- Additional Comments From gmueckl 2006-02-23 12:35:47 ----

OK, there are no more exceptions with the new version, so it appears to be 
fixed. Thanks! 
 



---- Additional Comments From kbr 2006-02-23 15:06:30 ----

Marking bug as fixed.




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

This bug was previously known as _bug_ 206 at https://jogl.dev.java.net/bugs/show_bug.cgi?id=206
</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>