> _______________________________________ > From: ext Niels Roest [ni...@directfb.org] > Sent: Saturday, March 27, 2010 3:16 AM > To: Bakken Anders (Nokia-D-Qt/RedwoodCity) > Cc: directfb-dev@directfb.org > Subject: Re: [directfb-dev] single buffered windows > > How come you have double buffered windows? > Afaik, windows are default single buffered. > If you change the content of a window, the layer buffer is only updated > when you do a window->Flip after your change - this copies the updated > area from the window buffer to the layer buffer (generally the back > buffer followed by a implicit flip, if your layer is double buffered) > > Greets > Niels
Hi Niels That seems to what DirectFB is giving me. I use the attached example and the output is: 12 DSCAPS_DOUBLE 1 This is running 1.4.3 and system=x11 regards Anders
#include <directfb.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #include <unistd.h> #define TEST(call) { result = call; if (result != DFB_OK) { func = #call; goto end; } } const char *func = 0; DFBResult result = DFB_OK; template <typename T> class Pointer { public: Pointer(T *tt = 0) : t(tt) {} ~Pointer() { if (t) t->Release(t); } operator T*() { return t; } T **operator&() { return &t; } T *operator->() { return t; } private: T *t; }; int main(int argc, char **argv) { enum { Width = 1000, Height = 1000 }; Pointer<IDirectFB> dfb; Pointer<IDirectFBDisplayLayer> layer; Pointer<IDirectFBWindow> window; Pointer<IDirectFBSurface> windowSurface; DFBSurfaceCapabilities caps; DFBWindowDescription windowDescription; windowDescription.flags = DFBWindowDescriptionFlags(DWDESC_WIDTH|DWDESC_HEIGHT|DWDESC_POSX|DWDESC_POSY); windowDescription.posx = 0; windowDescription.posy = 0; windowDescription.width = Width; windowDescription.height = Height; TEST(DirectFBInit(&argc, &argv)); TEST(DirectFBCreate(&dfb)); TEST(dfb->GetDisplayLayer(dfb, DLID_PRIMARY, &layer)); TEST(layer->CreateWindow(layer, &windowDescription, &window)); TEST(window->SetOpacity(window, 255)); TEST(window->GetSurface(window, &windowSurface)); TEST(windowSurface->GetCapabilities(windowSurface, &caps)); printf("%0x DSCAPS_DOUBLE %d\n", caps, bool(caps & DSCAPS_DOUBLE)); TEST(windowSurface->Clear(windowSurface, 0, 0, 0, 255)); end: if (result != DFB_OK) DirectFBError(func, result); return 0; }
_______________________________________________ directfb-dev mailing list directfb-dev@directfb.org http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev