Re: [Jprogramming] Locale + gl2 + Timer Mystery

2023-03-08 Thread Ed Gottsman
Henry,

Thanks for the fast and helpful reply.  The problem was that I’m using an 
isigraph and need to wait for a system-generated “paint” event—I had no 
business calling my paint routine directly from the timer callback.  It’s 
actually a minor miracle that it worked at all.  Changing the callback to 
invalidate the isigraph control (and do nothing else) fixed the problem.  (And 
I am in fact getting 30 fps despite thousands of gl2 calls per frame.  Kudos to 
the appropriate developers.)

Thanks again.

Ed


> On Mar 8, 2023, at 2:17 PM, Henry Rich  wrote:
> 
> The mouseMove handler would have the form selected.  Perhaps you need to 
> select the form, and glselect the isigraph, inside your timer?
> 
> paint_base_ ''
> 
> is the preferable way to change locales.
> 
> Henry Rich
> 
> On 3/8/2023 2:45 PM, Ed Gottsman wrote:
>> Hello.  I’ve got a timer firing a callback routine (in the z locale, of 
>> course) that in turn needs to call a paint routine in the base locale.  I’ve 
>> tried
>> 
>> sys_timer_z_ =: 3 : 0
>> cocurrent <‘base'
>> paint ‘'
>> )
>> 
>> …as well as
>> 
>> sys_timer_z_ =: 3 : 0
>> paint_base_ ''
>> )
>> 
>> Both work, actually, in that they call paint…except:
>> 
>> The paint routine makes a series of gl2 calls.  All of them work, too.  The 
>> only problem is that the first gl2 call (it doesn’t seem to matter what gl2 
>> routine is being called) prints:
>> 
>> |domain error: chkgl2
>> |   glfill 255 255 255 255
>> 
>> …to the terminal.  (In this case, the first call was to glfill.). This would 
>> not be a serious problem except that I’m doing animation and shooting for 30 
>> fps.  Flooding the terminal with spurious gl2 errors will make other debug 
>> output difficult to find.
>> 
>> Note that I call the same paint routine from a mouseMove event handler 
>> (interim solution)—in which case no gl2 error message is printed.  That’s 
>> why I wonder about locales and the timer.
>> 
>> Am I missing something obvious?
>> 
>> Thanks.
>> 
>> Ed
>> --
>> For information about J forums see http://www.jsoftware.com/forums.htm
> 
> --
> For information about J forums see http://www.jsoftware.com/forums.htm

--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] Locale + gl2 + Timer Mystery

2023-03-08 Thread Henry Rich
The mouseMove handler would have the form selected.  Perhaps you need to 
select the form, and glselect the isigraph, inside your timer?


paint_base_ ''

is the preferable way to change locales.

Henry Rich

On 3/8/2023 2:45 PM, Ed Gottsman wrote:

Hello.  I’ve got a timer firing a callback routine (in the z locale, of course) 
that in turn needs to call a paint routine in the base locale.  I’ve tried

sys_timer_z_ =: 3 : 0
cocurrent <‘base'
paint ‘'
)

…as well as

sys_timer_z_ =: 3 : 0
paint_base_ ''
)

Both work, actually, in that they call paint…except:

The paint routine makes a series of gl2 calls.  All of them work, too.  The 
only problem is that the first gl2 call (it doesn’t seem to matter what gl2 
routine is being called) prints:

|domain error: chkgl2
|   glfill 255 255 255 255

…to the terminal.  (In this case, the first call was to glfill.). This would 
not be a serious problem except that I’m doing animation and shooting for 30 
fps.  Flooding the terminal with spurious gl2 errors will make other debug 
output difficult to find.

Note that I call the same paint routine from a mouseMove event handler (interim 
solution)—in which case no gl2 error message is printed.  That’s why I wonder 
about locales and the timer.

Am I missing something obvious?

Thanks.

Ed
--
For information about J forums see http://www.jsoftware.com/forums.htm


--
For information about J forums see http://www.jsoftware.com/forums.htm


[Jprogramming] Locale + gl2 + Timer Mystery

2023-03-08 Thread Ed Gottsman
Hello.  I’ve got a timer firing a callback routine (in the z locale, of course) 
that in turn needs to call a paint routine in the base locale.  I’ve tried 

sys_timer_z_ =: 3 : 0
cocurrent <‘base'
paint ‘'
)

…as well as

sys_timer_z_ =: 3 : 0
paint_base_ ''
)

Both work, actually, in that they call paint…except:

The paint routine makes a series of gl2 calls.  All of them work, too.  The 
only problem is that the first gl2 call (it doesn’t seem to matter what gl2 
routine is being called) prints:

|domain error: chkgl2
|   glfill 255 255 255 255

…to the terminal.  (In this case, the first call was to glfill.). This would 
not be a serious problem except that I’m doing animation and shooting for 30 
fps.  Flooding the terminal with spurious gl2 errors will make other debug 
output difficult to find.  

Note that I call the same paint routine from a mouseMove event handler (interim 
solution)—in which case no gl2 error message is printed.  That’s why I wonder 
about locales and the timer.

Am I missing something obvious?

Thanks.

Ed
--
For information about J forums see http://www.jsoftware.com/forums.htm