I'm building a Midi visualiser.
Currently I'm drawing rectangles, but I'm thinking about plotting individual pixels.
How to set about doing this efficiently?
I could preallocate a block of memory that doesn't need to be changed until my component resizes.
Then every frame I have to zero it out and redraw pixels. And then somehow display it.
Maybe I should just use an Image?
I'm also a little concerned about my current solution using a (say) 60Hz refresh timer; it is sputttering as it scrolls by -- minuscule little speed bumps that are very noticeable, like suddenly it skips a frame. This behaviour appears to be independent of the complexity within paint(). And it is a fast machine! Is there some lower-level e.g. vsync callback I can/should attach to?
I vaguely remember some standard(?) double buffering technique where the graphics card uses 2 buffers, and periodically switches front and back -- as soon as this switch occurs there should be some callback that gives you a complete frame duration to populate the new back buffer. On iOS several years back this was CADisplayLink. Has JUCE abstracted this concept?
I'm a little reluctant to go the whole hog and GL it, just because it's rather a lot of work and begins a slippery slope towards obsession. So I'm trying to trade off code complexity against performance.