Show
Ignore:
Timestamp:
03/09/09 10:39:55 (5 years ago)
Author:
shuber
Message:

Fix for multiple windows on different screens. the coords of windows are now local to the screen, as in other implementations.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/branches/osg-cocoa-dev/src/osgViewer/DarwinUtils.mm

    r9845 r9870  
    295295} 
    296296 
    297          
    298  
    299  
    300  
    301  
    302  
    303  
    304 } 
     297 
     298unsigned int DarwinWindowingSystemInterface::getScreenContaining(int x, int y, int w, int h) 
     299{ 
     300        CGRect rect = CGRectMake(x,y,w,h); 
     301        for(unsigned int i = 0; i < _displayCount; ++i) { 
     302                CGRect bounds = CGDisplayBounds( getDisplayID(i) ); 
     303                if (CGRectIntersectsRect(bounds, rect)) { 
     304                        return i; 
     305                } 
     306        } 
     307         
     308        return 0; 
     309} 
     310 
     311 
     312 
     313 
     314 
     315 
     316}