00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #import <Availability.h>
00029 #ifdef __IPHONE_OS_VERSION_MAX_ALLOWED
00030
00031 #import "../../CCDirector.h"
00032
00036 typedef enum {
00038 kCCDeviceOrientationPortrait = UIDeviceOrientationPortrait,
00040 kCCDeviceOrientationPortraitUpsideDown = UIDeviceOrientationPortraitUpsideDown,
00042 kCCDeviceOrientationLandscapeLeft = UIDeviceOrientationLandscapeLeft,
00044 kCCDeviceOrientationLandscapeRight = UIDeviceOrientationLandscapeRight,
00045
00046
00047 CCDeviceOrientationPortrait = kCCDeviceOrientationPortrait,
00048 CCDeviceOrientationPortraitUpsideDown = kCCDeviceOrientationPortraitUpsideDown,
00049 CCDeviceOrientationLandscapeLeft = kCCDeviceOrientationLandscapeLeft,
00050 CCDeviceOrientationLandscapeRight = kCCDeviceOrientationLandscapeRight,
00051 } ccDeviceOrientation;
00052
00058 typedef enum {
00060 kCCPixelFormatRGB565,
00062 kCCPixelFormatRGBA8888,
00064 kCCPixelFormatDefault = kCCPixelFormatRGB565,
00065
00066
00067 kPixelFormatRGB565 = kCCPixelFormatRGB565,
00068 kRGB565 = kCCPixelFormatRGB565,
00069 kPixelFormatRGBA8888 = kCCPixelFormatRGBA8888,
00070 kRGBA8 = kCCPixelFormatRGBA8888,
00071 } tPixelFormat;
00072
00079 typedef enum {
00081 kCCDepthBufferNone,
00083 kCCDepthBuffer16,
00085 kCCDepthBuffer24,
00086
00087
00088 kDepthBuffer16 = kCCDepthBuffer16,
00089 kDepthBuffer24 = kCCDepthBuffer24,
00090 } tDepthBufferFormat;
00091
00096 typedef enum {
00104 kCCDirectorTypeNSTimer,
00105
00113 kCCDirectorTypeMainLoop,
00114
00122 kCCDirectorTypeThreadMainLoop,
00123
00133 kCCDirectorTypeDisplayLink,
00134
00136 kCCDirectorTypeDefault = kCCDirectorTypeNSTimer,
00137
00138
00139 CCDirectorTypeNSTimer = kCCDirectorTypeNSTimer,
00140 CCDirectorTypeMainLoop = kCCDirectorTypeMainLoop,
00141 CCDirectorTypeThreadMainLoop = kCCDirectorTypeThreadMainLoop,
00142 CCDirectorTypeDisplayLink = kCCDirectorTypeDisplayLink,
00143 CCDirectorTypeDefault = kCCDirectorTypeDefault,
00144
00145
00146 } ccDirectorType;
00147
00150 @interface CCDirector (iOSExtension)
00151
00152
00153 -(void) applyOrientation;
00154
00158 -(void) setDeviceOrientation:(ccDeviceOrientation)orientation;
00159
00161 -(ccDeviceOrientation) deviceOrientation;
00162
00171 -(void) setContentScaleFactor:(CGFloat)scaleFactor;
00172
00180 -(BOOL) enableRetinaDisplay:(BOOL)yes;
00181
00182
00184 -(CGFloat) contentScaleFactor;
00185 @end
00186
00187 @interface CCDirector (iOSExtensionClassMethods)
00188
00204 +(BOOL) setDirectorType:(ccDirectorType) directorType;
00205 @end
00206
00207 #pragma mark -
00208 #pragma mark CCDirectorIOS
00209
00213 @interface CCDirectorIOS : CCDirector
00214 {
00215
00216 ccDeviceOrientation deviceOrientation_;
00217
00218
00219 BOOL isContentScaleSupported_;
00220
00221 tPixelFormat pixelFormat_;
00222 tDepthBufferFormat depthBufferFormat_;
00223 }
00224
00225
00226
00228 @property (nonatomic,readonly) tPixelFormat pixelFormat DEPRECATED_ATTRIBUTE;
00229
00236 -(void) setPixelFormat: (tPixelFormat)p DEPRECATED_ATTRIBUTE;
00237
00244 -(void) setDepthBufferFormat: (tDepthBufferFormat)db DEPRECATED_ATTRIBUTE;
00245
00246
00248 -(BOOL)detach DEPRECATED_ATTRIBUTE;
00249
00255 -(BOOL)attachInWindow:(UIWindow *)window DEPRECATED_ATTRIBUTE;
00256
00262 -(BOOL)attachInView:(UIView *)view DEPRECATED_ATTRIBUTE;
00263
00269 -(BOOL)attachInView:(UIView *)view withFrame:(CGRect)frame DEPRECATED_ATTRIBUTE;
00270
00271 @end
00272
00280 @interface CCDirectorFast : CCDirectorIOS
00281 {
00282 BOOL isRunning;
00283
00284 NSAutoreleasePool *autoreleasePool;
00285 }
00286 -(void) mainLoop;
00287 @end
00288
00298 @interface CCDirectorFastThreaded : CCDirectorIOS
00299 {
00300 BOOL isRunning;
00301 }
00302 -(void) mainLoop;
00303 @end
00304
00316 @interface CCDirectorDisplayLink : CCDirectorIOS
00317 {
00318 id displayLink;
00319 }
00320 -(void) mainLoop:(id)sender;
00321 @end
00322
00332 @interface CCDirectorTimer : CCDirectorIOS
00333 {
00334 NSTimer *animationTimer;
00335 }
00336 -(void) mainLoop;
00337 @end
00338
00339
00340 extern CGFloat __ccContentScaleFactor;
00341
00342 #endif // __IPHONE_OS_VERSION_MAX_ALLOWED