diff options
| author | Starla Insigna <starla4444@gmail.com> | 2011-07-30 11:19:14 -0400 |
|---|---|---|
| committer | Starla Insigna <starla4444@gmail.com> | 2011-07-30 11:19:14 -0400 |
| commit | 9cd57b731ab1c666d4a1cb725538fdc137763d12 (patch) | |
| tree | 5bac45ae5157a1cb10c6e45500cbf72789917980 /libs/cocos2d/CCConfiguration.h | |
| download | cartcollect-9cd57b731ab1c666d4a1cb725538fdc137763d12.tar.gz cartcollect-9cd57b731ab1c666d4a1cb725538fdc137763d12.tar.bz2 cartcollect-9cd57b731ab1c666d4a1cb725538fdc137763d12.zip | |
Initial commit (version 0.2.1)
Diffstat (limited to 'libs/cocos2d/CCConfiguration.h')
| -rwxr-xr-x | libs/cocos2d/CCConfiguration.h | 116 |
1 files changed, 116 insertions, 0 deletions
| diff --git a/libs/cocos2d/CCConfiguration.h b/libs/cocos2d/CCConfiguration.h new file mode 100755 index 0000000..04e1b55 --- /dev/null +++ b/libs/cocos2d/CCConfiguration.h | |||
| @@ -0,0 +1,116 @@ | |||
| 1 | /* | ||
| 2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org | ||
| 3 | * | ||
| 4 | * Copyright (c) 2010 Ricardo Quesada | ||
| 5 | * Copyright (c) 2011 Zynga Inc. | ||
| 6 | * | ||
| 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| 8 | * of this software and associated documentation files (the "Software"), to deal | ||
| 9 | * in the Software without restriction, including without limitation the rights | ||
| 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| 11 | * copies of the Software, and to permit persons to whom the Software is | ||
| 12 | * furnished to do so, subject to the following conditions: | ||
| 13 | * | ||
| 14 | * The above copyright notice and this permission notice shall be included in | ||
| 15 | * all copies or substantial portions of the Software. | ||
| 16 | * | ||
| 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| 20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
| 23 | * THE SOFTWARE. | ||
| 24 | */ | ||
| 25 | |||
| 26 | #import <Foundation/Foundation.h> | ||
| 27 | |||
| 28 | #import "Platforms/CCGL.h" | ||
| 29 | |||
| 30 | /** OS version definitions. Includes both iOS and Mac OS versions | ||
| 31 | */ | ||
| 32 | enum { | ||
| 33 | kCCiOSVersion_3_0 = 0x03000000, | ||
| 34 | kCCiOSVersion_3_1 = 0x03010000, | ||
| 35 | kCCiOSVersion_3_1_1 = 0x03010100, | ||
| 36 | kCCiOSVersion_3_1_2 = 0x03010200, | ||
| 37 | kCCiOSVersion_3_1_3 = 0x03010300, | ||
| 38 | kCCiOSVersion_3_2 = 0x03020000, | ||
| 39 | kCCiOSVersion_3_2_1 = 0x03020100, | ||
| 40 | kCCiOSVersion_4_0 = 0x04000000, | ||
| 41 | kCCiOSVersion_4_0_1 = 0x04000100, | ||
| 42 | kCCiOSVersion_4_1 = 0x04010000, | ||
| 43 | kCCiOSVersion_4_2 = 0x04020000, | ||
| 44 | kCCiOSVersion_4_3 = 0x04030000, | ||
| 45 | kCCiOSVersion_4_3_1 = 0x04030100, | ||
| 46 | kCCiOSVersion_4_3_2 = 0x04030200, | ||
| 47 | kCCiOSVersion_4_3_3 = 0x04030300, | ||
| 48 | |||
| 49 | kCCMacVersion_10_5 = 0x0a050000, | ||
| 50 | kCCMacVersion_10_6 = 0x0a060000, | ||
| 51 | kCCMacVersion_10_7 = 0x0a070000, | ||
| 52 | }; | ||
| 53 | |||
| 54 | /** | ||
| 55 | CCConfiguration contains some openGL variables | ||
| 56 | @since v0.99.0 | ||
| 57 | */ | ||
| 58 | @interface CCConfiguration : NSObject { | ||
| 59 | |||
| 60 | GLint maxTextureSize_; | ||
| 61 | GLint maxModelviewStackDepth_; | ||
| 62 | BOOL supportsPVRTC_; | ||
| 63 | BOOL supportsNPOT_; | ||
| 64 | BOOL supportsBGRA8888_; | ||
| 65 | BOOL supportsDiscardFramebuffer_; | ||
| 66 | unsigned int OSVersion_; | ||
| 67 | GLint maxSamplesAllowed_; | ||
| 68 | } | ||
| 69 | |||
| 70 | /** OpenGL Max texture size. */ | ||
| 71 | @property (nonatomic, readonly) GLint maxTextureSize; | ||
| 72 | |||
| 73 | /** OpenGL Max Modelview Stack Depth. */ | ||
| 74 | @property (nonatomic, readonly) GLint maxModelviewStackDepth; | ||
| 75 | |||
| 76 | /** Whether or not the GPU supports NPOT (Non Power Of Two) textures. | ||
| 77 | NPOT textures have the following limitations: | ||
| 78 | - They can't have mipmaps | ||
| 79 | - They only accept GL_CLAMP_TO_EDGE in GL_TEXTURE_WRAP_{S,T} | ||
| 80 | |||
| 81 | @since v0.99.2 | ||
| 82 | */ | ||
| 83 | @property (nonatomic, readonly) BOOL supportsNPOT; | ||
| 84 | |||
| 85 | /** Whether or not PVR Texture Compressed is supported */ | ||
| 86 | @property (nonatomic, readonly) BOOL supportsPVRTC; | ||
| 87 | |||
| 88 | /** Whether or not BGRA8888 textures are supported. | ||
| 89 | |||
| 90 | @since v0.99.2 | ||
| 91 | */ | ||
| 92 | @property (nonatomic, readonly) BOOL supportsBGRA8888; | ||
| 93 | |||
| 94 | /** Whether or not glDiscardFramebufferEXT is supported | ||
| 95 | |||
| 96 | @since v0.99.2 | ||
| 97 | */ | ||
| 98 | @property (nonatomic, readonly) BOOL supportsDiscardFramebuffer; | ||
| 99 | |||
| 100 | /** returns the OS version. | ||
| 101 | - On iOS devices it returns the firmware version. | ||
| 102 | - On Mac returns the OS version | ||
| 103 | |||
| 104 | @since v0.99.5 | ||
| 105 | */ | ||
| 106 | @property (nonatomic, readonly) unsigned int OSVersion; | ||
| 107 | |||
| 108 | /** returns a shared instance of the CCConfiguration */ | ||
| 109 | +(CCConfiguration *) sharedConfiguration; | ||
| 110 | |||
| 111 | /** returns whether or not an OpenGL is supported */ | ||
| 112 | - (BOOL) checkForGLExtension:(NSString *)searchName; | ||
| 113 | |||
| 114 | |||
| 115 | |||
| 116 | @end | ||
