File tree Expand file tree Collapse file tree 3 files changed +12
-4
lines changed
Expand file tree Collapse file tree 3 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -81,10 +81,16 @@ impl GlfwContext {
8181
8282 for ( _, event) in glfw:: flush_messages ( & self . events ) {
8383 if event == WindowEvent :: Close {
84+ self . window . hide ( ) ;
8485 return false ;
8586 }
8687 }
8788
88- !self . window . should_close ( )
89+ if self . window . should_close ( ) {
90+ self . window . hide ( ) ;
91+ return false ;
92+ }
93+
94+ true
8995 }
9096}
Original file line number Diff line number Diff line change 22import IPython .display as _ipy_display
33
44def _processing_post_execute (result ):
5- processing ._end_draw ()
5+ if getattr (processing , '_graphics' , None ) is None :
6+ return
7+ processing ._present ()
68 png_data = processing ._readback_png ()
79 _ipy_display .display (_ipy_display .Image (data = bytes (png_data )))
8- processing ._begin_draw ()
910
1011get_ipython ().events .register ('post_run_cell' , _processing_post_execute )
Original file line number Diff line number Diff line change @@ -77,7 +77,8 @@ pub fn create(
7777 texture_format,
7878 RenderAssetUsages :: all ( ) ,
7979 ) ;
80- // When used as a render target (offscreen surface), the texture needs RENDER_ATTACHMENT
80+ // we need to mark this as a render attachment so it can be used as a render target for
81+ // drawing and readback
8182 image. texture_descriptor . usage |= TextureUsages :: RENDER_ATTACHMENT ;
8283
8384 let handle = images. add ( image) ;
You can’t perform that action at this time.
0 commit comments