Changeset 20904

Show
Ignore:
Timestamp:
11/08/07 11:15:38 (1 year ago)
Author:
patrick
Message:

MFT r20903: Switch to using a C-style cast to convert from screen number to

CGDirectDisplayID. While I would prefer to use C++ casting, the
alternative in this case is to use a typedef. Since -getDisplayID:
is an Objective-C method, it might as well use Objective-C
conventions and (probably more importantly) follow the Apple
documentation.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • juggler/branches/2.2/modules/vrjuggler/vrj/Draw/OGL/GlViewCocoa.mm

    r20902 r20904  
    986986      NSNumber* screen_num = 
    987987         [[screen deviceDescription] objectForKey:@"NSScreeNumber"]; 
    988       return reinterpret_cast<CGDirectDisplayID>([screen_num intValue]); 
     988 
     989      // NOTE: A C-style cast is being used here because this is Objective-C 
     990      // and because CGDirectDisplayID is defined differently on Mac OS X 10.5 
     991      // than on earlier platforms. A generic C-style cast captures that more 
     992      // easily than using an #ifdef. 
     993      return (CGDirectDisplayID) [screen_num longValue]; 
    989994   } 
    990995   //@}