After thinking about this a bit: probably when running webgl code
under the playground, I should be hooking into the close event for the
"popup" containing the canvas and dispose of my webgl constructs.

Conceptually speaking, maybe the browser could do this automatically,
but even if that doesn't run afoul of some webgl or ecmascript or dom
standards that sort of thing might be years in the future.

What would a close event handler look like, here? (I just need a
proof-of-concept with a console.log -- not something which does a
complete cleanup...) Maybe I can figure this out on my own, but if you
have a concrete idea of how to implement that abstraction, that would
be great.

Thanks,

--
Raul

On Sun, Jan 15, 2023 at 7:52 AM Raul Miller <rauldmil...@gmail.com> wrote:
>
> Hmm....
>
> I tried the webgl implementation from
> https://rosettacode.org/wiki/WebGL_rotating_F#J and I got it to work,
> once.
>
> But, closing the webgl subwindow and then trying to run it again did
> not work (instead, it eventually crashed my browser).
>
> I don't know if that's a problem specific to my machine, or if it's a
> playground issue or a browser issue or whatever else.
>
> --
> Raul
>
> On Sun, Jan 15, 2023 at 7:01 AM Joe Bogner <joebog...@gmail.com> wrote:
> >
> > >
> > >
> > > One alternative here might be to create a webserver in J which webview
> > > interacts with (perhaps a jhs variant, though possibly being run from
> > > within jqt). This would involve significant overhead but it might
> > > work...
> >
> >
> > How about the J Playground? I took your code and it was copy/paste to make
> > it run in the J Playground.
> >
> >
> > https://jsoftware.github.io/j-playground/bin/html2/#url=https://gist.githubusercontent.com/joebo/6002c573f08b57c279c1203d7f5c4328/raw/038f37e626813cca56c15c8376edc705a9a3c8d1/jplayground%2520webgl
> >
> >
> > It shows the console.log too
> >
> > You should be able to use the jdo1() from javascript to interact with J
> > and (2!:0) from J to interact with javascript. See UI example in the
> > playground
> >
> > If you go this route I'd like to add it back in as a J Playground example.
> > I'm not familiar enough with webgl to make something interesting
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to