mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-14 15:56:23 -04:00
new make_output
This commit is contained in:
parent
898f587386
commit
e3b42dd011
@ -437,36 +437,22 @@ make_buffer() {
|
|||||||
// buffers. So request that.
|
// buffers. So request that.
|
||||||
fbprops.set_back_buffers(0);
|
fbprops.set_back_buffers(0);
|
||||||
|
|
||||||
|
WindowProperties winprops;
|
||||||
|
winprops.set_size(1, 1);
|
||||||
|
winprops.set_origin(0, 0);
|
||||||
|
winprops.set_undecorated(true);
|
||||||
|
winprops.set_open(true);
|
||||||
|
winprops.set_z_order(WindowProperties::Z_bottom);
|
||||||
|
|
||||||
// We don't care how big the buffer is; we just need it to manifest
|
// We don't care how big the buffer is; we just need it to manifest
|
||||||
// the GSG.
|
// the GSG.
|
||||||
_buffer = _engine->make_output(_pipe, "buffer", 0, fbprops, 1, 1,
|
_buffer = _engine->make_output(_pipe, "buffer", 0,
|
||||||
GraphicsPipe::BF_refuse_window |
|
fbprops, winprops,
|
||||||
GraphicsPipe::BF_fb_props_optional);
|
GraphicsPipe::BF_fb_props_optional);
|
||||||
_engine->open_windows();
|
_engine->open_windows();
|
||||||
if (_buffer == (GraphicsOutput *)NULL || !_buffer->is_valid()) {
|
if (_buffer == (GraphicsOutput *)NULL || !_buffer->is_valid()) {
|
||||||
if (_buffer != (GraphicsOutput *)NULL) {
|
nout << "Unable to create graphics window.\n";
|
||||||
_engine->remove_window(_buffer);
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
// Couldn't create a buffer; try for a window instead.
|
|
||||||
fbprops = FrameBufferProperties::get_default();
|
|
||||||
_buffer = _engine->make_output(_pipe, "window", 0, fbprops, 1, 1,
|
|
||||||
GraphicsPipe::BF_require_window |
|
|
||||||
GraphicsPipe::BF_fb_props_optional);
|
|
||||||
GraphicsWindow *window = (GraphicsWindow*)_buffer;
|
|
||||||
if (window == (GraphicsWindow *)NULL) {
|
|
||||||
nout << "Unable to create graphics window.\n";
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
WindowProperties props;
|
|
||||||
props.set_size(1, 1);
|
|
||||||
props.set_origin(0, 0);
|
|
||||||
props.set_undecorated(true);
|
|
||||||
props.set_open(true);
|
|
||||||
props.set_z_order(WindowProperties::Z_bottom);
|
|
||||||
window->request_properties(props);
|
|
||||||
_buffer = window;
|
|
||||||
_engine->open_windows();
|
|
||||||
}
|
}
|
||||||
_gsg = _buffer->get_gsg();
|
_gsg = _buffer->get_gsg();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user