31 #if defined(G4INTY_BUILD_WIN32) || defined(G4INTY_USE_WIN32)
38 static char className[] =
"G4Win32";
43 static HWND topWindow = NULL;
45 G4Win32* G4Win32::getInstance (
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);
112 void* G4Win32::GetEvent (
118 BOOL status = ::GetMessage(&event, NULL, 0, 0);
119 if(status==
FALSE)
return NULL;
123 void G4Win32::FlushAndWaitExecution (
129 while ( ::PeekMessage(&event, NULL, 0, 0, PM_REMOVE) ) {
130 ::TranslateMessage(&event);
131 ::DispatchMessage (&event);
135 G4bool G4Win32::DispatchWin32Event (
141 ::TranslateMessage((MSG*)a_event);
142 ::DispatchMessage ((MSG*)a_event);
G4bool(* G4DispatchFunction)(void *)
static MCTruthManager * instance
G4GLOB_DLL std::ostream G4cout