<?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>665</bug_id>
          
          <creation_ts>2013-01-08 16:48:38 +0100</creation_ts>
          <short_desc>Allow re-association of GLContext/GLEventListener to a GLDrawable, allowing GLContext/GLEventListener survival of GLDrawable/Surface Destruction</short_desc>
          <delta_ts>2013-03-22 14:01:56 +0100</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>All</rep_platform>
          <op_sys>all</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>---</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Brice Figureau">brice.figureau</reporter>
          <assigned_to name="Sven Gothel">sgothel</assigned_to>
          <cc>gouessej</cc>
    
    <cc>sgothel</cc>
          
          <cf_type>---</cf_type>
          <cf_scm_refs>jogl b738983638703bb721ee4c9820c8ef43e2252e73
jogl 7fd5f76e1eb4bbf93fe9b1171744bd755d8f96e4
jogl 2fe180fbee15b82e2ae14fe3c95887db246c874d
jogl c225285e09f0a29fca418601bf1aa07cafb54339
jogl e2506d7663b752f00f0a98f793ebad52e65bd1e3</cf_scm_refs>
          <cf_workaround>---</cf_workaround>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2088</commentid>
    <comment_count>0</comment_count>
    <who name="Brice Figureau">brice.figureau</who>
    <bug_when>2013-01-08 16:48:38 +0100</bug_when>
    <thetext>Problem:
when an android app is stopped by being put on the background when tapping the &quot;home&quot; button, the WindowDriver.surfaceDestroyed method is called and ultimately the GLContext is destroyed.
When the app comes back to life (and the activity.onResume is called), the GLWindow becomes visible again, but with a blank gl context that lost all VBO and textures.

It would be great to save the GL context when the surface is destroyed and restored when a new surface gets attached to the gl window.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2110</commentid>
    <comment_count>1</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2013-01-21 14:32:26 +0100</bug_when>
    <thetext>Will refine the whole GLContext.setDrawable(..), i.e. GLContext&lt;-&gt;GLDrawable
association to allow an unbound GLContext. The latter is ofc to be treated very carefully,
i.e. no method shall be called until re-associated w/ GLDrawable.

Then .. when passing unit tests etc., we can have an option in e.g. NewtBaseActivity to flag
GLContext survival ..</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2121</commentid>
    <comment_count>2</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2013-01-24 17:29:06 +0100</bug_when>
    <thetext>part 1 - see commit message ..

Achieved: New test case w/ GLContext surviving GLAutoDrawable destruction 
and re-association (X11, Windows and OSX w/ NEWT).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2133</commentid>
    <comment_count>3</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2013-01-26 06:01:59 +0100</bug_when>
    <thetext>Tackling EGL derived surface case w/ 
commit 7fd5f76e1eb4bbf93fe9b1171744bd755d8f96e4,
not complete yet.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2134</commentid>
    <comment_count>4</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2013-01-27 14:08:50 +0100</bug_when>
    <thetext>    Bug 665 (part 3) - Add EGL/ES2 tests, attempt to fix wrapped EGL case
    
    - Add EGL/ES2 tests in
      - TestGLContextDrawableSwitch01NEWT
      - TestGLContextDrawableSwitch11NEWT
    
    - Attempt to fix wrapped EGL case (incomplete)
      - Using EGL/ES w/ non native EGL device/surface, but natively wrapped instances (most of the cases),
        a &apos;complicated&apos; delegation of
           Native-Upstream -&gt; EGL-Proxy -&gt; EGL-Instance
        is being used heavily relying on the objects lifecycle.
        GLEventListenerState tries to roll back the realized state
        and even sets the upstream device handle,
        but this doesn&apos;t seem to be sufficient on X11.
    
    Discussion:
    
    It might turn out that we only can implement the survival of GLContext
    and it&apos;s display device reliable w/ EGL within the GLAutoDrawable implementation,
    which can hold the previous not destructed instances.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2265</commentid>
    <comment_count>5</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2013-03-13 07:17:54 +0100</bug_when>
    <thetext>Part 4:
  http://jogamp.org/git/?p=jogl.git;a=commit;h=c225285e09f0a29fca418601bf1aa07cafb54339

Part 5:
  http://jogamp.org/git/?p=jogl.git;a=commit;h=e2506d7663b752f00f0a98f793ebad52e65bd1e3</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2337</commentid>
    <comment_count>6</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2013-03-22 14:01:56 +0100</bug_when>
    <thetext>Part 6
  http://jogamp.org/git/?p=jogl.git;a=commit;h=3ad03e41a0cda81119c23f350c00b064a4de70c2

Part 7 (Android Specific)
  http://jogamp.org/git/?p=jogl.git;a=commit;h=d514ecbf052d013ea8c0982c490757678075a9ea

Tested manually on Android devices, i.e. when pressing HOME
and returning to application, the state has been preserved (no dispose/init on GLEventListeners
and same GLContext is being used .. etc). This is visible when the &apos;gears&apos; for example
return in the same [rotational] state when left ..

GLEventListenerState handling is described w/ interface GLStateKeeper
to be used and queried by any platform if desired.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>