diff --git a/panda/src/mesadisplay/osMesaGraphicsPipe.cxx b/panda/src/mesadisplay/osMesaGraphicsPipe.cxx index a9c9f9d7de..93c8157ed6 100644 --- a/panda/src/mesadisplay/osMesaGraphicsPipe.cxx +++ b/panda/src/mesadisplay/osMesaGraphicsPipe.cxx @@ -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); } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/mesadisplay/osMesaGraphicsStateGuardian.cxx b/panda/src/mesadisplay/osMesaGraphicsStateGuardian.cxx index 4529cd8382..70faf7547c 100644 --- a/panda/src/mesadisplay/osMesaGraphicsStateGuardian.cxx +++ b/panda/src/mesadisplay/osMesaGraphicsStateGuardian.cxx @@ -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); } ////////////////////////////////////////////////////////////////////