mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 19:08:55 -04:00
allow multiple windows
This commit is contained in:
parent
b62a19c614
commit
672e42b304
@ -45,6 +45,8 @@
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
TypeHandle wdxGraphicsWindow::_type_handle;
|
TypeHandle wdxGraphicsWindow::_type_handle;
|
||||||
|
|
||||||
|
static bool wc_registered = false;
|
||||||
|
|
||||||
#define LAST_ERROR 0
|
#define LAST_ERROR 0
|
||||||
#define ERRORBOX_TITLE "Panda3D Error"
|
#define ERRORBOX_TITLE "Panda3D Error"
|
||||||
#define WDX_WINDOWCLASSNAME "wdxDisplay"
|
#define WDX_WINDOWCLASSNAME "wdxDisplay"
|
||||||
@ -934,14 +936,17 @@ void wdxGraphicsWindow::config(void) {
|
|||||||
_hMouseCursor = LoadCursor(NULL, IDC_ARROW);
|
_hMouseCursor = LoadCursor(NULL, IDC_ARROW);
|
||||||
}
|
}
|
||||||
|
|
||||||
wc.hCursor = _hMouseCursor;
|
if (!wc_registered) {
|
||||||
wc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
|
// We only need to register the window class once per session.
|
||||||
wc.lpszMenuName = NULL;
|
wc.hCursor = _hMouseCursor;
|
||||||
wc.lpszClassName = WDX_WINDOWCLASSNAME;
|
wc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
|
||||||
|
wc.lpszMenuName = NULL;
|
||||||
if(!RegisterClass(&wc)) {
|
wc.lpszClassName = WDX_WINDOWCLASSNAME;
|
||||||
wdxdisplay_cat.fatal() << "could not register window class!" << endl;
|
|
||||||
exit(1);
|
if(!RegisterClass(&wc)) {
|
||||||
|
wdxdisplay_cat.error() << "could not register window class!" << endl;
|
||||||
|
}
|
||||||
|
wc_registered = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD window_style = WS_POPUP | WS_SYSMENU; // for CreateWindow
|
DWORD window_style = WS_POPUP | WS_SYSMENU; // for CreateWindow
|
||||||
|
Loading…
x
Reference in New Issue
Block a user