report frame buffer properties more accurately

This commit is contained in:
David Rose 2004-12-30 02:04:37 +00:00
parent d7a1415b8c
commit bf70f96471
2 changed files with 20 additions and 10 deletions

View File

@ -96,7 +96,26 @@ make_gsg(const FrameBufferProperties &properties,
DCAST_INTO_R(share_gsg, share_with, NULL);
}
return new OSMesaGraphicsStateGuardian(properties, share_gsg);
// We ignore the requested properties; OSMesa contexts are all the
// same.
FrameBufferProperties mesa_props;
int frame_buffer_mode =
FrameBufferProperties::FM_rgba |
FrameBufferProperties::FM_single_buffer |
FrameBufferProperties::FM_accum |
FrameBufferProperties::FM_depth |
FrameBufferProperties::FM_stencil |
FrameBufferProperties::FM_software;
mesa_props.set_frame_buffer_mode(frame_buffer_mode);
mesa_props.set_color_bits(24);
mesa_props.set_alpha_bits(8);
mesa_props.set_stencil_bits(8);
mesa_props.set_depth_bits(8);
return new OSMesaGraphicsStateGuardian(mesa_props, share_gsg);
}
////////////////////////////////////////////////////////////////////

View File

@ -37,15 +37,6 @@ OSMesaGraphicsStateGuardian(const FrameBufferProperties &properties,
}
_context = OSMesaCreateContext(OSMESA_RGBA, share_context);
// I think OSMesa always creates single-buffered contexts. I don't
// see any documentation to this effect, but it seems to be the
// case.
FrameBufferProperties props = get_properties();
int mode = props.get_frame_buffer_mode();
mode = (mode & ~FrameBufferProperties::FM_buffer) | FrameBufferProperties::FM_single_buffer;
props.set_frame_buffer_mode(mode);
set_properties(props);
}
////////////////////////////////////////////////////////////////////