00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef __pspgu_h__
00010 #define __pspgu_h__
00011
00012 #include <psptypes.h>
00013 #include <pspge.h>
00014
00019 #if defined(__cplusplus)
00020 extern "C" {
00021 #endif
00022
00023
00024 #define GU_PI (3.141593f)
00025
00026
00027 #define GU_FALSE (0)
00028 #define GU_TRUE (1)
00029
00030
00031 #define GU_POINTS (0)
00032 #define GU_LINES (1)
00033 #define GU_LINE_STRIP (2)
00034 #define GU_TRIANGLES (3)
00035 #define GU_TRIANGLE_STRIP (4)
00036 #define GU_TRIANGLE_FAN (5)
00037 #define GU_SPRITES (6)
00038
00039
00040 #define GU_ALPHA_TEST (0)
00041 #define GU_DEPTH_TEST (1)
00042 #define GU_SCISSOR_TEST (2)
00043 #define GU_STENCIL_TEST (3)
00044 #define GU_BLEND (4)
00045 #define GU_CULL_FACE (5)
00046 #define GU_DITHER (6)
00047 #define GU_FOG (7)
00048 #define GU_CLIP_PLANES (8)
00049 #define GU_TEXTURE_2D (9)
00050 #define GU_LIGHTING (10)
00051 #define GU_LIGHT0 (11)
00052 #define GU_LIGHT1 (12)
00053 #define GU_LIGHT2 (13)
00054 #define GU_LIGHT3 (14)
00055 #define GU_LINE_SMOOTH (15)
00056 #define GU_PATCH_CULL_FACE (16)
00057 #define GU_COLOR_TEST (17)
00058 #define GU_COLOR_LOGIC_OP (18)
00059 #define GU_FACE_NORMAL_REVERSE (19)
00060 #define GU_PATCH_FACE (20)
00061 #define GU_FRAGMENT_2X (21)
00062
00063
00064 #define GU_PROJECTION (0)
00065 #define GU_VIEW (1)
00066 #define GU_MODEL (2)
00067 #define GU_TEXTURE (3)
00068
00069
00070 #define GU_TEXTURE_SHIFT(n) ((n)<<0)
00071 #define GU_TEXTURE_8BIT GU_TEXTURE_SHIFT(1)
00072 #define GU_TEXTURE_16BIT GU_TEXTURE_SHIFT(2)
00073 #define GU_TEXTURE_32BITF GU_TEXTURE_SHIFT(3)
00074 #define GU_TEXTURE_BITS GU_TEXTURE_SHIFT(3)
00075
00076 #define GU_COLOR_SHIFT(n) ((n)<<2)
00077 #define GU_COLOR_5650 GU_COLOR_SHIFT(4)
00078 #define GU_COLOR_5551 GU_COLOR_SHIFT(5)
00079 #define GU_COLOR_4444 GU_COLOR_SHIFT(6)
00080 #define GU_COLOR_8888 GU_COLOR_SHIFT(7)
00081 #define GU_COLOR_BITS GU_COLOR_SHIFT(7)
00082
00083 #define GU_NORMAL_SHIFT(n) ((n)<<5)
00084 #define GU_NORMAL_8BIT GU_NORMAL_SHIFT(1)
00085 #define GU_NORMAL_16BIT GU_NORMAL_SHIFT(2)
00086 #define GU_NORMAL_32BITF GU_NORMAL_SHIFT(3)
00087 #define GU_NORMAL_BITS GU_NORMAL_SHIFT(3)
00088
00089 #define GU_VERTEX_SHIFT(n) ((n)<<7)
00090 #define GU_VERTEX_8BIT GU_VERTEX_SHIFT(1)
00091 #define GU_VERTEX_16BIT GU_VERTEX_SHIFT(2)
00092 #define GU_VERTEX_32BITF GU_VERTEX_SHIFT(3)
00093 #define GU_VERTEX_BITS GU_VERTEX_SHIFT(3)
00094
00095 #define GU_WEIGHT_SHIFT(n) ((n)<<9)
00096 #define GU_WEIGHT_8BIT GU_WEIGHT_SHIFT(1)
00097 #define GU_WEIGHT_16BIT GU_WEIGHT_SHIFT(2)
00098 #define GU_WEIGHT_32BITF GU_WEIGHT_SHIFT(3)
00099 #define GU_WEIGHT_BITS GU_WEIGHT_SHIFT(3)
00100
00101 #define GU_INDEX_SHIFT(n) ((n)<<11)
00102 #define GU_INDEX_8BIT GU_INDEX_SHIFT(1)
00103 #define GU_INDEX_16BIT GU_INDEX_SHIFT(2)
00104 #define GU_INDEX_BITS GU_INDEX_SHIFT(3)
00105
00106 #define GU_WEIGHTS(n) ((((n)-1)&7)<<14)
00107 #define GU_WEIGHTS_BITS GU_WEIGHTS(8)
00108 #define GU_VERTICES(n) ((((n)-1)&7)<<18)
00109 #define GU_VERTICES_BITS GU_VERTICES(8)
00110
00111 #define GU_TRANSFORM_SHIFT(n) ((n)<<23)
00112 #define GU_TRANSFORM_3D GU_TRANSFORM_SHIFT(0)
00113 #define GU_TRANSFORM_2D GU_TRANSFORM_SHIFT(1)
00114 #define GU_TRANSFORM_BITS GU_TRANSFORM_SHIFT(1)
00115
00116
00117
00118 #define GU_PSM_5650 (0)
00119 #define GU_PSM_5551 (1)
00120 #define GU_PSM_4444 (2)
00121 #define GU_PSM_8888 (3)
00122 #define GU_PSM_T4 (4)
00123 #define GU_PSM_T8 (5)
00124 #define GU_PSM_T16 (6)
00125 #define GU_PSM_T32 (7)
00126 #define GU_PSM_DXT1 (8)
00127 #define GU_PSM_DXT3 (9)
00128 #define GU_PSM_DXT5 (10)
00129
00130
00131 #define GU_FILL_FILL (0)
00132 #define GU_OPEN_FILL (1)
00133 #define GU_FILL_OPEN (2)
00134 #define GU_OPEN_OPEN (3)
00135
00136
00137 #define GU_FLAT (0)
00138 #define GU_SMOOTH (1)
00139
00140
00141 #define GU_CLEAR (0)
00142 #define GU_AND (1)
00143 #define GU_AND_REVERSE (2)
00144 #define GU_COPY (3)
00145 #define GU_AND_INVERTED (4)
00146 #define GU_NOOP (5)
00147 #define GU_XOR (6)
00148 #define GU_OR (7)
00149 #define GU_NOR (8)
00150 #define GU_EQUIV (9)
00151 #define GU_INVERTED (10)
00152 #define GU_OR_REVERSE (11)
00153 #define GU_COPY_INVERTED (12)
00154 #define GU_OR_INVERTED (13)
00155 #define GU_NAND (14)
00156 #define GU_SET (15)
00157
00158
00159 #define GU_NEAREST (0)
00160 #define GU_LINEAR (1)
00161 #define GU_NEAREST_MIPMAP_NEAREST (4)
00162 #define GU_LINEAR_MIPMAP_NEAREST (5)
00163 #define GU_NEAREST_MIPMAP_LINEAR (6)
00164 #define GU_LINEAR_MIPMAP_LINEAR (7)
00165
00166
00167 #define GU_TEXTURE_COORDS (0)
00168 #define GU_TEXTURE_MATRIX (1)
00169 #define GU_ENVIRONMENT_MAP (2)
00170
00171
00172 #define GU_TEXTURE_AUTO (0)
00173 #define GU_TEXTURE_CONST (1)
00174 #define GU_TEXTURE_SLOPE (2)
00175
00176
00177 #define GU_POSITION (0)
00178 #define GU_UV (1)
00179 #define GU_NORMALIZED_NORMAL (2)
00180 #define GU_NORMAL (3)
00181
00182
00183 #define GU_REPEAT (0)
00184 #define GU_CLAMP (1)
00185
00186
00187 #define GU_CW (0)
00188 #define GU_CCW (1)
00189
00190
00191 #define GU_NEVER (0)
00192 #define GU_ALWAYS (1)
00193 #define GU_EQUAL (2)
00194 #define GU_NOTEQUAL (3)
00195 #define GU_LESS (4)
00196 #define GU_LEQUAL (5)
00197 #define GU_GREATER (6)
00198 #define GU_GEQUAL (7)
00199
00200
00201 #define GU_COLOR_BUFFER_BIT (1)
00202 #define GU_STENCIL_BUFFER_BIT (2)
00203 #define GU_DEPTH_BUFFER_BIT (4)
00204 #define GU_FAST_CLEAR_BIT (16)
00205
00206
00207 #define GU_TFX_MODULATE (0)
00208 #define GU_TFX_DECAL (1)
00209 #define GU_TFX_BLEND (2)
00210 #define GU_TFX_REPLACE (3)
00211 #define GU_TFX_ADD (4)
00212
00213
00214 #define GU_TCC_RGB (0)
00215 #define GU_TCC_RGBA (1)
00216
00217
00218 #define GU_ADD (0)
00219 #define GU_SUBTRACT (1)
00220 #define GU_REVERSE_SUBTRACT (2)
00221 #define GU_MIN (3)
00222 #define GU_MAX (4)
00223 #define GU_ABS (5)
00224
00225
00226 #define GU_SRC_COLOR (0)
00227 #define GU_ONE_MINUS_SRC_COLOR (1)
00228 #define GU_SRC_ALPHA (2)
00229 #define GU_ONE_MINUS_SRC_ALPHA (3)
00230 #define GU_DST_COLOR (0)
00231 #define GU_ONE_MINUS_DST_COLOR (1)
00232 #define GU_DST_ALPHA (4)
00233 #define GU_ONE_MINUS_DST_ALPHA (5)
00234 #define GU_FIX (10)
00235
00236
00237 #define GU_KEEP (0)
00238 #define GU_ZERO (1)
00239 #define GU_REPLACE (2)
00240 #define GU_INVERT (3)
00241 #define GU_INCR (4)
00242 #define GU_DECR (5)
00243
00244
00245 #define GU_AMBIENT (1)
00246 #define GU_DIFFUSE (2)
00247 #define GU_SPECULAR (4)
00248 #define GU_AMBIENT_AND_DIFFUSE (GU_AMBIENT|GU_DIFFUSE)
00249 #define GU_DIFFUSE_AND_SPECULAR (GU_DIFFUSE|GU_SPECULAR)
00250 #define GU_UNKNOWN_LIGHT_COMPONENT (8)
00251
00252
00253 #define GU_SINGLE_COLOR (0)
00254 #define GU_SEPARATE_SPECULAR_COLOR (1)
00255
00256
00257 #define GU_DIRECTIONAL (0)
00258 #define GU_POINTLIGHT (1)
00259 #define GU_SPOTLIGHT (2)
00260
00261
00262 #define GU_DIRECT (0)
00263 #define GU_CALL (1)
00264 #define GU_SEND (2)
00265
00266
00267 #define GU_TAIL (0)
00268 #define GU_HEAD (1)
00269
00270
00271 #define GU_SYNC_FINISH (0)
00272 #define GU_SYNC_SIGNAL (1)
00273 #define GU_SYNC_DONE (2)
00274 #define GU_SYNC_LIST (3)
00275 #define GU_SYNC_SEND (4)
00276
00277
00278 #define GU_SYNC_WAIT (0)
00279 #define GU_SYNC_NOWAIT (1)
00280
00281
00282 #define GU_SYNC_WHAT_DONE (0)
00283 #define GU_SYNC_WHAT_QUEUED (1)
00284 #define GU_SYNC_WHAT_DRAW (2)
00285 #define GU_SYNC_WHAT_STALL (3)
00286 #define GU_SYNC_WHAT_CANCEL (4)
00287
00288
00289 #define GU_CALLBACK_SIGNAL (1)
00290 #define GU_CALLBACK_FINISH (4)
00291
00292
00293 #define GU_BEHAVIOR_SUSPEND (1)
00294 #define GU_BEHAVIOR_CONTINUE (2)
00295
00296
00297 #define GU_ABGR(a,b,g,r) (((a) << 24)|((b) << 16)|((g) << 8)|(r))
00298 #define GU_ARGB(a,r,g,b) GU_ABGR((a),(b),(g),(r))
00299 #define GU_RGBA(r,g,b,a) GU_ARGB((a),(r),(g),(b))
00300
00301
00302 #define GU_COLOR(r,g,b,a) GU_RGBA((u32)((r) * 255.0f),(u32)((g) * 255.0f),(u32)((b) * 255.0f),(u32)((a) * 255.0f))
00303
00304 typedef void (*GuSwapBuffersCallback)(void** display,void** render);
00305
00308
00316 void sceGuDepthBuffer(void* zbp, int zbw);
00317
00332 void sceGuDispBuffer(int width, int height, void* dispbp, int dispbw);
00333
00352 void sceGuDrawBuffer(int psm, void* fbp, int fbw);
00353
00361 void sceGuDrawBufferList(int psm, void* fbp, int fbw);
00362
00373 int sceGuDisplay(int state);
00374
00390 void sceGuDepthFunc(int function);
00391
00397 void sceGuDepthMask(int mask);
00398
00399 void sceGuDepthOffset(unsigned int offset);
00400
00414 void sceGuDepthRange(int near, int far);
00415
00416 void sceGuFog(float near, float far, unsigned int color);
00417
00423 void sceGuInit(void);
00424
00430 void sceGuTerm(void);
00431
00432 void sceGuBreak(int a0);
00433 void sceGuContinue(void);
00434
00446 void* sceGuSetCallback(int signal, void (*callback)(int));
00447
00458 void sceGuSignal(int signal, int behavior);
00459
00468 void sceGuSendCommandf(int cmd, float argument);
00469
00478 void sceGuSendCommandi(int cmd, int argument);
00479
00490 void* sceGuGetMemory(int size);
00491
00505 void sceGuStart(int cid, void* list);
00506
00520 int sceGuFinish(void);
00521
00533 int sceGuFinishId(unsigned int id);
00534
00540 void sceGuCallList(const void* list);
00541
00548 void sceGuCallMode(int mode);
00549
00555 int sceGuCheckList(void);
00556
00568 void sceGuSendList(int mode, const void* list, PspGeContext* context);
00569
00575 void* sceGuSwapBuffers(void);
00576
00603 int sceGuSync(int mode, int what);
00604
00671 void sceGuDrawArray(int prim, int vtype, int count, const void* indices, const void* vertices);
00672
00692 void sceGuBeginObject(int vtype, int count, const void* indices, const void* vertices);
00693
00697 void sceGuEndObject(void);
00698
00707 void sceGuSetStatus(int state, int status);
00708
00717 int sceGuGetStatus(int state);
00718
00726 void sceGuSetAllStatus(int status);
00727
00735 int sceGuGetAllStatus(void);
00736
00758 void sceGuEnable(int state);
00759
00767 void sceGuDisable(int state);
00768
00787 void sceGuLight(int light, int type, int components, const ScePspFVector3* position);
00788
00797 void sceGuLightAtt(int light, float atten0, float atten1, float atten2);
00798
00813 void sceGuLightColor(int light, int component, unsigned int color);
00814
00827 void sceGuLightMode(int mode);
00828
00837 void sceGuLightSpot(int light, const ScePspFVector3* direction, float exponent, float cutoff);
00838
00849 void sceGuClear(int flags);
00850
00856 void sceGuClearColor(unsigned int color);
00857
00863 void sceGuClearDepth(unsigned int depth);
00864
00871 void sceGuClearStencil(unsigned int stencil);
00872
00879 void sceGuPixelMask(unsigned int mask);
00880
00886 void sceGuColor(unsigned int color);
00887
00908 void sceGuColorFunc(int func, unsigned int color, unsigned int mask);
00909
00920 void sceGuColorMaterial(int components);
00921
00939 void sceGuAlphaFunc(int func, int value, int mask);
00940
00941 void sceGuAmbient(unsigned int color);
00942 void sceGuAmbientColor(unsigned int color);
00943
00978 void sceGuBlendFunc(int op, int src, int dest, unsigned int srcfix, unsigned int destfix);
00979
00980 void sceGuMaterial(int mode, int color);
00981
00985 void sceGuModelColor(unsigned int emissive, unsigned int ambient, unsigned int diffuse, unsigned int specular);
00986
01004 void sceGuStencilFunc(int func, int ref, int mask);
01005
01024 void sceGuStencilOp(int fail, int zfail, int zpass);
01025
01032 void sceGuSpecular(float power);
01033
01045 void sceGuFrontFace(int order);
01046
01072 void sceGuLogicalOp(int op);
01073
01081 void sceGuSetDither(const ScePspIMatrix4* matrix);
01082
01092 void sceGuShadeModel(int mode);
01093
01116 void sceGuCopyImage(int psm, int sx, int sy, int width, int height, int srcw, void* src, int dx, int dy, int destw, void* dest);
01117
01127 void sceGuTexEnvColor(unsigned int color);
01128
01143 void sceGuTexFilter(int min, int mag);
01144
01151 void sceGuTexFlush(void);
01152
01183 void sceGuTexFunc(int tfx, int tcc);
01184
01199 void sceGuTexImage(int mipmap, int width, int height, int tbw, const void* tbp);
01200
01212 void sceGuTexLevelMode(unsigned int mode, float bias);
01213
01226 void sceGuTexMapMode(int mode, unsigned int a1, unsigned int a2);
01227
01244 void sceGuTexMode(int tpsm, int maxmips, int a2, int swizzle);
01245
01255 void sceGuTexOffset(float u, float v);
01256
01268 void sceGuTexProjMapMode(int mode);
01269
01279 void sceGuTexScale(float u, float v);
01280 void sceGuTexSlope(float slope);
01281
01288 void sceGuTexSync();
01289
01300 void sceGuTexWrap(int u, int v);
01301
01310 void sceGuClutLoad(int num_blocks, const void* cbp);
01311
01326 void sceGuClutMode(unsigned int cpsm, unsigned int shift, unsigned int mask, unsigned int a3);
01327
01341 void sceGuOffset(unsigned int x, unsigned int y);
01342
01353 void sceGuScissor(int x, int y, int stopX, int stopY);
01354
01368 void sceGuViewport(int cx, int cy, int width, int height);
01369
01379 void sceGuDrawBezier(int vtype, int ucount, int vcount, const void* indices, const void* vertices);
01380
01387 void sceGuPatchDivide(unsigned int ulevel, unsigned int vlevel);
01388
01389 void sceGuPatchFrontFace(unsigned int a0);
01390
01396 void sceGuPatchPrim(int prim);
01397
01398 void sceGuDrawSpline(int vtype, int ucount, int vcount, int uedge, int vedge, const void* indices, const void* vertices);
01399
01412 void sceGuSetMatrix(int type, const ScePspFMatrix4* matrix);
01413
01427 void sceGuBoneMatrix(unsigned int index, const ScePspFMatrix4* matrix);
01428
01442 void sceGuMorphWeight(int index, float weight);
01443
01444 void sceGuDrawArrayN(int primitive_type, int vertex_type, int count, int a3, const void* indices, const void* vertices);
01445
01456 void guSwapBuffersBehaviour(int behaviour);
01457
01479 void guSwapBuffersCallback(GuSwapBuffersCallback callback);
01480
01483 #if defined(__cplusplus)
01484 };
01485 #endif
01486
01487 #endif