mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 08:44:19 -04:00
report frame buffer properties more accurately
This commit is contained in:
parent
d7a1415b8c
commit
bf70f96471
@ -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);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
Loading…
x
Reference in New Issue
Block a user