fix Tut-Fireflies demo (problem with initially zero-sized buffers)

This commit is contained in:
David Rose 2012-02-12 21:40:16 +00:00
parent 4820b4a2db
commit 841bfb0743
3 changed files with 15 additions and 1 deletions

View File

@ -444,6 +444,7 @@ make_output(GraphicsPipe *pipe,
} else {
display_cat.info()
<< window->get_type() << " wouldn't open; abandoning.\n";
cerr << window->get_fb_properties() << "\n";
}
// No good; delete the window and keep trying.

View File

@ -98,6 +98,12 @@ GraphicsOutput(GraphicsEngine *engine, GraphicsPipe *pipe,
_y_size = win_prop.get_y_size();
_is_nonzero_size = (_x_size > 0 && _y_size > 0);
}
if (_creation_flags & GraphicsPipe::BF_size_track_host) {
// If we're tracking the host size, we assume we'll be nonzero
// eventually.
_is_nonzero_size = true;
}
_is_valid = false;
_flip_ready = false;
_cube_map_index = -1;

View File

@ -157,7 +157,14 @@ begin_frame(FrameMode mode, Thread *current_thread) {
_needs_rebuild = true;
}
}
if (_creation_flags & GraphicsPipe::BF_size_track_host) {
if ((_host->get_x_size() != _x_size)||
(_host->get_y_size() != _y_size)) {
// We also need to rebuild if we need to change size.
_needs_rebuild = true;
}
}
rebuild_bitplanes();
if (_needs_rebuild) {