www.jpct.net

jPCT - a 3d engine for Java => Bugs => Topic started by: Mr_Chaos on August 07, 2017, 08:18:56 pm

Title: AWTCanvas not updating when SwingThread is under heavy load.
Post by: Mr_Chaos on August 07, 2017, 08:18:56 pm
I have a strange problem, normally my program runs fine, but when the EDT thread in under heavy load the AWTCanvas freezes.

The SwingUI is updated, but the AWTCanvas is not.

Has anyone seen anything like this before ?

Code: [Select]
    buffer.clear(frameBufferBGColor);
    world.renderScene(buffer);
    world.draw(buffer);
   
    buffer.update();
       
    buffer.displayGLOnly();
   
   _canvas.repaint();

Title: Re: AWTCanvas not updating when SwingThread is under heavy load.
Post by: EgonOlsen on August 08, 2017, 05:16:54 pm
Not really. How exactly do you define "heavy load" for the EDT?
Title: Re: AWTCanvas not updating when SwingThread is under heavy load.
Post by: Mr_Chaos on August 08, 2017, 10:15:10 pm
Not really. How exactly do you define "heavy load" for the EDT?

That's a good question, we have a table (Jide) which is updated many times each second, and if we sort the table, suddenly the awtcanvas stops updating, but the Swing table still updates
Title: Re: AWTCanvas not updating when SwingThread is under heavy load.
Post by: EgonOlsen on August 09, 2017, 10:28:33 am
That's strange, because they should be in the same thread. Have you checked if they actually are? It is possible to work with different EDT's for different components (albeit that's a pain in the a... but some people won't listen...).

Or...maybe the table is sorted in the EDT, i.e. actually blocking it while doing the repaints by itself?
Title: Re: AWTCanvas not updating when SwingThread is under heavy load.
Post by: Mr_Chaos on August 09, 2017, 07:14:41 pm
That's strange, because they should be in the same thread. Have you checked if they actually are? It is possible to work with different EDT's for different components (albeit that's a pain in the a... but some people won't listen...).

Or...maybe the table is sorted in the EDT, i.e. actually blocking it while doing the repaints by itself?

It's very strange, because all other swing components also still update (we have a JTextField with the current time, and it updates fine).

Any idea how I could debug it ?
Title: Re: AWTCanvas not updating when SwingThread is under heavy load.
Post by: EgonOlsen on August 13, 2017, 06:26:54 pm
You could add an IPaintListener implementation. When used on an AWTGLRenderer, it will be called in the EDT. If that doesn't happen, there's no update being called. If it is, then there's an update but no actual render output.