diff options
author | jcid <devnull@localhost> | 2008-10-09 15:26:45 +0200 |
---|---|---|
committer | jcid <devnull@localhost> | 2008-10-09 15:26:45 +0200 |
commit | 4fea52451363423ccb2ddb74f374f265f38b1755 (patch) | |
tree | 6bf82be1582627de70043325db6b84e8daca9da9 /dw | |
parent | 7ed06b326e8dbffd2af13ea3061576046ac1f2d4 (diff) |
- Added the double-buffer as preference patch.
Diffstat (limited to 'dw')
-rw-r--r-- | dw/fltkviewbase.cc | 13 | ||||
-rw-r--r-- | dw/fltkviewbase.hh | 1 |
2 files changed, 11 insertions, 3 deletions
diff --git a/dw/fltkviewbase.cc b/dw/fltkviewbase.cc index fbbd15bd..ff433a45 100644 --- a/dw/fltkviewbase.cc +++ b/dw/fltkviewbase.cc @@ -50,11 +50,9 @@ FltkViewBase::FltkViewBase (int x, int y, int w, int h, const char *label): lastDraw = time(0); drawDelay = 2; /* in seconds */ mouse_x = mouse_y = 0; -#ifndef NO_DOUBLEBUFFER - if (!backBuffer) { + if (backBuffer == NULL) { backBuffer = new Image (); } -#endif } FltkViewBase::~FltkViewBase () @@ -62,6 +60,15 @@ FltkViewBase::~FltkViewBase () cancelQueueDraw (); } +void FltkViewBase::setBufferedDrawing (bool b) { + if (b && backBuffer == NULL) { + backBuffer = new Image (); + } else if (!b && backBuffer != NULL) { + delete backBuffer; + backBuffer = NULL; + } +} + void FltkViewBase::draw () { int d = damage (); diff --git a/dw/fltkviewbase.hh b/dw/fltkviewbase.hh index 09bcce39..fcc2b43d 100644 --- a/dw/fltkviewbase.hh +++ b/dw/fltkviewbase.hh @@ -75,6 +75,7 @@ public: core::View *getClippingView (int x, int y, int width, int height); void mergeClippingView (core::View *clippingView); + void setBufferedDrawing (bool b); }; |