mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 01:44:06 -04:00
slightly more robust handling of CallbackGraphicsWindow
This commit is contained in:
parent
279b3a8aeb
commit
fdca621619
@ -230,6 +230,15 @@ bool CallbackGraphicsWindow::
|
||||
open_window() {
|
||||
// In this case, we assume the callback has handled the window
|
||||
// opening.
|
||||
|
||||
// We also assume the callback has given us an accurate
|
||||
// FramebufferProperties, but we do go ahead and assume some certain
|
||||
// minimum properties.
|
||||
_fb_properties.set_rgb_color(1);
|
||||
|
||||
if (_fb_properties.get_color_bits() == 0) {
|
||||
_fb_properties.set_color_bits(16);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -416,6 +416,8 @@ make_output(GraphicsPipe *pipe,
|
||||
if ((precertify) && (gsg != 0) && (window->get_gsg()==gsg)) {
|
||||
do_add_window(window, threading_model);
|
||||
do_add_gsg(window->get_gsg(), pipe, threading_model);
|
||||
display_cat.info()
|
||||
<< "Created output of type " << window->get_type() << "\n";
|
||||
return window;
|
||||
}
|
||||
do_add_window(window, threading_model);
|
||||
|
@ -937,6 +937,14 @@ make_texture_buffer(const string &name, int x_size, int y_size,
|
||||
flags, get_gsg(), get_host());
|
||||
|
||||
if (buffer != (GraphicsOutput *)NULL) {
|
||||
if (buffer->get_gsg() == (GraphicsStateGuardian *)NULL ||
|
||||
buffer->get_gsg()->get_prepared_objects() != get_gsg()->get_prepared_objects()) {
|
||||
// If the newly-created buffer doesn't share texture objects
|
||||
// with the current GSG, then we will have to force the texture
|
||||
// copy to go through RAM.
|
||||
to_ram = true;
|
||||
}
|
||||
|
||||
buffer->add_render_texture(tex, to_ram ? RTM_copy_ram : RTM_bind_or_copy);
|
||||
return buffer;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user