- Timestamp:
- 06/12/09 12:00:08 (4 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgViewer/GraphicsWindowCocoa.mm
r10285 r10340 20 20 #include "DarwinUtils.h" 21 21 22 //#define DEBUG_OUT(s) std::cout << "GraphicsWindowCocoa :: " << s << std::endl;23 24 #define DEBUG_OUT(s) ;22 #define DEBUG_OUT(s) std::cout << "GraphicsWindowCocoa :: " << s << std::endl; 23 24 //#define DEBUG_OUT(s) ; 25 25 26 26 static bool s_quit_requested = false; … … 389 389 - (void) mouseMoved:(NSEvent*)theEvent 390 390 { 391 DEBUG_OUT("Mouse moved");392 391 NSPoint converted_point = [self getLocalPoint: theEvent]; 392 DEBUG_OUT("Mouse moved" << converted_point.x << "/" << converted_point.y); 393 393 _win->getEventQueue()->mouseMotion(converted_point.x, converted_point.y); 394 394 } … … 606 606 if (!_win) return; 607 607 608 DEBUG_OUT("middleMouseDown "); 609 608 610 NSPoint converted_point = [self getLocalPoint: theEvent]; 609 611 … … 621 623 { 622 624 if (!_win) return; 625 626 DEBUG_OUT("extraMouseDown btn: " << button_number); 623 627 624 628 NSPoint converted_point = [self getLocalPoint: theEvent]; … … 1037 1041 if (mbc) mbc->detachWindow(this); 1038 1042 1039 if (_window) {1040 [_window close];1041 [_window release];1042 }1043 1044 1043 if (_view) { 1045 1044 [_view setGraphicsWindowCocoa: NULL]; 1046 1045 } 1046 1047 if (_window) { 1048 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 1049 1050 // we have to close + release the window in the main-thread 1051 1052 [_window performSelectorOnMainThread: @selector(close) withObject:NULL waitUntilDone: YES]; 1053 [_window performSelectorOnMainThread: @selector(release) withObject:NULL waitUntilDone: YES]; 1054 [pool release]; 1055 } 1047 1056 1048 1057 _window = NULL; 1049 _view = NULL; 1050 1058 _view = NULL; 1051 1059 } 1052 1060
