This will use overlay hardware if available on your X server (look
for a SERVER_OVERLAY_VISUALS
property of the root window).
If no hardware support is found the overlay is simulated by drawing directly into the on-screen copy of the double-buffered window, and "erased" by copying the backbuffer over it again. This means the overlay will blink if you change the image in the window.
To allow your program to be portable to machines with overlay hardware, your draw_overlay() method should limit the colors it uses to FL_BLACK (0), FL_WHITE (7), and FL_RED (1), and it may be best to assumme these could all be the same, arbitrary, color.
Fl_Overlay_Window::Fl_Overlay_Window(int W, int H, const char *l=0);
Fl_Overlay_Window::Fl_Overlay_Window(int X, int Y, int W, int H, const char *l);
virtual void Fl_Overlay_Window::draw_overlay() = 0;
void Fl_Overlay_Window::redraw_overlay();