wxIDirectFBSurfacePtr wxIDirectFB::GetPrimarySurface() { DFBSurfaceDescription desc; desc.flags = DSDESC_CAPS; // NB: see dcscreen.cpp for why we request double-buffered surface // // This assumes the cooperative level is DFSCL_NORMAL (that's the // default and wx doesn't modify it anywhere); if we ever support // other cooperative levels, DSCAPS_DOUBLE should *not* be used with // them. desc.caps = DFBSurfaceCapabilities(DSCAPS_PRIMARY | DSCAPS_DOUBLE); return CreateSurface(&desc); }
int main(int argc, char **argv) { argc = 2; argv[1] = "--dfb:vt-num=1,quiet"; DFBSurfaceDescription dsc; DFBCHECK(DirectFBInit (&argc, &argv)); DFBCHECK(DirectFBCreate (&dfb)); DFBCHECK(dfb->SetCooperativeLevel (dfb, DFSCL_FULLSCREEN)); dsc.flags = DSDESC_CAPS; dsc.caps = DFBSurfaceCapabilities(DSCAPS_PRIMARY | DSCAPS_FLIPPING); DFBCHECK(dfb->CreateSurface( dfb, &dsc, &primary )); DFBCHECK(primary->GetSize (primary, &screen_width, &screen_height)); DFBCHECK(primary->FillRectangle (primary, 0, 0, screen_width, screen_height)); DFBCHECK(primary->SetColor (primary, 0x80, 0x80, 0xff, 0xff)); DFBCHECK(primary->DrawLine (primary, 0, screen_height / 2, screen_width - 1, screen_height / 2)); primary->Flip(primary, NULL, DFBSurfaceFlipFlags(0)); //sleep(5); primary->Release(primary); dfb->Release(dfb); return 23; }