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);
panel = new GLJPanel(CAPABILITIES);
listener = new SPanelListener(this, panel);
frame = new SFrame(this, width, height);
and here is the SFrame constructor (that extends JFrame) :
Re: GLJPanel and displaying with a minimized window
In this specific project I'm already using Render-to-Texture, and as far as I understand, off-screen rendering basically works the same but by attaching RenderBuffers to the FrameBuffer (right?).
If so, since the display() function itself isn't called, how can the image be rendered, even off-screen? If the display() function were to be called but an error message was raised then I'd understand why using off-screen rendering, but in this case since the display() function altogether isn't called, I can't even tell OpenGL to perform off-screen rendering (btw, I'm actually planning to use off-screen rendering later on, so it will be implemented later on anyways, I just want to be sure that it will be able to solve the issue).
The issue is that the display function also holds all the processing that needs to be done at each frame, and that includes non-rendering operations that need to be made whether the screen is rendered or not.