mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 17:35:34 -04:00
be less aggressive when window is resized or moved
This commit is contained in:
parent
e099c2312e
commit
9dc875c80d
@ -3060,7 +3060,10 @@ reset_d3d_device(D3DPRESENT_PARAMETERS *presentation_params,
|
||||
// Calling this forces all of the textures and vbuffers to be
|
||||
// regenerated. It appears to be necessary on some cards but not
|
||||
// on others.
|
||||
release_all();
|
||||
// release_all();
|
||||
// On second thought, let's try releasing the vertex buffers only.
|
||||
release_all_vertex_buffers();
|
||||
release_all_index_buffers();
|
||||
|
||||
// for windowed mode make sure our format matches the desktop fmt,
|
||||
// in case the desktop mode has been changed
|
||||
|
@ -364,20 +364,24 @@ handle_reshape() {
|
||||
WindowProperties props = get_properties();
|
||||
int x_size = props.get_x_size();
|
||||
int y_size = props.get_y_size();
|
||||
bool resize_succeeded = reset_device_resize_window(x_size, y_size);
|
||||
|
||||
if (wdxdisplay8_cat.is_debug()) {
|
||||
if (!resize_succeeded) {
|
||||
wdxdisplay8_cat.debug()
|
||||
<< "windowed_resize to size: (" << x_size << ", " << y_size
|
||||
<< ") failed due to out-of-memory\n";
|
||||
} else {
|
||||
int x_origin = props.get_x_origin();
|
||||
int y_origin = props.get_y_origin();
|
||||
wdxdisplay8_cat.debug()
|
||||
<< "windowed_resize to origin: (" << x_origin << ", "
|
||||
<< y_origin << "), size: (" << x_size
|
||||
<< ", " << y_size << ")\n";
|
||||
if (_wcontext._presentation_params.BackBufferWidth != x_size ||
|
||||
_wcontext._presentation_params.BackBufferHeight != y_size) {
|
||||
bool resize_succeeded = reset_device_resize_window(x_size, y_size);
|
||||
|
||||
if (wdxdisplay8_cat.is_debug()) {
|
||||
if (!resize_succeeded) {
|
||||
wdxdisplay8_cat.debug()
|
||||
<< "windowed_resize to size: (" << x_size << ", " << y_size
|
||||
<< ") failed due to out-of-memory\n";
|
||||
} else {
|
||||
int x_origin = props.get_x_origin();
|
||||
int y_origin = props.get_y_origin();
|
||||
wdxdisplay8_cat.debug()
|
||||
<< "windowed_resize to origin: (" << x_origin << ", "
|
||||
<< y_origin << "), size: (" << x_size
|
||||
<< ", " << y_size << ")\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user