mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 09:23:03 -04:00
Fix crash that may occur when handle_reshape in called before the window is fully created.
Not sure if this affects any renderer but the tinydisplay renderer.
This commit is contained in:
parent
8a5f07f9c3
commit
b19ff5b10e
@ -251,8 +251,10 @@ open_window() {
|
|||||||
void TinyWinGraphicsWindow::
|
void TinyWinGraphicsWindow::
|
||||||
handle_reshape() {
|
handle_reshape() {
|
||||||
WinGraphicsWindow::handle_reshape();
|
WinGraphicsWindow::handle_reshape();
|
||||||
ZB_resize(_frame_buffer, NULL, _properties.get_x_size(), _properties.get_y_size());
|
if (_frame_buffer != NULL) {
|
||||||
setup_bitmap_info();
|
ZB_resize(_frame_buffer, NULL, _properties.get_x_size(), _properties.get_y_size());
|
||||||
|
setup_bitmap_info();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
@ -107,6 +107,8 @@ void
|
|||||||
ZB_resize(ZBuffer * zb, void *frame_buffer, int xsize, int ysize) {
|
ZB_resize(ZBuffer * zb, void *frame_buffer, int xsize, int ysize) {
|
||||||
int size;
|
int size;
|
||||||
|
|
||||||
|
nassertv(zb != NULL);
|
||||||
|
|
||||||
/* xsize must be a multiple of 4 */
|
/* xsize must be a multiple of 4 */
|
||||||
xsize = (xsize + 3) & ~3;
|
xsize = (xsize + 3) & ~3;
|
||||||
|
|
||||||
|
@ -26,8 +26,6 @@
|
|||||||
|
|
||||||
#include <tchar.h>
|
#include <tchar.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TypeHandle WinGraphicsWindow::_type_handle;
|
TypeHandle WinGraphicsWindow::_type_handle;
|
||||||
TypeHandle WinGraphicsWindow::WinWindowHandle::_type_handle;
|
TypeHandle WinGraphicsWindow::WinWindowHandle::_type_handle;
|
||||||
|
|
||||||
@ -1489,7 +1487,10 @@ window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) {
|
|||||||
<< "WM_SIZE: " << hwnd << ", " << wparam << "\n";
|
<< "WM_SIZE: " << hwnd << ", " << wparam << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
handle_reshape();
|
// Resist calling handle_reshape before the window has opened.
|
||||||
|
if (_hWnd == NULL) {
|
||||||
|
handle_reshape();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_EXITSIZEMOVE:
|
case WM_EXITSIZEMOVE:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user