NSOpenGLPFADoubleBuffer was commented out, so DoubleBuffered:=True on the
control was silently ignored and the context stayed single-buffered.
LOpenGLSwapBuffers then only called glFlush(), leaving the front buffer on
screen mid-draw: frames tore and views could show partially rendered content.
Request the double-buffer pixel format when DoubleBuffered is set, and present
through NSOpenGLContext.flushBuffer. Falls back to glFlush() when no context
exists yet.
Note: this is a correctness fix, not a performance one -- measured on an M1 Pro
the app's CPU usage is unchanged.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>