#include <gccore.h>
Data Structures | |
| struct | GRRLIB_texImg |
| Structure to hold the texture informations. More... | |
| struct | GRRLIB_bytemapChar |
| Structure to hold the bytemap character informations. More... | |
| struct | GRRLIB_bytemapFont |
| Structure to hold the bytemap font informations. More... | |
Functions | |
| void | GRRLIB_FillScreen (u32 color) |
| Clear screen with a specific color. | |
| void | GRRLIB_Plot (f32 x, f32 y, u32 color) |
| Draw a dot. | |
| void | GRRLIB_NPlot (Vector v[], u32 color, long n) |
| Draw an array of points. | |
| void | GRRLIB_Line (f32 x1, f32 y1, f32 x2, f32 y2, u32 color) |
| Draw a line. | |
| void | GRRLIB_Rectangle (f32 x, f32 y, f32 width, f32 height, u32 color, u8 filled) |
| Draw a rectangle. | |
| void | GRRLIB_Circle (f32 x, f32 y, f32 radius, u32 color, u8 filled) |
| Draw a circle. | |
| void | GRRLIB_NGone (Vector v[], u32 color, long n) |
| Draw a polygon. | |
| void | GRRLIB_NGoneFilled (Vector v[], u32 color, long n) |
| Draw a filled polygon. | |
| GRRLIB_texImg | GRRLIB_CreateEmptyTexture (unsigned int, unsigned int) |
| Create an empty texture. | |
| GRRLIB_texImg | GRRLIB_LoadTexture (const unsigned char my_img[]) |
| Load a texture from a buffer. | |
| GRRLIB_bytemapFont | GRRLIB_LoadBMF (const unsigned char my_bmf[]) |
| Load a ByteMap font structure from a buffer. | |
| void | GRRLIB_FreeBMF (GRRLIB_bytemapFont bmf) |
| Free memory. | |
| void | GRRLIB_InitTileSet (struct GRRLIB_texImg *tex, unsigned int tilew, unsigned int tileh, unsigned int tilestart) |
| Initialize a tile set. | |
| void | GRRLIB_DrawImg (f32 xpos, f32 ypos, GRRLIB_texImg tex, float degrees, float scaleX, f32 scaleY, u32 color) |
| Draw a texture. | |
| void | GRRLIB_DrawTile (f32 xpos, f32 ypos, GRRLIB_texImg tex, float degrees, float scaleX, f32 scaleY, u32 color, int frame) |
| Draw a tile. | |
| void | GRRLIB_Printf (f32 xpos, f32 ypos, GRRLIB_texImg tex, u32 color, f32 zoom, const char *text,...) |
| Print formatted output. | |
| void | GRRLIB_PrintBMF (f32 xpos, f32 ypos, GRRLIB_bytemapFont bmf, f32 zoom, const char *text,...) |
| Print formatted output. | |
| bool | GRRLIB_PtInRect (int hotx, int hoty, int hotw, int hoth, int wpadx, int wpady) |
| Determines whether the specified point lies within the specified rectangle. | |
| bool | GRRLIB_RectInRect (int rect1x, int rect1y, int rect1w, int rect1h, int rect2x, int rect2y, int rect2w, int rect2h) |
| Determines whether a specified rectangle lies within another rectangle. | |
| bool | GRRLIB_RectOnRect (int rect1x, int rect1y, int rect1w, int rect1h, int rect2x, int rect2y, int rect2w, int rect2h) |
| Determines whether a part of a specified rectangle lies on another rectangle. | |
| u32 | GRRLIB_GetPixelFromtexImg (int x, int y, GRRLIB_texImg tex) |
| Return the color value of a pixel from a GRRLIB_texImg. | |
| void | GRRLIB_SetPixelTotexImg (int x, int y, GRRLIB_texImg tex, u32 color) |
| Set the color value of a pixel to a GRRLIB_texImg. | |
| void | GRRLIB_FlushTex (GRRLIB_texImg tex) |
| Writes the contents of a texture in the data cache down to main memory. | |
| void | GRRLIB_BMFX_Grayscale (GRRLIB_texImg texsrc, GRRLIB_texImg texdest) |
| Change a texture to gray scale. | |
| void | GRRLIB_BMFX_Invert (GRRLIB_texImg texsrc, GRRLIB_texImg texdest) |
| Invert colors of the texture. | |
| void | GRRLIB_BMFX_FlipH (GRRLIB_texImg texsrc, GRRLIB_texImg texdest) |
| Flip texture horizontal. | |
| void | GRRLIB_BMFX_FlipV (GRRLIB_texImg texsrc, GRRLIB_texImg texdest) |
| Flip texture vertical. | |
| void | GRRLIB_BMFX_Blur (GRRLIB_texImg texsrc, GRRLIB_texImg texdest, int factor) |
| Blur a texture. | |
| void | GRRLIB_BMFX_Scatter (GRRLIB_texImg texsrc, GRRLIB_texImg texdest, int factor) |
| A texture effect. | |
| void | GRRLIB_BMFX_Pixelate (GRRLIB_texImg texsrc, GRRLIB_texImg texdest, int factor) |
| A texture effect. | |
| void | GRRLIB_GXEngine (Vector v[], u32 color, long count, u8 fmt) |
| void | GRRLIB_Init () |
| Initialize GRRLIB. | |
| void | GRRLIB_Render () |
| Call this function after drawing. | |
| void | GRRLIB_Exit () |
| Call this before exiting your application. | |
Variables | |
| Mtx | GXmodelView2D |
| void GRRLIB_BMFX_Blur | ( | GRRLIB_texImg | texsrc, | |
| GRRLIB_texImg | texdest, | |||
| int | factor | |||
| ) |
Blur a texture.
| texsrc | the texture source. | |
| texdest | the texture destination. | |
| factor | the blur factor. |
| void GRRLIB_BMFX_FlipH | ( | GRRLIB_texImg | texsrc, | |
| GRRLIB_texImg | texdest | |||
| ) |
Flip texture horizontal.
| texsrc | the texture source. | |
| texdest | the texture destination. |
| void GRRLIB_BMFX_FlipV | ( | GRRLIB_texImg | texsrc, | |
| GRRLIB_texImg | texdest | |||
| ) |
Flip texture vertical.
| texsrc | the texture source. | |
| texdest | the texture destination. |
| void GRRLIB_BMFX_Grayscale | ( | GRRLIB_texImg | texsrc, | |
| GRRLIB_texImg | texdest | |||
| ) |
Change a texture to gray scale.
| texsrc | the texture source. | |
| texdest | the texture grayscaled destination. |
| void GRRLIB_BMFX_Invert | ( | GRRLIB_texImg | texsrc, | |
| GRRLIB_texImg | texdest | |||
| ) |
Invert colors of the texture.
| texsrc | the texture source. | |
| texdest | the texture destination. |
| void GRRLIB_BMFX_Pixelate | ( | GRRLIB_texImg | texsrc, | |
| GRRLIB_texImg | texdest, | |||
| int | factor | |||
| ) |
A texture effect.
| texsrc | the texture source. | |
| texdest | the texture destination. | |
| factor | The factor level of the effect. |
| void GRRLIB_BMFX_Scatter | ( | GRRLIB_texImg | texsrc, | |
| GRRLIB_texImg | texdest, | |||
| int | factor | |||
| ) |
A texture effect.
| texsrc | the texture source. | |
| texdest | the texture destination. | |
| factor | The factor level of the effect. |
| void GRRLIB_Circle | ( | f32 | x, | |
| f32 | y, | |||
| f32 | radius, | |||
| u32 | color, | |||
| u8 | filled | |||
| ) | [inline] |
Draw a circle.
| x | ||
| y | ||
| radius | the radius of the circle. | |
| color | the color of the circle in RGBA format. | |
| filled | true to fill the circle with a color. |
| GRRLIB_texImg GRRLIB_CreateEmptyTexture | ( | unsigned int | w, | |
| unsigned int | h | |||
| ) |
Create an empty texture.
| w | width of the new texture to create. | |
| h | height of the new texture to create. |
| void GRRLIB_DrawImg | ( | f32 | xpos, | |
| f32 | ypos, | |||
| GRRLIB_texImg | tex, | |||
| float | degrees, | |||
| float | scaleX, | |||
| f32 | scaleY, | |||
| u32 | color | |||
| ) | [inline] |
Draw a texture.
| xpos | specifies the x-coordinate of the upper-left corner. | |
| ypos | specifies the y-coordinate of the upper-left corner. | |
| tex | texture to draw. | |
| degrees | angle of rotation. | |
| scaleX | specifies the x-coordinate scale. -1 could be used for flipping the texture horizontally. | |
| scaleY | specifies the y-coordinate scale. -1 could be used for flipping the texture vertically. | |
| color |
| void GRRLIB_DrawTile | ( | f32 | xpos, | |
| f32 | ypos, | |||
| GRRLIB_texImg | tex, | |||
| float | degrees, | |||
| float | scaleX, | |||
| f32 | scaleY, | |||
| u32 | color, | |||
| int | frame | |||
| ) | [inline] |
Draw a tile.
| xpos | specifies the x-coordinate of the upper-left corner. | |
| ypos | specifies the y-coordinate of the upper-left corner. | |
| tex | texture containing the tile to draw. | |
| degrees | angle of rotation. | |
| scaleX | specifies the x-coordinate scale. -1 could be used for flipping the texture horizontally. | |
| scaleY | specifies the y-coordinate scale. -1 could be used for flipping the texture vertically. | |
| color | ||
| frame | specifies the frame to draw. |
| void GRRLIB_FillScreen | ( | u32 | color | ) | [inline] |
Clear screen with a specific color.
| color | the color to use to fill the screen. |
| void GRRLIB_FlushTex | ( | GRRLIB_texImg | tex | ) |
Writes the contents of a texture in the data cache down to main memory.
For performance the CPU holds a data cache where modifications are stored before they get written down to mainmemory.
| tex | the texture to flush. |
| void GRRLIB_FreeBMF | ( | GRRLIB_bytemapFont | bmf | ) |
| u32 GRRLIB_GetPixelFromtexImg | ( | int | x, | |
| int | y, | |||
| GRRLIB_texImg | tex | |||
| ) |
Return the color value of a pixel from a GRRLIB_texImg.
| x | specifies the x-coordinate of the pixel in the texture. | |
| y | specifies the y-coordinate of the pixel in the texture. | |
| tex | texture to get the color from. |
| void GRRLIB_GXEngine | ( | Vector | v[], | |
| u32 | color, | |||
| long | n, | |||
| u8 | fmt | |||
| ) |
| v | ||
| color | ||
| n | ||
| fmt |
| void GRRLIB_Init | ( | ) |
| void GRRLIB_InitTileSet | ( | struct GRRLIB_texImg * | tex, | |
| unsigned int | tilew, | |||
| unsigned int | tileh, | |||
| unsigned int | tilestart | |||
| ) |
Initialize a tile set.
| tex | texture to initialize. | |
| tilew | widht of the tile. | |
| tileh | height of the tile. | |
| tilestart | offset for starting position. |
| void GRRLIB_Line | ( | f32 | x1, | |
| f32 | y1, | |||
| f32 | x2, | |||
| f32 | y2, | |||
| u32 | color | |||
| ) | [inline] |
Draw a line.
| x1 | start point for line for the x coordinate. | |
| y1 | start point for line for the y coordinate. | |
| x2 | end point for line for the x coordinate. | |
| y2 | end point for line for the x coordinate. | |
| color | line color in RGBA format. |
| GRRLIB_bytemapFont GRRLIB_LoadBMF | ( | const unsigned char | my_bmf[] | ) |
Load a ByteMap font structure from a buffer.
| my_bmf | the ByteMap font buffer to load. |
| GRRLIB_texImg GRRLIB_LoadTexture | ( | const unsigned char | my_img[] | ) |
Load a texture from a buffer.
| my_img | the JPEG or PNG buffer to load. |
| void GRRLIB_NGone | ( | Vector | v[], | |
| u32 | color, | |||
| long | n | |||
| ) |
Draw a polygon.
| v | ||
| color | the color of the polygon in RGBA format. | |
| n |
| void GRRLIB_NGoneFilled | ( | Vector | v[], | |
| u32 | color, | |||
| long | n | |||
| ) |
Draw a filled polygon.
| v | ||
| color | the color of the filled polygon in RGBA format. | |
| n |
| void GRRLIB_NPlot | ( | Vector | v[], | |
| u32 | color, | |||
| long | n | |||
| ) |
Draw an array of points.
| v | array containing the points. | |
| color | the color of the points in RGBA format. | |
| n | number of points in the vector array. |
| void GRRLIB_Plot | ( | f32 | x, | |
| f32 | y, | |||
| u32 | color | |||
| ) | [inline] |
Draw a dot.
| x | specifies the x-coordinate of the dot. | |
| y | specifies the y-coordinate of the dot. | |
| color | the color of the dot in RGBA format. |
| void GRRLIB_PrintBMF | ( | f32 | xpos, | |
| f32 | ypos, | |||
| GRRLIB_bytemapFont | bmf, | |||
| f32 | zoom, | |||
| const char * | text, | |||
| ... | ||||
| ) |
Print formatted output.
| xpos | ||
| ypos | ||
| bmf | ||
| zoom | ||
| text | text to draw. | |
| ... | Optional arguments. |
| void GRRLIB_Printf | ( | f32 | xpos, | |
| f32 | ypos, | |||
| GRRLIB_texImg | tex, | |||
| u32 | color, | |||
| f32 | zoom, | |||
| const char * | text, | |||
| ... | ||||
| ) |
Print formatted output.
| xpos | specifies the x-coordinate of the upper-left corner of the text. | |
| ypos | specifies the y-coordinate of the upper-left corner of the text. | |
| tex | texture containing the character set. | |
| color | text color in RGBA format. The alpha channel is used to change the opacity of the text. | |
| zoom | this is a factor by which the text size will be increase or decrease. | |
| text | text to draw. | |
| ... | Optional arguments. |
| bool GRRLIB_PtInRect | ( | int | hotx, | |
| int | hoty, | |||
| int | hotw, | |||
| int | hoth, | |||
| int | wpadx, | |||
| int | wpady | |||
| ) |
Determines whether the specified point lies within the specified rectangle.
| hotx | specifies the x-coordinate of the upper-left corner of the rectangle. | |
| hoty | specifies the y-coordinate of the upper-left corner of the rectangle. | |
| hotw | the width of the rectangle. | |
| hoth | the height of the rectangle. | |
| wpadx | specifies the x-coordinate of the point. | |
| wpady | specifies the y-coordinate of the point. |
| void GRRLIB_Rectangle | ( | f32 | x, | |
| f32 | y, | |||
| f32 | width, | |||
| f32 | height, | |||
| u32 | color, | |||
| u8 | filled | |||
| ) | [inline] |
Draw a rectangle.
| x | specifies the x-coordinate of the upper-left corner of the rectangle. | |
| y | specifies the y-coordinate of the upper-left corner of the rectangle. | |
| width | the width of the rectangle. | |
| height | the height of the rectangle. | |
| color | the color of the rectangle in RGBA format. | |
| filled | true to fill the rectangle with a color. |
| bool GRRLIB_RectInRect | ( | int | rect1x, | |
| int | rect1y, | |||
| int | rect1w, | |||
| int | rect1h, | |||
| int | rect2x, | |||
| int | rect2y, | |||
| int | rect2w, | |||
| int | rect2h | |||
| ) |
Determines whether a specified rectangle lies within another rectangle.
| rect1x | specifies the x-coordinate of the upper-left corner of the rectangle. | |
| rect1y | specifies the y-coordinate of the upper-left corner of the rectangle. | |
| rect1w | specifies the width of the rectangle. | |
| rect1h | specifies the height of the rectangle. | |
| rect2x | specifies the x-coordinate of the upper-left corner of the rectangle. | |
| rect2y | specifies the y-coordinate of the upper-left corner of the rectangle. | |
| rect2w | specifies the width of the rectangle. | |
| rect2h | specifies the height of the rectangle. |
| bool GRRLIB_RectOnRect | ( | int | rect1x, | |
| int | rect1y, | |||
| int | rect1w, | |||
| int | rect1h, | |||
| int | rect2x, | |||
| int | rect2y, | |||
| int | rect2w, | |||
| int | rect2h | |||
| ) |
Determines whether a part of a specified rectangle lies on another rectangle.
| rect1x | specifies the x-coordinate of the upper-left corner of the first rectangle. | |
| rect1y | specifies the y-coordinate of the upper-left corner of the first rectangle. | |
| rect1w | specifies the width of the first rectangle. | |
| rect1h | specifies the height of the first rectangle. | |
| rect2x | specifies the x-coordinate of the upper-left corner of the second rectangle. | |
| rect2y | specifies the y-coordinate of the upper-left corner of the second rectangle. | |
| rect2w | specifies the width of the second rectangle. | |
| rect2h | specifies the height of the second rectangle. |
| void GRRLIB_SetPixelTotexImg | ( | int | x, | |
| int | y, | |||
| GRRLIB_texImg | tex, | |||
| u32 | color | |||
| ) |
Set the color value of a pixel to a GRRLIB_texImg.
| x | specifies the x-coordinate of the pixel in the texture. | |
| y | specifies the y-coordinate of the pixel in the texture. | |
| tex | texture to set the color to. | |
| color | the color of the pixel in RGBA format. |
1.5.8