Render faster than 60hz?

Is there any way to render faster than 60hz?
I’m using an OpenGL context attached to my component, and I can’t get the paint() callbacks to appear at a faster rate, regardless of how fast I’m sending repaint() calls.

Any ideas? Got similar results on 2 different computers, mac and windows.

Not sure why you would want that when you’re limited by the screen’s refresh rate anyways. Plus, it’s wasted energy on low powered devices like mobile.

You’re better off turning vsync on.

The screen refresh rate may actually sometimes be faster than 60hz. :slight_smile:

Also, I’m trying this for things different than audio plugins (such as gaming graphics) where it’s pretty important to paint at a higher refresh rate regardless of how it’s actually displayed on the screen at the very end.

Oh, and for my own learning purposes, too, I’d still like to know how to turn vsync off (and actually get it to turn off…)!

Any ideas, anyone?

Don’t hammer your Component instance with repaint() calls. That will throttle it to whatever the OS’s paint queueing limits it to.

Instead, on your OpenGLContext object call setSwapInterval (0) to disable vsync (note that your platform will return false if it doesn’t support disabling vsync) followed by setContinuousRepainting (true). This should allow your OpenGL context to break free from the OS’s paint queue and talk straight to the driver at a much higher refresh rate.

1 Like