cbDown(SDL_CreateRGBSurfaceFrom(&closeBoxDown[4], cbWidth, cbHeight, 32, cbWidth * 4,
MASK_R, MASK_G, MASK_B, MASK_A)),
cbHover(SDL_CreateRGBSurfaceFrom(&closeBoxHover[4], cbWidth, cbHeight, 32, cbWidth * 4,
- MASK_R, MASK_G, MASK_B, MASK_A))
+ MASK_R, MASK_G, MASK_B, MASK_A)), drawBackground(true)
{
//Could probably move this into the initializer list as well...
// closeButton = new Button(w - (cbWidth + 1), 1, cbUp, cbHover, cbDown, this);
for(uint32 i=0; i<list.size(); i++)
list[i]->Draw();
#else
- // These are *always* top level and parentless, so no need to traverse up through
- // the parent chain...
- SDL_FillRect(screen, &extents, bgColor);
+ if (drawBackground)
+ {
+ // These are *always* top level and parentless, so no need to traverse up through
+ // the parent chain...
+ SDL_FillRect(screen, &extents, bgColor);
+ }
+ else
+ RestoreScreenFromBackstore();
// Handle the items this window contains...
for(uint32 i=0; i<list.size(); i++)
list.push_back(closeButton);
}
}
+
+void Window::SetBackgroundDraw(bool state)
+{
+ drawBackground = state;
+}