31#if defined(G4INTY_BUILD_WIN32) || defined(G4INTY_USE_WIN32)
38static char className[] =
"G4Win32";
40G4Win32* G4Win32::instance = NULL;
43static HWND topWindow = NULL;
45G4Win32* G4Win32::getInstance (
51 instance =
new G4Win32();
61 if(Win32Inited==
FALSE) {
64 wc.style = CS_HREDRAW | CS_VREDRAW;
65 wc.lpfnWndProc = (WNDPROC)DefWindowProc;
68 wc.hInstance = ::GetModuleHandle(NULL);
69 wc.hIcon = LoadIcon (NULL,IDI_APPLICATION);
70 wc.hCursor = LoadCursor(NULL,IDC_ARROW);
71 wc.hbrBackground = GetStockBrush(BLACK_BRUSH);
72 wc.lpszMenuName = className;
73 wc.lpszClassName = className;
74 ::RegisterClass (&wc);
76 topWindow = ::CreateWindow(className,className,
78 CW_USEDEFAULT, 0, CW_USEDEFAULT, 0,
80 ::GetModuleHandle(NULL),
84 G4cout <<
"G4Win32 : Unable to create Win32 window." <<
G4endl;
91 SetMainInteractor(topWindow);
112void* G4Win32::GetEvent (
118 BOOL status = ::GetMessage(&event, NULL, 0, 0);
119 if(status==
FALSE)
return NULL;
123void G4Win32::FlushAndWaitExecution (
129 while ( ::PeekMessage(&event, NULL, 0, 0, PM_REMOVE) ) {
130 ::TranslateMessage(&event);
131 ::DispatchMessage (&event);
135G4bool G4Win32::DispatchWin32Event (
141 ::TranslateMessage((MSG*)a_event);
142 ::DispatchMessage ((MSG*)a_event);
G4bool(* G4DispatchFunction)(void *)
G4DLLIMPORT std::ostream G4cout