Go to the documentation of this file.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
00031 #import <Availability.h>
00032 #import <Foundation/Foundation.h>
00033
00034 #ifdef __IPHONE_OS_VERSION_MAX_ALLOWED
00035 #import <CoreGraphics/CGGeometry.h>
00036 #endif
00037
00038 #import "Platforms/CCGL.h"
00039
00043 typedef struct _ccColor3B
00044 {
00045 GLubyte r;
00046 GLubyte g;
00047 GLubyte b;
00048 } ccColor3B;
00049
00051 static inline ccColor3B
00052 ccc3(const GLubyte r, const GLubyte g, const GLubyte b)
00053 {
00054 ccColor3B c = {r, g, b};
00055 return c;
00056 }
00057
00059 static const ccColor3B ccWHITE = {255,255,255};
00061 static const ccColor3B ccYELLOW = {255,255,0};
00063 static const ccColor3B ccBLUE = {0,0,255};
00065 static const ccColor3B ccGREEN = {0,255,0};
00067 static const ccColor3B ccRED = {255,0,0};
00069 static const ccColor3B ccMAGENTA = {255,0,255};
00071 static const ccColor3B ccBLACK = {0,0,0};
00073 static const ccColor3B ccORANGE = {255,127,0};
00075 static const ccColor3B ccGRAY = {166,166,166};
00076
00080 typedef struct _ccColor4B
00081 {
00082 GLubyte r;
00083 GLubyte g;
00084 GLubyte b;
00085 GLubyte a;
00086 } ccColor4B;
00088 static inline ccColor4B
00089 ccc4(const GLubyte r, const GLubyte g, const GLubyte b, const GLubyte o)
00090 {
00091 ccColor4B c = {r, g, b, o};
00092 return c;
00093 }
00094
00095
00099 typedef struct _ccColor4F {
00100 GLfloat r;
00101 GLfloat g;
00102 GLfloat b;
00103 GLfloat a;
00104 } ccColor4F;
00105
00109 static inline ccColor4F ccc4FFromccc3B(ccColor3B c)
00110 {
00111 return (ccColor4F){c.r/255.f, c.g/255.f, c.b/255.f, 1.f};
00112 }
00113
00117 static inline ccColor4F ccc4FFromccc4B(ccColor4B c)
00118 {
00119 return (ccColor4F){c.r/255.f, c.g/255.f, c.b/255.f, c.a/255.f};
00120 }
00121
00125 static inline BOOL ccc4FEqual(ccColor4F a, ccColor4F b)
00126 {
00127 return a.r == b.r && a.g == b.g && a.b == b.b && a.a == b.a;
00128 }
00129
00133 typedef struct _ccVertex2F
00134 {
00135 GLfloat x;
00136 GLfloat y;
00137 } ccVertex2F;
00138
00142 typedef struct _ccVertex3F
00143 {
00144 GLfloat x;
00145 GLfloat y;
00146 GLfloat z;
00147 } ccVertex3F;
00148
00152 typedef struct _ccTex2F {
00153 GLfloat u;
00154 GLfloat v;
00155 } ccTex2F;
00156
00157
00159 typedef struct _ccPointSprite
00160 {
00161 ccVertex2F pos;
00162 ccColor4F colors;
00163 GLfloat size;
00164 } ccPointSprite;
00165
00167 typedef struct _ccQuad2 {
00168 ccVertex2F tl;
00169 ccVertex2F tr;
00170 ccVertex2F bl;
00171 ccVertex2F br;
00172 } ccQuad2;
00173
00174
00176 typedef struct _ccQuad3 {
00177 ccVertex3F bl;
00178 ccVertex3F br;
00179 ccVertex3F tl;
00180 ccVertex3F tr;
00181 } ccQuad3;
00182
00184 typedef struct _ccGridSize
00185 {
00186 NSInteger x;
00187 NSInteger y;
00188 } ccGridSize;
00189
00191 static inline ccGridSize
00192 ccg(const NSInteger x, const NSInteger y)
00193 {
00194 ccGridSize v = {x, y};
00195 return v;
00196 }
00197
00199 typedef struct _ccV2F_C4F_T2F
00200 {
00202 ccVertex2F vertices;
00204 ccColor4F colors;
00206 ccTex2F texCoords;
00207 } ccV2F_C4F_T2F;
00208
00210 typedef struct _ccV3F_C4B_T2F
00211 {
00213 ccVertex3F vertices;
00214
00215
00217 ccColor4B colors;
00218
00219
00220
00221 ccTex2F texCoords;
00222 } ccV3F_C4B_T2F;
00223
00225 typedef struct _ccV3F_C4B_T2F_Quad
00226 {
00228 ccV3F_C4B_T2F tl;
00230 ccV3F_C4B_T2F bl;
00232 ccV3F_C4B_T2F tr;
00234 ccV3F_C4B_T2F br;
00235 } ccV3F_C4B_T2F_Quad;
00236
00238 typedef struct _ccV2F_C4F_T2F_Quad
00239 {
00241 ccV2F_C4F_T2F bl;
00243 ccV2F_C4F_T2F br;
00245 ccV2F_C4F_T2F tl;
00247 ccV2F_C4F_T2F tr;
00248 } ccV2F_C4F_T2F_Quad;
00249
00251 typedef struct _ccBlendFunc
00252 {
00254 GLenum src;
00256 GLenum dst;
00257 } ccBlendFunc;
00258
00261 typedef float ccTime;
00262