I guess you may try

ogl =: ''

tgsj_run=: 3 : 0
if. #ogl do.
  free__ogl''      NB. force new rc
  wdpclose 'opengl'
end.
assert. 0=#ogl
wd OPENGL
wdmove _1 0
ogl=: ''conew'jzopengl'
wd'setfocus g'
wd'pcenter;pshow;'
yw 0  NB. this is a startup command for my app
)

opengl_close=: 0
free__ogl''      NB. force new rc
wd ::0:'pclose'
)

OPENGL=: 0 : 0
pc opengl;pn tgsj;
xywh 0 0 200 150;cc g isigraph opengl rightmove bottommove;
pas 0 0;
rem form end;
)

(untested)

Птн, 09 Ноя 2012, Brian Schott писал(а):
> 
> I have the following J602 code which initializes a window for opengl
> just fine, but only the first time in a J session. After the first
> time if I execute `tgsj_run ''` with the original graphics window
> still open (it is closed before the first execution of `tgsj_run ''`)
> I get a new grpahics window. Also upon the second execution of
> `tgsj_run ''` the .ijs window disappears.
> 
> On the other hand if I close the graphics window with escape before
> re-executing `tgsj_run ''`, I get varied results. Sometimes it works
> fine, but most often I either get a system crash or the old window
> reopens along with the new window when I re-execute `tgsj_run ''`.
> 
> Any ideas?
> 
>    9!:12''
> 5
>    9!:14''
> j602/2008-03-03/16:45
> 
> 
> 
> ogl =: ''
> 
> tgsj_run=: 3 : 0
> try.
>   opengl_close ''
>   free__ogl''      NB. force new rc
> catch.
> end.
> wd OPENGL
> wdmove _1 0
> if. 0=#ogl do.
>   ogl=: ''conew'jzopengl'
>   wd'setfocus g'
> end.
> wd'pcenter;pshow;'
> yw 0  NB. this is a startup command for my app
> )
> 
> OPENGL=: 0 : 0
> pc opengl closeok;pn tgsj;
> xywh 0 0 200 150;cc g isigraph opengl rightmove bottommove;
> pas 0 0;
> rem form end;
> )
> 
> 
> (B=)
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm

-- 
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to