View Single Post
Old 08-09-2018, 03:13 AM   #1
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default SWELL/GDI and LICE: Is it possible to draw inside REAPER's window without flickering?

I am currently experimenting with using GDI to draw basic stuff such as lines and text inside REAPER's windows.

The script is deferred, and it updates the graphics in each cycle.

Everything seems to work fine, except that the GDI-drawn graphics flicker. This is not unexpected, since REAPER and the script update their stuff separately.

Is there a way to avoid this flickering? In each defer cycle, I somehow need to block the window from rendering until the script has added its GDI graphics.

I have tried blocking WM_PAINT messages, and this does indeed stop the window from updating, but then I can't get it to paint again by calling InvalidateRect/UpdateWindow after adding the script graphics, or by sending WM_PAINT myself (and the Win32 documentation warns against sending WM_PAINT messages).
juliansader is offline   Reply With Quote