fixed failure to clear one-short buffer

This commit is contained in:
David Rose 2005-03-01 06:39:50 +00:00
parent 5ea397873d
commit c5737877bd

View File

@ -107,8 +107,6 @@ end_frame() {
nassertv(_gsg != (GraphicsStateGuardian *)NULL);
_gsg->end_frame();
if (_copy_texture) {
wglGraphicsStateGuardian *wglgsg;
DCAST_INTO_V(wglgsg, _gsg);
@ -126,6 +124,7 @@ end_frame() {
}
}
if (_copy_texture) {
nassertv(has_texture());
Texture *tex = get_texture();
@ -146,10 +145,29 @@ end_frame() {
// texture. This is an older interface that guarantees a copy
// operation will take place, and it might even require
// reformatting pixels on the way, so it may be slower.
if (display_cat.is_debug()) {
display_cat.debug()
<< "Copying texture for " << (void *)this << " at frame end.\n";
}
PStatTimer timer(_copy_texture_pcollector);
RenderBuffer buffer = wglgsg->get_render_buffer(get_draw_buffer_type());
wglgsg->copy_texture(tex, _default_display_region, buffer);
}
}
// If we're not single-buffered, we're now ready to flip.
if (!_gsg->get_properties().is_single_buffered()) {
_flip_ready = true;
}
if (_one_shot && !show_buffers) {
// In one-shot mode, we request the GraphicsEngine to delete the
// window after we have rendered a frame. But when show-buffers
// mode is enabled, we don't do this, to give the user a chance to
// see the output.
_active = false;
_delete_flag = true;
}
}
////////////////////////////////////////////////////////////////////