Changeset 20903

Show
Ignore:
Timestamp:
11/08/07 11:14:07 (10 months ago)
Author:
patrick
Message:

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/trunk/modules/vrjuggler/vrj/Draw/OpenGL/VRJOpenGLView.mm

    r20901 r20903  
    988988      NSNumber* screen_num = 
    989989         [[screen deviceDescription] objectForKey:@"NSScreeNumber"]; 
    990       return reinterpret_cast<CGDirectDisplayID>([screen_num intValue]); 
     990 
     991      // NOTE: A C-style cast is being used here because this is Objective-C 
     992      // and because CGDirectDisplayID is defined differently on Mac OS X 10.5 
     993      // than on earlier platforms. A generic C-style cast captures that more 
     994      // easily than using an #ifdef. 
     995      return (CGDirectDisplayID) [screen_num longValue]; 
    991996   } 
    992997   //@}