openGLRenderer & 2D drawing

I considered trying to make a translucent OpenGL window that sits on top of my app window, but every thread I found about it basically says “bake your window into a background image and draw that as your OGL background”, which doesn’t solve the problem of the lag between the cursor and the rectangle being drawn.

For what it’s worth, if I stick with plain old MessageManager-based paint() rendering without a timer, and call repaint() in each mouseListener method being overridden, there is no lag between the cursor and the rectangle.

i.e.

void mouseMove(const MouseEvent& event)
{
    mouseRect.setXY( event.getPosition() );
    repaint();
}

It seems that the issue is the timing difference between when OGL repaints continually (or when a 60hz timer fires) and when the Operating System sends out MouseListener events. It’s almost like the OGL thread repaints are delayed by 50-100ms, compared to when mouseListener events arrive… I’m not sure though.

I would love to know the proper answer though. A way to combine 60hz background animation with however fast the OS repaints when it’s not on a timer. Any ideas @jonathonracz @jules @t0m @fabian or any other pros? I know @yairadix talked about it in this thread: Transparent OpenGL Component but that uses the same ‘bake it to a background image’ approach. his SurferEQ2 plugin is cool though. I haven’t checked if there are lags between the cursor and GUI response if he’s doing that image baking trick though…

it appears that his plugin does not have gui lag, based on the youtube video for it.