mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 19:08:55 -04:00
support multiple windows
This commit is contained in:
parent
f96387e291
commit
b62a19c614
@ -41,6 +41,8 @@
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
TypeHandle wglGraphicsWindow::_type_handle;
|
TypeHandle wglGraphicsWindow::_type_handle;
|
||||||
|
|
||||||
|
static bool wc_registered = false;
|
||||||
|
|
||||||
#define MOUSE_ENTERED 0
|
#define MOUSE_ENTERED 0
|
||||||
#define MOUSE_EXITED 1
|
#define MOUSE_EXITED 1
|
||||||
|
|
||||||
@ -388,14 +390,17 @@ void wglGraphicsWindow::config(void) {
|
|||||||
_hMouseCursor = LoadCursor(NULL, IDC_ARROW);
|
_hMouseCursor = LoadCursor(NULL, IDC_ARROW);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!wc_registered) {
|
||||||
|
// We only need to register the window class once per session.
|
||||||
wc.hCursor = _hMouseCursor;
|
wc.hCursor = _hMouseCursor;
|
||||||
wc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
|
wc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
|
||||||
wc.lpszMenuName = NULL;
|
wc.lpszMenuName = NULL;
|
||||||
wc.lpszClassName = WGL_WINDOWCLASSNAME;
|
wc.lpszClassName = WGL_WINDOWCLASSNAME;
|
||||||
|
|
||||||
if(!RegisterClass(&wc)) {
|
if(!RegisterClass(&wc)) {
|
||||||
wgldisplay_cat.fatal() << "could not register window class!" << endl;
|
wgldisplay_cat.error() << "could not register window class!" << endl;
|
||||||
exit(1);
|
}
|
||||||
|
wc_registered = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// from MSDN:
|
// from MSDN:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user