25#ifndef __TRIGRAPHICS_H__
26#define __TRIGRAPHICS_H__
37#define TRI_DLIST_SIZE_KB(x) triU32 triDlistSizeUser = ((x)*1024);
41#define SCREEN_WIDTH 480
42#define SCREEN_HEIGHT 272
44#define FRAME_BUFFER_WIDTH 512
45#define FRAME_BUFFER_SIZE (FRAME_BUFFER_WIDTH*SCREEN_HEIGHT)
50#define TRI_ALPHA_TEST 0
51#define TRI_DEPTH_TEST 1
52#define TRI_SCISSOR_TEST 2
53#define TRI_STENCIL_TEST 3
55#define TRI_CULL_FACE 5
58#define TRI_CLIP_PLANES 8
59#define TRI_TEXTURE_2D 9
60#define TRI_LIGHTING 10
66#define TRI_COLORKEY 17
67#define TRI_LOGICAL_OP 18
68#define TRI_NORMAL_REVERSE 19
70#define TRI_PSEUDO_FSAA 33
71#define TRI_SMOOTH_DITHER 34
72#define TRI_DEPTH_MASK 35
73#define TRI_DEPTH_WRITE 35
77extern void* triFramebuffer;
78extern void* triFramebuffer2;
79extern void* triDepthbuffer;
101void triInit( triS32 psm, triBool doublebuffer );
155void triPerspective( triFloat fov );
159void triEnable( triU32 state );
160void triDisable( triU32 state );
163void triClear( triU32 color );
166void triSetClip( triS32 x, triS32 y, triS32 width, triS32 height );
171void triRendertoscreen();
172void triRendertotexture( triS32 psm,
void* tbp, triS32 tw, triS32 th, triS32 tbw );
173void triRendertoimage(
triImage* img );
175void triCopyToScreen( triS32 x, triS32 y, triS32 w, triS32 h, triS32 sx, triS32 sy, triS32 sbw,
void* src );
176void triCopyFromScreen( triS32 x, triS32 y, triS32 w, triS32 h, triS32 dx, triS32 dy, triS32 dbw,
void* dst );
185void triDrawLine( triFloat x0, triFloat y0, triFloat x1, triFloat y1, triU32 color );
201void triDrawRect( triFloat x, triFloat y, triFloat width, triFloat height, triU32 color );
220void triDrawRectRotate( triFloat x, triFloat y, triFloat width, triFloat height, triU32 color, triFloat angle );
232void triDrawRectGrad( triFloat x, triFloat y, triFloat width, triFloat height, triU32 color1, triU32 color2, triU32 color3, triU32 color4 );
268void triDrawTri( triFloat x0, triFloat y0, triFloat x1, triFloat y1, triFloat x2, triFloat y2, triU32 color );
279void triDrawTriOutline( triFloat x0, triFloat y0, triFloat x1, triFloat y1, triFloat x2, triFloat y2, triU32 color );
292void triDrawTriGrad( triFloat x0, triFloat y0, triFloat x1, triFloat y1, triFloat x2, triFloat y2, triU32 color1, triU32 color2, triU32 color3 );
302void triDrawRegPoly( triFloat x, triFloat y, triFloat radius, triU32 color, triU32 numSteps, triFloat angle );
312void triDrawRegPolyOutline( triFloat x, triFloat y, triFloat radius, triU32 color, triU32 numSteps, triFloat angle );
323void triDrawRegPolyGrad( triFloat x, triFloat y, triFloat radius, triU32 color1, triU32 color2, triU32 numSteps, triFloat angle );
334void triDrawStar( triFloat x, triFloat y, triFloat radiusInner, triFloat radiusOuter, triU32 color, triU32 numSteps, triFloat angle );
345void triDrawStarOutline( triFloat x, triFloat y, triFloat radiusInner, triFloat radiusOuter, triU32 color, triU32 numSteps, triFloat angle );
357void triDrawStarGrad( triFloat x, triFloat y, triFloat radiusInner, triFloat radiusOuter, triU32 color1, triU32 color2, triU32 numSteps, triFloat angle );
360void triColorOp( triS32 op );
363void triImageTint( triS32 mode, triS32 comp, triU32 vcolor, triU32 ccolor );
364void triImageNoTint();
366void triImageConstAlpha( triU32 alpha );
367void triImageBlend( triS32 op, triS32 srcOp, triS32 dstOp, triU32 src_fix, triU32 dst_fix );
368void triImageNoBlend();
369void triImageColorkey( triU32 color );
370void triImageNoColorkey();
442void triDrawImage( triFloat x, triFloat y, triFloat width, triFloat height,
443 triFloat u0, triFloat v0, triFloat u1, triFloat v1,
467 triFloat u0, triFloat v0, triFloat u1, triFloat v1,
void triDrawImageScaled(triFloat x, triFloat y, triFloat width, triFloat height, triImage *img)
Render an image scaled by a factor.
void triDrawSprite(triFloat x, triFloat y, triFloat u, triFloat v, triImage *img)
Render a sprite.
void triDrawRectGrad(triFloat x, triFloat y, triFloat width, triFloat height, triU32 color1, triU32 color2, triU32 color3, triU32 color4)
Draw Rectangle from (x,y) to (x+width,y+height) with gradient.
void triDrawRectOutline(triFloat x, triFloat y, triFloat width, triFloat height, triU32 color)
Draw rectangle from (x,y) to (x+width,y+height) in color 'color' with outline only.
void triClose()
Close graphics and free all resources.
void triDrawImageCenterScaled(triFloat x, triFloat y, triFloat scale, triImage *img)
Render an image centered at position x,y scaled by a factor.
void triSpriteMode(triFloat width, triFloat height, triFloat angle)
Set sprite mode.
void triDrawCircle(triFloat x, triFloat y, triFloat radius, triU32 color)
Draw Circle.
void triDrawCircleOutline(triFloat x, triFloat y, triFloat radius, triU32 color)
Draw Circle (outline only)
void triBltSprite(triFloat x, triFloat y, triFloat u, triFloat v, triImage *img)
Render a sprite without effects (no blending, transparency, etc.)
void triDrawLine(triFloat x0, triFloat y0, triFloat x1, triFloat y1, triU32 color)
Draw a line from (x0,y0) to (x1,y1) in color 'color'.
triFloat triFpsMax()
Return the maximal FPS.
void triDrawLines(triVec2 *p, triS32 num, triU32 color)
Draw a line strip consisting of num points in color 'color'.
triFloat triFps()
Return the current FPS.
void triInit(triS32 psm, triBool doublebuffer)
Initialize graphics.
void triDrawImage(triFloat x, triFloat y, triFloat width, triFloat height, triFloat u0, triFloat v0, triFloat u1, triFloat v1, triImage *img)
Render an image.
void triDrawTriGrad(triFloat x0, triFloat y0, triFloat x1, triFloat y1, triFloat x2, triFloat y2, triU32 color1, triU32 color2, triU32 color3)
Draw arbitrary triangle with outline only.
void triSync()
Sync CPU to GU for the current immediate block.
triFloat triCPULoad()
Return the current CPU load in percent.
void triDrawImage2(triFloat x, triFloat y, triImage *img)
Render an image at full size.
void triDrawImageAnimation(triFloat x, triFloat y, triImageAnimation *ani)
Render an image animation.
void triVblank()
Wait for Vblank.
void triDrawImageAnimationRotate(triFloat x, triFloat y, triFloat angle, triImageAnimation *ani)
Render an image animation with rotation.
void triEnd()
End an immediate render command block.
void triDrawRegPolyGrad(triFloat x, triFloat y, triFloat radius, triU32 color1, triU32 color2, triU32 numSteps, triFloat angle)
Draw regular Polygon (Pentagon,Hexagon,Octagon,etc) with gradient.
void triDrawTri(triFloat x0, triFloat y0, triFloat x1, triFloat y1, triFloat x2, triFloat y2, triU32 color)
Draw arbitrary triangle.
void triDrawImageRotate2(triFloat x, triFloat y, triFloat angle, triImage *img)
Render an image with rotation.
void triSwapbuffers()
Wait for rendering to finish and swap front- and backbuffer.
void triDrawStarGrad(triFloat x, triFloat y, triFloat radiusInner, triFloat radiusOuter, triU32 color1, triU32 color2, triU32 numSteps, triFloat angle)
Draw Star with gradient.
void triBegin()
Begin an immediate render command block This is needed when you depend on the render result (e....
void triDrawRect(triFloat x, triFloat y, triFloat width, triFloat height, triU32 color)
Draw filled rectangle from (x,y) to (x+width,y+height) in color 'color'.
void triDrawRegPolyOutline(triFloat x, triFloat y, triFloat radius, triU32 color, triU32 numSteps, triFloat angle)
Draw regular Polygon (Pentagon,Hexagon,Octagon,etc) with outline only.
void triDrawStarOutline(triFloat x, triFloat y, triFloat radiusInner, triFloat radiusOuter, triU32 color, triU32 numSteps, triFloat angle)
Draw Star with outline only.
void triDrawRectRotate(triFloat x, triFloat y, triFloat width, triFloat height, triU32 color, triFloat angle)
Draw Rectangle from (x,y) to (x+width,y+height) in color 'color' rotated by angle degree around it's ...
void triDrawTriOutline(triFloat x0, triFloat y0, triFloat x1, triFloat y1, triFloat x2, triFloat y2, triU32 color)
Draw arbitrary triangle with outline only.
void triDrawRegPoly(triFloat x, triFloat y, triFloat radius, triU32 color, triU32 numSteps, triFloat angle)
Draw regular Polygon (Pentagon,Hexagon,Octagon,etc)
triFloat triFpsMin()
Return the minimal FPS.
triFloat triGPULoad()
Return the current GPU load in percent.
void triDrawCircleGrad(triFloat x, triFloat y, triFloat radius, triU32 color1, triU32 color2)
Draw Circle with gradient.
void triDrawStar(triFloat x, triFloat y, triFloat radiusInner, triFloat radiusOuter, triU32 color, triU32 numSteps, triFloat angle)
Draw Star.
void triDrawImageRotate(triFloat x, triFloat y, triFloat width, triFloat height, triFloat u0, triFloat v0, triFloat u1, triFloat v1, triFloat angle, triImage *img)
Render an image with rotation.
ImageAnimation struct.
Definition: triImage.h:234
Image struct.
Definition: triImage.h:158
2D float Vector
Definition: triTypes.h:85