src/video/quartz/SDL_QuartzWM.m
changeset 876 9e84d106ec19
parent 779 68c8da837fc0
child 934 af585d6efec8
equal deleted inserted replaced
875:c2ff9786fbba 876:9e84d106ec19
   133 /* Convert SDL coordinate to Cocoa coordinate */
   133 /* Convert SDL coordinate to Cocoa coordinate */
   134 void QZ_PrivateSDLToCocoa (_THIS, NSPoint *p) {
   134 void QZ_PrivateSDLToCocoa (_THIS, NSPoint *p) {
   135 
   135 
   136     if ( CGDisplayIsCaptured (display_id) ) { /* capture signals fullscreen */
   136     if ( CGDisplayIsCaptured (display_id) ) { /* capture signals fullscreen */
   137     
   137     
   138         p->y = CGDisplayPixelsHigh (display_id) - p->y - 1;
   138         p->y = CGDisplayPixelsHigh (display_id) - p->y;
   139     }
   139     }
   140     else {
   140     else {
   141         
   141         
   142         NSPoint newPoint;
   142         NSPoint newPoint;
   143         
   143         
   150 /* Convert Cocoa coordinate to SDL coordinate */
   150 /* Convert Cocoa coordinate to SDL coordinate */
   151 void QZ_PrivateCocoaToSDL (_THIS, NSPoint *p) {
   151 void QZ_PrivateCocoaToSDL (_THIS, NSPoint *p) {
   152 
   152 
   153     if ( CGDisplayIsCaptured (display_id) ) { /* capture signals fullscreen */
   153     if ( CGDisplayIsCaptured (display_id) ) { /* capture signals fullscreen */
   154     
   154     
   155         p->y = CGDisplayPixelsHigh (display_id) - p->y - 1;
   155         p->y = CGDisplayPixelsHigh (display_id) - p->y;
   156     }
   156     }
   157     else {
   157     else {
   158         
   158         
   159         NSPoint newPoint;
   159         NSPoint newPoint;
   160         
   160         
   161         newPoint = [ window_view convertPoint:*p fromView:[ qz_window contentView ] ];
   161         newPoint = [ window_view convertPoint:*p fromView:[ qz_window contentView ] ];
   162         
   162         
   163         *p = newPoint;
   163         *p = newPoint;
       
   164 
       
   165         /* If OSX version is 10.3.0 or later, we need a workaround in OpenGL mode */
       
   166         if( system_version >= 0x1030 && (SDL_VideoSurface->flags & (SDL_OPENGL | SDL_OPENGLBLIT)) ) {
       
   167             p->y = [window_view frame].size.height - p->y - 1;
       
   168         }
   164     }
   169     }
   165 }
   170 }
   166 
   171 
   167 /* Convert SDL coordinate to window server (CoreGraphics) coordinate */
   172 /* Convert SDL coordinate to window server (CoreGraphics) coordinate */
   168 CGPoint QZ_PrivateSDLToCG (_THIS, NSPoint *p) {
   173 CGPoint QZ_PrivateSDLToCG (_THIS, NSPoint *p) {