|
Hi all !
In a recent project, I have a small issue with Swing-based JOGL.
Basically, I want the program to keep runing (as in : keep launching the display() function when panel.repaint() is called) even when the window is minimized (in the task bar).
For now, eveything works, as in the rendering works when the window is visible, whether focused or not, but not when minimized.
My setup is :
- a GLJPanel linked to a GLEventListener.
- a run() function that every 10ms or so calls panel.repaint(), which then internally calls the GLEventListener's display(GLAutoDrawable displayable) function, on which the screen is rendered.
Here is the GLJPanel construction script :
PROFILE = GLProfile.get(GLProfile.GL2);
CAPABILITIES = new GLCapabilities(PROFILE);
CAPABILITIES.setSampleBuffers(true);
CAPABILITIES.setNumSamples(currentAntialiasingLevel);
CAPABILITIES.setStencilBits(8);
CAPABILITIES.setPBuffer(true);
panel = new GLJPanel(CAPABILITIES);
listener = new SPanelListener(this, panel);
panel.addGLEventListener(listener);
panel.setSize(width, height);
frame = new SFrame(this, width, height);
and here is the SFrame constructor (that extends JFrame) :
super();
this.context = context;
this.setVisible(true);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setSize(width, height);
context.focused = this.isFocused();
focusListener = new SFocusListener(context);
this.addFocusListener(focusListener);
this.setContentPane(context.getPanel());
Note that I know that the panel.repaint() function is called when minimized, only the subsequent display() function is not.
Does anyone have any lead ? Thanks !
|