support window-type offscreen better

This commit is contained in:
David Rose 2009-03-10 20:43:33 +00:00
parent babf0163e5
commit ba30db6953
3 changed files with 18 additions and 6 deletions

View File

@ -4926,7 +4926,7 @@ set_read_buffer(int rbtype) {
break;
default:
GLP(ReadBuffer)(GL_FRONT_AND_BACK);
break;
}
}

View File

@ -282,6 +282,8 @@ open_buffer() {
// So always use a single-buffered gsg.
_fb_properties.set_back_buffers(0);
_draw_buffer_type = RenderBuffer::T_front;
_screenshot_buffer_type = RenderBuffer::T_front;
// GSG creation/initialization.

View File

@ -189,19 +189,27 @@ make_output(const string &name,
// Third thing to try: a wglGraphicsBuffer
if (retry == 2) {
if ((!support_rtt)||
((flags&BF_require_parasite)!=0)||
((flags&BF_require_window)!=0)||
((flags&BF_rtt_cumulative)!=0)||
((flags&BF_can_bind_every)!=0)) {
if (((flags&BF_require_parasite)!=0)||
((flags&BF_require_window)!=0)) {
return NULL;
}
if (!support_rtt) {
if (((flags&BF_rtt_cumulative)!=0)||
((flags&BF_can_bind_every)!=0)) {
// If we require Render-to-Texture, but can't be sure we
// support it, bail.
return NULL;
}
}
// Early failure - if we are sure that this buffer WONT
// meet specs, we can bail out early.
if ((flags & BF_fb_props_optional) == 0) {
if ((fb_prop.get_aux_rgba() > 0)||
(fb_prop.get_aux_rgba() > 0)||
(fb_prop.get_aux_float() > 0)) {
cerr << "b\n";
return NULL;
}
}
@ -213,8 +221,10 @@ make_output(const string &name,
(wglgsg->pfnum_supports_pbuffer()) &&
(wglgsg->get_fb_properties().subsumes(fb_prop))&&
(wglgsg->get_fb_properties().is_single_buffered())) {
cerr << "c\n";
precertify = true;
}
cerr << "d\n";
return new wglGraphicsBuffer(engine, this, name, fb_prop, win_prop,
flags, gsg, host);
}