On 5/31/23 16:46, Jefferson Costa wrote:
Hi all ! :) I'm studying all the codes I can taste 😋 and I noticed many codes have Fl_Window or Fl_Double_Window. Why the difference ? When should I use one or other ?
   Before I describe the difference, lemme just say:
   these days it's best to just always use
Fl_Double_Window.
   It provides flicker free double
buffering which is almost always
   what you want, and pretty much standard on all graphics
hardware.
   (See that link for a description of what double buffering is)
   Fl_Double_Window creates a window that uses double buffering
for all
   drawing inside it, whereas an Fl_Window only uses single
buffer drawing.
   Double buffering uses a bit more resources -- two screen
memory buffers
   instead of just one.
   Back in the mid-1990s when FLTK was first developed, memory of
any kind
   was expensive, and not all computer's graphics cards provided
double
   buffering. So if you wanted a simple program to work on
machines that
   didn't provide double buffering, you'd use Fl_Window.
   But these days double buffering is so common and screen memory
is
   so cheap, double buffering is pretty much standard now, and
has been
   so since the early 2000's.
   Single buffering is sort of like a white board; your audience
sees
   the board as you draw on it.
   Double buffering is like a two sided white board,
where you can show
   a completed drawing to your audience, while your assistant is
at the back,
   making a new drawing the audience can't see while he draws it.
   When the assitant's drawing is done, the white board can be
quickly
   flipped over to show the new drawing. The audience never sees
the
   slow drawing process. The assitant, still at the back, now
sees the old
   image and can erase it and replace it while the audience is
looking at
   the new image.
--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/54fabd57-0d2f-2acd-9061-17a9cc52aabc%40seriss.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/CAL-8oAimLRAA5JRX%3DbsL2kNwt1tv4RqVs_aPrXO_c2zUGdwQVQ%40mail.gmail.com.