GRRLIB 4.4.1
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
Everything in GRRLIB

This is the complete list of functions, structures, defines, typedefs, enumerations and variables you may want to used to make your homebrew with GRRLIB. More...

Data Structures

struct  GRRLIB_drawSettings
 Structure to hold the current drawing settings. More...
 
struct  GRRLIB_texImg
 Structure to hold the texture information. More...
 
struct  GRRLIB_bytemapChar
 Structure to hold the bytemap character information. More...
 
struct  GRRLIB_bytemapFont
 Structure to hold the bytemap font information. More...
 
struct  GRRLIB_Font
 Structure to hold the TTF information. More...
 

Macros

#define GRRLIB_VER_STRING   "4.4.1"
 Version information for GRRLIB.
 
#define R(c)   (((c) >>24) &0xFF)
 Extract red component of colour.
 
#define G(c)   (((c) >>16) &0xFF)
 Extract green component of colour.
 
#define B(c)   (((c) >> 8) &0xFF)
 Extract blue component of colour.
 
#define A(c)   ( (c) &0xFF)
 Extract alpha component of colour.
 
#define RGBA(r, g, b, a)
 Build an RGB pixel from components.
 
#define GRRLIB_BLEND_NONE   (GRRLIB_BLEND_ALPHA)
 Alias for GRRLIB_BLEND_ALPHA.
 
#define GRRLIB_BLEND_LIGHT   (GRRLIB_BLEND_ADD)
 Alias for GRRLIB_BLEND_ADD.
 
#define GRRLIB_BLEND_SHADE   (GRRLIB_BLEND_MULTI)
 Alias for GRRLIB_BLEND_MULTI.
 
#define GRR_EXTERN   extern
 
#define GRR_INIT(v)
 
#define GRR_INITS(...)
 
#define INLINE   static inline
 

Typedefs

typedef enum GRRLIB_blendMode GRRLIB_blendMode
 GRRLIB Blending Modes.
 
typedef struct GRRLIB_drawSettings GRRLIB_drawSettings
 Structure to hold the current drawing settings.
 
typedef struct GRRLIB_texImg GRRLIB_texImg
 Structure to hold the texture information.
 
typedef struct GRRLIB_bytemapChar GRRLIB_bytemapChar
 Structure to hold the bytemap character information.
 
typedef struct GRRLIB_bytemapFont GRRLIB_bytemapFont
 Structure to hold the bytemap font information.
 
typedef struct GRRLIB_Font GRRLIB_ttfFont
 Structure to hold the TTF information.
 

Enumerations

enum  GRRLIB_blendMode {
  GRRLIB_BLEND_ALPHA = 0 , GRRLIB_BLEND_ADD = 1 , GRRLIB_BLEND_SCREEN = 2 , GRRLIB_BLEND_MULTI = 3 ,
  GRRLIB_BLEND_INV = 4
}
 GRRLIB Blending Modes. More...
 

Functions

GRR_EXTERN void *xfb[2] GRR_INITS (NULL, NULL)
 
GRR_EXTERN u32 fb GRR_INIT (0)
 
INLINE void GRRLIB_ClipReset (void)
 Reset the clipping to normal.
 
INLINE void GRRLIB_ClipDrawing (const u32 x, const u32 y, const u32 width, const u32 height)
 Clip the drawing area to an rectangle.
 
INLINE bool GRRLIB_PtInRect (const int hotx, const int hoty, const int hotw, const int hoth, const int wpadx, const int wpady)
 Determine whether the specified point lies within the specified rectangle.
 
INLINE bool GRRLIB_RectInRect (const int rect1x, const int rect1y, const int rect1w, const int rect1h, const int rect2x, const int rect2y, const int rect2w, const int rect2h)
 Determine whether a specified rectangle lies within another rectangle.
 
INLINE bool GRRLIB_RectOnRect (const int rect1x, const int rect1y, const int rect1w, const int rect1h, const int rect2x, const int rect2y, const int rect2w, const int rect2h)
 Determine whether a part of a specified rectangle lies on another rectangle.
 
INLINE void GRRLIB_NPlot (const guVector v[], const u32 color[], const u16 n)
 Draw an array of points.
 
INLINE void GRRLIB_NGone (const guVector v[], const u32 color[], const u16 n)
 Draw a polygon.
 
INLINE void GRRLIB_NGoneFilled (const guVector v[], const u32 color[], const u16 n)
 Draw a filled polygon.
 
INLINE void GRRLIB_GXEngine (const guVector v[], const u32 color[], const u16 n, const u8 fmt)
 Draws a vector.
 
INLINE void GRRLIB_FillScreen (const u32 color)
 Clear screen with a specific color.
 
INLINE void GRRLIB_Plot (const f32 x, const f32 y, const u32 color)
 Draw a dot.
 
INLINE void GRRLIB_Line (const f32 x1, const f32 y1, const f32 x2, const f32 y2, const u32 color)
 Draw a line.
 
INLINE void GRRLIB_Rectangle (const f32 x, const f32 y, const f32 width, const f32 height, const u32 color, const bool filled)
 Draw a rectangle.
 
INLINE void GRRLIB_SetHandle (GRRLIB_texImg *tex, const int x, const int y)
 Set a texture's X and Y handles.
 
INLINE void GRRLIB_SetMidHandle (GRRLIB_texImg *tex, const bool enabled)
 Center a texture's handles.
 
INLINE u32 GRRLIB_GetPixelFromtexImg (const int x, const int y, const GRRLIB_texImg *tex)
 Return the color value of a pixel from a GRRLIB_texImg.
 
INLINE void GRRLIB_SetPixelTotexImg (const int x, const int y, GRRLIB_texImg *tex, const u32 color)
 Set the color value of a pixel to a GRRLIB_texImg.
 
INLINE u32 GRRLIB_GetPixelFromFB (int x, int y)
 Reads a pixel directly from the FrontBuffer.
 
INLINE void GRRLIB_SetPixelToFB (int x, int y, u32 pokeColor)
 Writes a pixel directly from the FrontBuffer.
 
INLINE void GRRLIB_SetBlend (const GRRLIB_blendMode blendmode)
 Set a blending mode.
 
INLINE GRRLIB_blendMode GRRLIB_GetBlend (void)
 Get the current blending mode.
 
INLINE void GRRLIB_SetAntiAliasing (const bool aa)
 Turn anti-aliasing on/off.
 
INLINE bool GRRLIB_GetAntiAliasing (void)
 Get current anti-aliasing setting.
 
INLINE void GRRLIB_ClearTex (GRRLIB_texImg *tex)
 Clear a texture to transparent black.
 
INLINE void GRRLIB_FlushTex (GRRLIB_texImg *tex)
 Write the contents of a texture in the data cache down to main memory.
 
INLINE void GRRLIB_FreeTexture (GRRLIB_texImg *tex)
 Free memory allocated for texture.
 
GRRLIB_bytemapFontGRRLIB_LoadBMF (const u8 my_bmf[])
 Load a ByteMap font structure from a buffer.
 
void GRRLIB_FreeBMF (GRRLIB_bytemapFont *bmf)
 Free memory allocated by ByteMap fonts.
 
void GRRLIB_InitTileSet (GRRLIB_texImg *tex, const u32 tilew, const u32 tileh, const u32 tilestart)
 Initialize a tile set.
 
void GRRLIB_BMFX_FlipH (const GRRLIB_texImg *texsrc, GRRLIB_texImg *texdest)
 Flip texture horizontal.
 
void GRRLIB_BMFX_FlipV (const GRRLIB_texImg *texsrc, GRRLIB_texImg *texdest)
 Flip texture vertical.
 
void GRRLIB_BMFX_Grayscale (const GRRLIB_texImg *texsrc, GRRLIB_texImg *texdest)
 Change a texture to gray scale.
 
void GRRLIB_BMFX_Sepia (const GRRLIB_texImg *texsrc, GRRLIB_texImg *texdest)
 Change a texture to sepia (old photo style).
 
void GRRLIB_BMFX_Invert (const GRRLIB_texImg *texsrc, GRRLIB_texImg *texdest)
 Invert colors of the texture.
 
void GRRLIB_BMFX_Blur (const GRRLIB_texImg *texsrc, GRRLIB_texImg *texdest, const u32 factor)
 A texture effect (Blur).
 
void GRRLIB_BMFX_Scatter (const GRRLIB_texImg *texsrc, GRRLIB_texImg *texdest, const u32 factor)
 A texture effect (Scatter).
 
void GRRLIB_BMFX_Pixelate (const GRRLIB_texImg *texsrc, GRRLIB_texImg *texdest, const u32 factor)
 A texture effect (Pixelate).
 
int GRRLIB_Init (void)
 Initialize GRRLIB.
 
void GRRLIB_Exit (void)
 Call this before exiting your application.
 
void GRRLIB_Ellipse (const f32 x, const f32 y, const f32 radiusX, const f32 radiusY, const u32 color, const u8 filled)
 Draw an ellipse.
 
void GRRLIB_Circle (const f32 x, const f32 y, const f32 radius, const u32 color, const u8 filled)
 Draw a circle.
 
int GRRLIB_LoadFile (const char *filename, u8 **data)
 Load a file to memory.
 
GRRLIB_texImgGRRLIB_LoadTextureFromFile (const char *filename)
 Load a texture from a file.
 
GRRLIB_ttfFontGRRLIB_LoadTTFFromFile (const char *filename)
 Load a TTF from a file.
 
bool GRRLIB_ScrShot (const char *filename)
 Make a PNG screenshot.
 
void GRRLIB_Printf (const f32 xpos, const f32 ypos, const GRRLIB_texImg *tex, const u32 color, const f32 zoom, const char *text,...)
 Print formatted output.
 
void GRRLIB_PrintBMF (const f32 xpos, const f32 ypos, const GRRLIB_bytemapFont *bmf, const char *text,...)
 Print formatted output with a ByteMap font.
 
void GRRLIB_DrawImg (const f32 xpos, const f32 ypos, const GRRLIB_texImg *tex, const f32 degrees, const f32 scaleX, const f32 scaleY, const u32 color)
 Draw a texture.
 
void GRRLIB_DrawImgQuad (const guVector pos[4], GRRLIB_texImg *tex, const u32 color)
 Draw a textured quad.
 
void GRRLIB_DrawTile (const f32 xpos, const f32 ypos, const GRRLIB_texImg *tex, const f32 degrees, const f32 scaleX, const f32 scaleY, const u32 color, const int frame)
 Draw a tile.
 
void GRRLIB_DrawPart (const f32 xpos, const f32 ypos, const f32 partx, const f32 party, const f32 partw, const f32 parth, const GRRLIB_texImg *tex, const f32 degrees, const f32 scaleX, const f32 scaleY, const u32 color)
 Draw a part of a texture.
 
void GRRLIB_DrawTileQuad (const guVector pos[4], GRRLIB_texImg *tex, const u32 color, const int frame)
 Draw a tile in a quad.
 
void GRRLIB_Render (void)
 Call this function after drawing.
 
void GRRLIB_Screen2Texture (u16 posx, u16 posy, GRRLIB_texImg *tex, bool clear)
 Make a snapshot of the screen in a texture WITHOUT ALPHA LAYER.
 
void GRRLIB_CompoStart (void)
 Start GX compositing process.
 
void GRRLIB_CompoEnd (u16 posx, u16 posy, GRRLIB_texImg *tex)
 End GX compositing process (Make a snapshot of the screen in a texture WITH ALPHA LAYER).
 
GRRLIB_texImgGRRLIB_CreateEmptyTexture (const u32 width, const u32 height)
 Create an empty texture.
 
GRRLIB_texImgGRRLIB_LoadTexture (const u8 *my_img)
 Load a texture from a buffer.
 
GRRLIB_texImgGRRLIB_LoadTexturePNG (const u8 *my_png)
 Load a texture from a buffer.
 
GRRLIB_texImgGRRLIB_LoadTextureJPG (const u8 *my_jpg)
 Load a texture from a buffer.
 
GRRLIB_texImgGRRLIB_LoadTextureJPGEx (const u8 *my_jpg, const u32 my_size)
 Load a texture from a buffer.
 
GRRLIB_texImgGRRLIB_LoadTextureBMP (const u8 *my_bmp)
 Load a texture from a buffer.
 
bool GRRLIB_GeckoInit ()
 Initialize USB Gecko.
 
void GRRLIB_GeckoPrintf (const char *text,...)
 Print Gecko.
 
void GRRLIB_SetBackgroundColour (u8 r, u8 g, u8 b, u8 a)
 Set the background parameter when screen is cleared.
 
void GRRLIB_Camera3dSettings (f32 posx, f32 posy, f32 posz, f32 upx, f32 upy, f32 upz, f32 lookx, f32 looky, f32 lookz)
 Set the camera parameter (contributed by chris_c aka DaShAmAn).
 
void GRRLIB_3dMode (f32 minDist, f32 maxDist, f32 fov, bool texturemode, bool normalmode)
 Set up the position matrix (contributed by chris_c aka DaShAmAn).
 
void GRRLIB_2dMode ()
 Go back to 2D mode (contributed by chris_c aka DaShAmAn).
 
void GRRLIB_ObjectViewBegin (void)
 Init the object matrix to draw object.
 
void GRRLIB_ObjectViewScale (f32 scalx, f32 scaly, f32 scalz)
 Scale the object matrix to draw object.
 
void GRRLIB_ObjectViewRotate (f32 angx, f32 angy, f32 angz)
 Rotate the object matrix to draw object.
 
void GRRLIB_ObjectViewTrans (f32 posx, f32 posy, f32 posz)
 Translate the object matrix to draw object.
 
void GRRLIB_ObjectViewEnd (void)
 Concat the object and the view matrix and calculate the inverse normal matrix.
 
void GRRLIB_ObjectView (f32 posx, f32 posy, f32 posz, f32 angx, f32 angy, f32 angz, f32 scalx, f32 scaly, f32 scalz)
 Set the view matrix to draw object (in this order scale, rotate AND trans).
 
void GRRLIB_ObjectViewInv (f32 posx, f32 posy, f32 posz, f32 angx, f32 angy, f32 angz, f32 scalx, f32 scaly, f32 scalz)
 Set the view matrix to draw object (in this order scale, trans AND rotate).
 
void GRRLIB_SetTexture (GRRLIB_texImg *tex, bool rep)
 Set the texture to an object (contributed by chris_c aka DaShAmAn).
 
void GRRLIB_DrawTorus (f32 r, f32 R, int nsides, int rings, bool filled, u32 col)
 Draw a torus (with normal).
 
void GRRLIB_DrawSphere (f32 r, int lats, int longs, bool filled, u32 col)
 Draw a sphere (with normal).
 
void GRRLIB_DrawCube (f32 size, bool filled, u32 col)
 Draw a cube (with normal).
 
void GRRLIB_DrawCylinder (f32 r, f32 h, u16 d, bool filled, u32 col)
 Draw a cylinder (with normal).
 
void GRRLIB_DrawCone (f32 r, f32 h, u16 d, bool filled, u32 col)
 Draw a cone (with normal).
 
void GRRLIB_DrawTessPanel (f32 w, f32 wstep, f32 h, f32 hstep, bool filled, u32 col)
 Draw a Tesselated panel (with normal).
 
void GRRLIB_SetLightAmbient (u32 ambientcolor)
 Set ambient color.
 
void GRRLIB_SetLightDiff (u8 num, guVector pos, f32 distattn, f32 brightness, u32 lightcolor)
 Set diffuse light parameters.
 
void GRRLIB_SetLightSpec (u8 num, guVector dir, f32 shininess, u32 lightcolor, u32 speccolor)
 Set specular light parameters.
 
void GRRLIB_SetLightSpot (u8 num, guVector pos, guVector lookat, f32 angAttn0, f32 angAttn1, f32 angAttn2, f32 distAttn0, f32 distAttn1, f32 distAttn2, u32 lightcolor)
 Set Spot light parameters.
 
void GRRLIB_SetLightOff (void)
 Set all lights off, like at init.
 
GRRLIB_ttfFontGRRLIB_LoadTTF (const u8 *file_base, s32 file_size)
 Load a TTF from a buffer.
 
void GRRLIB_FreeTTF (GRRLIB_ttfFont *myFont)
 Free memory allocated by TTF fonts.
 
void GRRLIB_PrintfTTF (int x, int y, GRRLIB_ttfFont *myFont, const char *string, unsigned int fontSize, const u32 color)
 Print function for TTF font.
 
void GRRLIB_PrintfTTFW (int x, int y, GRRLIB_ttfFont *myFont, const wchar_t *string, unsigned int fontSize, const u32 color)
 Print function for TTF font.
 
u32 GRRLIB_WidthTTF (GRRLIB_ttfFont *myFont, const char *, unsigned int)
 Get the width of a text in pixel.
 
u32 GRRLIB_WidthTTFW (GRRLIB_ttfFont *myFont, const wchar_t *, unsigned int)
 Get the width of a text in pixel.
 

Variables

GRR_EXTERN GXRModeObj * rmode
 Video mode.
 

Detailed Description

This is the complete list of functions, structures, defines, typedefs, enumerations and variables you may want to used to make your homebrew with GRRLIB.

You simply need to include grrlib.h in your project to have access to all of these.

Macro Definition Documentation

◆ RGBA

#define RGBA (   r,
  g,
  b,
 
)
Value:
( (u32)( ( ((u32)(r)) <<24) | \
((((u32)(g)) &0xFF) <<16) | \
((((u32)(b)) &0xFF) << 8) | \
( ((u32)(a)) &0xFF ) ) )

Build an RGB pixel from components.

Parameters
rRed component.
gGreen component.
bBlue component.
aAlpha component.

Enumeration Type Documentation

◆ GRRLIB_blendMode

GRRLIB Blending Modes.

Enumerator
GRRLIB_BLEND_ALPHA 

Alpha Blending.

GRRLIB_BLEND_ADD 

Additive Blending.

GRRLIB_BLEND_SCREEN 

Alpha Light Blending.

GRRLIB_BLEND_MULTI 

Multiply Blending.

GRRLIB_BLEND_INV 

Invert Color Blending.

Function Documentation

◆ GRRLIB_3dMode()

void GRRLIB_3dMode ( f32  minDist,
f32  maxDist,
f32  fov,
bool  texturemode,
bool  normalmode 
)

Set up the position matrix (contributed by chris_c aka DaShAmAn).

Parameters
minDistMinimal distance for the camera.
maxDistMaximal distance for the camera.
fovField of view for the camera.
texturemodeFalse, GX won't need texture coordinate, True, GX will need texture coordinate.
normalmodeFalse, GX won't need normal coordinate, True, GX will need normal coordinate.

◆ GRRLIB_BMFX_Blur()

void GRRLIB_BMFX_Blur ( const GRRLIB_texImg texsrc,
GRRLIB_texImg texdest,
const u32  factor 
)

A texture effect (Blur).

See also
GRRLIB_FlushTex
Parameters
texsrcThe texture source.
texdestThe texture destination.
factorThe blur factor.

◆ GRRLIB_BMFX_FlipH()

void GRRLIB_BMFX_FlipH ( const GRRLIB_texImg texsrc,
GRRLIB_texImg texdest 
)

Flip texture horizontal.

See also
GRRLIB_FlushTex
Parameters
texsrcThe texture source.
texdestThe texture destination.

◆ GRRLIB_BMFX_FlipV()

void GRRLIB_BMFX_FlipV ( const GRRLIB_texImg texsrc,
GRRLIB_texImg texdest 
)

Flip texture vertical.

See also
GRRLIB_FlushTex
Parameters
texsrcThe texture source.
texdestThe texture destination.

◆ GRRLIB_BMFX_Grayscale()

void GRRLIB_BMFX_Grayscale ( const GRRLIB_texImg texsrc,
GRRLIB_texImg texdest 
)

Change a texture to gray scale.

See also
GRRLIB_FlushTex
Parameters
texsrcThe texture source.
texdestThe texture grayscaled destination.

◆ GRRLIB_BMFX_Invert()

void GRRLIB_BMFX_Invert ( const GRRLIB_texImg texsrc,
GRRLIB_texImg texdest 
)

Invert colors of the texture.

See also
GRRLIB_FlushTex
Parameters
texsrcThe texture source.
texdestThe texture destination.

◆ GRRLIB_BMFX_Pixelate()

void GRRLIB_BMFX_Pixelate ( const GRRLIB_texImg texsrc,
GRRLIB_texImg texdest,
const u32  factor 
)

A texture effect (Pixelate).

See also
GRRLIB_FlushTex
Parameters
texsrcThe texture source.
texdestThe texture destination.
factorThe factor level of the effect.

◆ GRRLIB_BMFX_Scatter()

void GRRLIB_BMFX_Scatter ( const GRRLIB_texImg texsrc,
GRRLIB_texImg texdest,
const u32  factor 
)

A texture effect (Scatter).

See also
GRRLIB_FlushTex
Parameters
texsrcThe texture source.
texdestThe texture destination.
factorThe factor level of the effect.

◆ GRRLIB_BMFX_Sepia()

void GRRLIB_BMFX_Sepia ( const GRRLIB_texImg texsrc,
GRRLIB_texImg texdest 
)

Change a texture to sepia (old photo style).

See also
GRRLIB_FlushTex
Parameters
texsrcThe texture source.
texdestThe texture destination.
Author
elisherer

◆ GRRLIB_Camera3dSettings()

void GRRLIB_Camera3dSettings ( f32  posx,
f32  posy,
f32  posz,
f32  upx,
f32  upy,
f32  upz,
f32  lookx,
f32  looky,
f32  lookz 
)

Set the camera parameter (contributed by chris_c aka DaShAmAn).

Parameters
posxx position of the camera.
posyy position of the camera.
poszz position of the camera.
upxx up position of the camera.
upyy up position of the camera.
upzz up position of the camera.
lookxx position of the target.
lookyy position of the target.
lookzz position of the target.

◆ GRRLIB_Circle()

void GRRLIB_Circle ( const f32  x,
const f32  y,
const f32  radius,
const u32  color,
const u8  filled 
)

Draw a circle.

Parameters
xSpecifies the x-coordinate of the circle.
ySpecifies the y-coordinate of the circle.
radiusThe radius of the circle.
colorThe color of the circle in RGBA format.
filledSet to true to fill the circle.

◆ GRRLIB_ClearTex()

INLINE void GRRLIB_ClearTex ( GRRLIB_texImg tex)

Clear a texture to transparent black.

Parameters
texTexture to clear.

◆ GRRLIB_ClipDrawing()

INLINE void GRRLIB_ClipDrawing ( const u32  x,
const u32  y,
const u32  width,
const u32  height 
)

Clip the drawing area to an rectangle.

Parameters
xThe x-coordinate of the rectangle.
yThe y-coordinate of the rectangle.
widthThe width of the rectangle.
heightThe height of the rectangle.

◆ GRRLIB_CompoEnd()

void GRRLIB_CompoEnd ( u16  posx,
u16  posy,
GRRLIB_texImg tex 
)

End GX compositing process (Make a snapshot of the screen in a texture WITH ALPHA LAYER).

EFB is cleared after this function.

See also
GRRLIB_CompoStart
Parameters
posxTop left corner of the grabbed part.
posyTop left corner of the grabbed part.
texA pointer to a texture representing the screen.

◆ GRRLIB_CompoStart()

void GRRLIB_CompoStart ( void  )

Start GX compositing process.

See also
GRRLIB_CompoEnd

◆ GRRLIB_CreateEmptyTexture()

GRRLIB_texImg * GRRLIB_CreateEmptyTexture ( const u32  width,
const u32  height 
)

Create an empty texture.

Parameters
widthWidth of the new texture to create.
heightHeight of the new texture to create.
Returns
A GRRLIB_texImg structure newly created.

◆ GRRLIB_DrawCone()

void GRRLIB_DrawCone ( f32  r,
f32  h,
u16  d,
bool  filled,
u32  col 
)

Draw a cone (with normal).

Parameters
rRadius of the cone.
hHigh of the cone.
dDensity of slice.
filledWired or not.
colColor of the cone.

◆ GRRLIB_DrawCube()

void GRRLIB_DrawCube ( f32  size,
bool  filled,
u32  col 
)

Draw a cube (with normal).

Parameters
sizeSize of the cube edge.
filledWired or not.
colColor of the cube.

◆ GRRLIB_DrawCylinder()

void GRRLIB_DrawCylinder ( f32  r,
f32  h,
u16  d,
bool  filled,
u32  col 
)

Draw a cylinder (with normal).

Parameters
rRadius of the cylinder.
hHigh of the cylinder.
dDensity of slice.
filledWired or not.
colColor of the cylinder.

◆ GRRLIB_DrawImg()

void GRRLIB_DrawImg ( const f32  xpos,
const f32  ypos,
const GRRLIB_texImg tex,
const f32  degrees,
const f32  scaleX,
const f32  scaleY,
const u32  color 
)

Draw a texture.

Parameters
xposSpecifies the x-coordinate of the upper-left corner.
yposSpecifies the y-coordinate of the upper-left corner.
texThe texture to draw.
degreesAngle of rotation.
scaleXSpecifies the x-coordinate scale. -1 could be used for flipping the texture horizontally.
scaleYSpecifies the y-coordinate scale. -1 could be used for flipping the texture vertically.
colorColor in RGBA format.

◆ GRRLIB_DrawImgQuad()

void GRRLIB_DrawImgQuad ( const guVector  pos[4],
GRRLIB_texImg tex,
const u32  color 
)

Draw a textured quad.

Parameters
posVector array of the 4 points.
texThe texture to draw.
colorColor in RGBA format.

◆ GRRLIB_DrawPart()

void GRRLIB_DrawPart ( const f32  xpos,
const f32  ypos,
const f32  partx,
const f32  party,
const f32  partw,
const f32  parth,
const GRRLIB_texImg tex,
const f32  degrees,
const f32  scaleX,
const f32  scaleY,
const u32  color 
)

Draw a part of a texture.

Parameters
xposSpecifies the x-coordinate of the upper-left corner.
yposSpecifies the y-coordinate of the upper-left corner.
partxSpecifies the x-coordinate of the upper-left corner in the texture.
partySpecifies the y-coordinate of the upper-left corner in the texture.
partwSpecifies the width in the texture.
parthSpecifies the height in the texture.
texThe texture containing the tile to draw.
degreesAngle of rotation.
scaleXSpecifies the x-coordinate scale. -1 could be used for flipping the texture horizontally.
scaleYSpecifies the y-coordinate scale. -1 could be used for flipping the texture vertically.
colorColor in RGBA format.

◆ GRRLIB_DrawSphere()

void GRRLIB_DrawSphere ( f32  r,
int  lats,
int  longs,
bool  filled,
u32  col 
)

Draw a sphere (with normal).

Parameters
rRadius of the sphere.
latsNumber of latitudes.
longsNumber of longitudes.
filledWired or not.
colColor of the sphere.

◆ GRRLIB_DrawTessPanel()

void GRRLIB_DrawTessPanel ( f32  w,
f32  wstep,
f32  h,
f32  hstep,
bool  filled,
u32  col 
)

Draw a Tesselated panel (with normal).

Parameters
wWidth of the panel.
wstepSize of width slices.
hHeight of the panel.
hstepSize the de height slices.
filledWired or not.
colColor in RGBA format.

◆ GRRLIB_DrawTile()

void GRRLIB_DrawTile ( const f32  xpos,
const f32  ypos,
const GRRLIB_texImg tex,
const f32  degrees,
const f32  scaleX,
const f32  scaleY,
const u32  color,
const int  frame 
)

Draw a tile.

Parameters
xposSpecifies the x-coordinate of the upper-left corner.
yposSpecifies the y-coordinate of the upper-left corner.
texThe texture containing the tile to draw.
degreesAngle of rotation.
scaleXSpecifies the x-coordinate scale. -1 could be used for flipping the texture horizontally.
scaleYSpecifies the y-coordinate scale. -1 could be used for flipping the texture vertically.
colorColor in RGBA format.
frameSpecifies the frame to draw.

◆ GRRLIB_DrawTileQuad()

void GRRLIB_DrawTileQuad ( const guVector  pos[4],
GRRLIB_texImg tex,
const u32  color,
const int  frame 
)

Draw a tile in a quad.

Parameters
posVector array of the 4 points.
texThe texture to draw.
colorColor in RGBA format.
frameSpecifies the frame to draw.

◆ GRRLIB_DrawTorus()

void GRRLIB_DrawTorus ( f32  r,
f32  R,
int  nsides,
int  rings,
bool  filled,
u32  col 
)

Draw a torus (with normal).

Parameters
rRadius of the ring.
RRadius of the torus.
nsidesNumber of faces per ring.
ringsNumber of rings.
filledWired or not.
colColor of the torus.

◆ GRRLIB_Ellipse()

void GRRLIB_Ellipse ( const f32  x,
const f32  y,
const f32  radiusX,
const f32  radiusY,
const u32  color,
const u8  filled 
)

Draw an ellipse.

Author
Dark_Link
Parameters
xSpecifies the x-coordinate of the ellipse.
ySpecifies the y-coordinate of the ellipse.
radiusXThe X radius of the ellipse.
radiusYThe Y radius of the ellipse.
colorThe color of the ellipse in RGBA format.
filledSet to true to fill the ellipse.

◆ GRRLIB_Exit()

void GRRLIB_Exit ( void  )

Call this before exiting your application.

Ensure this function is only ever called once and only if the setup function has been called.

◆ GRRLIB_FillScreen()

INLINE void GRRLIB_FillScreen ( const u32  color)

Clear screen with a specific color.

Parameters
colorThe color to use to fill the screen.

◆ GRRLIB_FlushTex()

INLINE void GRRLIB_FlushTex ( GRRLIB_texImg tex)

Write 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 main memory.

Parameters
texThe texture to flush.

◆ GRRLIB_FreeBMF()

void GRRLIB_FreeBMF ( GRRLIB_bytemapFont bmf)

Free memory allocated by ByteMap fonts.

If bmf is a null pointer, the function does nothing.

Note
This function does not change the value of bmf itself, hence it still points to the same (now invalid) location.
Parameters
bmfA GRRLIB_bytemapFont structure.

◆ GRRLIB_FreeTexture()

INLINE void GRRLIB_FreeTexture ( GRRLIB_texImg tex)

Free memory allocated for texture.

If tex is a null pointer, the function does nothing.

Note
This function does not change the value of tex itself, hence it still points to the same (now invalid) location.
Parameters
texA GRRLIB_texImg structure.

◆ GRRLIB_FreeTTF()

void GRRLIB_FreeTTF ( GRRLIB_ttfFont myFont)

Free memory allocated by TTF fonts.

If myFont is a null pointer, the function does nothing.

Note
This function does not change the value of myFont itself, hence it still points to the same (now invalid) location.
Parameters
myFontA TTF.

◆ GRRLIB_GeckoInit()

bool GRRLIB_GeckoInit ( )

Initialize USB Gecko.

Returns
Returns true if everything worked, false if problems occurred.

◆ GRRLIB_GeckoPrintf()

void GRRLIB_GeckoPrintf ( const char *  text,
  ... 
)

Print Gecko.

Parameters
textText to print.
...Optional arguments.

◆ GRRLIB_GetAntiAliasing()

INLINE bool GRRLIB_GetAntiAliasing ( void  )

Get current anti-aliasing setting.

Returns
Returns true if anti-aliasing is enabled.

◆ GRRLIB_GetBlend()

INLINE GRRLIB_blendMode GRRLIB_GetBlend ( void  )

Get the current blending mode.

Returns
The current blending mode.

◆ GRRLIB_GetPixelFromFB()

INLINE u32 GRRLIB_GetPixelFromFB ( int  x,
int  y 
)

Reads a pixel directly from the FrontBuffer.

Parameters
xThe x-coordinate within the FB.
yThe y-coordinate within the FB.
Returns
The color of a pixel in RGBA format.

◆ GRRLIB_GetPixelFromtexImg()

INLINE u32 GRRLIB_GetPixelFromtexImg ( const int  x,
const int  y,
const GRRLIB_texImg tex 
)

Return the color value of a pixel from a GRRLIB_texImg.

Parameters
xSpecifies the x-coordinate of the pixel in the texture.
ySpecifies the y-coordinate of the pixel in the texture.
texThe texture to get the color from.
Returns
The color of a pixel in RGBA format.

◆ GRRLIB_GXEngine()

INLINE void GRRLIB_GXEngine ( const guVector  v[],
const u32  color[],
const u16  n,
const u8  fmt 
)

Draws a vector.

Parameters
vThe vector to draw.
colorThe color of the vector in RGBA format.
nNumber of points in the vector. The maximum is 65536.
fmtType of primitive.

◆ GRRLIB_Init()

int GRRLIB_Init ( void  )

Initialize GRRLIB.

Call this once at the beginning your code.

Returns
A integer representing a code:
  • 0 : The operation completed successfully.
  • -1 : Not enough memory is available to initialize GRRLIB.
  • -2 : Failed to add the fat device driver to the devoptab.
  • -3 : Failed to initialize the font engine.
See also
GRRLIB_Exit

◆ GRRLIB_InitTileSet()

void GRRLIB_InitTileSet ( GRRLIB_texImg tex,
const u32  tilew,
const u32  tileh,
const u32  tilestart 
)

Initialize a tile set.

Parameters
texThe texture to initialize.
tilewWidth of the tile.
tilehHeight of the tile.
tilestartOffset for starting position (Used in fonts).

◆ GRRLIB_Line()

INLINE void GRRLIB_Line ( const f32  x1,
const f32  y1,
const f32  x2,
const f32  y2,
const u32  color 
)

Draw a line.

Parameters
x1Starting point for line for the x coordinate.
y1Starting point for line for the y coordinate.
x2Ending point for line for the x coordinate.
y2Ending point for line for the x coordinate.
colorLine color in RGBA format.
Author
JESPA

◆ GRRLIB_LoadBMF()

GRRLIB_bytemapFont * GRRLIB_LoadBMF ( const u8  my_bmf[])

Load a ByteMap font structure from a buffer.

File format version 1.1 is used, more information could be found at https://bmf.php5.cz/?page=format

Parameters
my_bmfThe ByteMap font buffer to load.
Returns
A GRRLIB_bytemapFont structure filled with BMF information.
See also
GRRLIB_FreeBMF

◆ GRRLIB_LoadFile()

int GRRLIB_LoadFile ( const char *  filename,
u8 **  data 
)

Load a file to memory.

Parameters
filenameName of the file to be loaded.
dataPointer-to-your-pointer. Ie. { u8 *data; GRRLIB_LoadFile("file", &data); }. It is your responsibility to free the memory allocated by this function.
Returns
A integer representing a code:
  • 0 : EmptyFile.
  • -1 : FileNotFound.
  • -2 : OutOfMemory.
  • -3 : FileReadError.
  • >0 : FileLength.

◆ GRRLIB_LoadTexture()

GRRLIB_texImg * GRRLIB_LoadTexture ( const u8 *  my_img)

Load a texture from a buffer.

Parameters
my_imgThe JPEG, PNG or Bitmap buffer to load.
Returns
A GRRLIB_texImg structure filled with image information.

◆ GRRLIB_LoadTextureBMP()

GRRLIB_texImg * GRRLIB_LoadTextureBMP ( const u8 *  my_bmp)

Load a texture from a buffer.

It only works for the MS-Windows standard format uncompressed (1-bit, 4-bit, 8-bit, 24-bit and 32-bit).

Parameters
my_bmpThe Bitmap buffer to load.
Returns
A GRRLIB_texImg structure filled with image information.

◆ GRRLIB_LoadTextureFromFile()

GRRLIB_texImg * GRRLIB_LoadTextureFromFile ( const char *  filename)

Load a texture from a file.

Parameters
filenameThe JPEG, PNG or Bitmap filename to load.
Returns
A GRRLIB_texImg structure filled with image information. If an error occurs NULL will be returned.

◆ GRRLIB_LoadTextureJPG()

GRRLIB_texImg * GRRLIB_LoadTextureJPG ( const u8 *  my_jpg)

Load a texture from a buffer.

Take care to have the JPG finish with 0xFF 0xD9!

Parameters
my_jpgThe JPEG buffer to load.
Returns
A GRRLIB_texImg structure filled with image information.

◆ GRRLIB_LoadTextureJPGEx()

GRRLIB_texImg * GRRLIB_LoadTextureJPGEx ( const u8 *  my_jpg,
const u32  my_size 
)

Load a texture from a buffer.

Author
DrTwox
Parameters
my_jpgThe JPEG buffer to load.
my_sizeSize of the JPEG buffer to load.
Returns
A GRRLIB_texImg structure filled with image information.

◆ GRRLIB_LoadTexturePNG()

GRRLIB_texImg * GRRLIB_LoadTexturePNG ( const u8 *  my_png)

Load a texture from a buffer.

Parameters
my_pngthe PNG buffer to load.
Returns
A GRRLIB_texImg structure filled with image information. If image size is not correct, the texture will be completely transparent.

◆ GRRLIB_LoadTTF()

GRRLIB_ttfFont * GRRLIB_LoadTTF ( const u8 *  file_base,
s32  file_size 
)

Load a TTF from a buffer.

Parameters
file_baseBuffer with TTF data. You must not deallocate the memory before calling GRRLIB_FreeTTF.
file_sizeSize of the TTF buffer.
Returns
A handle to a given TTF font object or NULL if it fails to load the font.
See also
GRRLIB_FreeTTF

◆ GRRLIB_LoadTTFFromFile()

GRRLIB_ttfFont * GRRLIB_LoadTTFFromFile ( const char *  filename)

Load a TTF from a file.

Parameters
filenameThe TTF filename to load.
Returns
A GRRLIB_ttfFont structure filled with font information. If an error occurs NULL will be returned.

◆ GRRLIB_NGone()

INLINE void GRRLIB_NGone ( const guVector  v[],
const u32  color[],
const u16  n 
)

Draw a polygon.

Parameters
vThe vector containing the coordinates of the polygon.
colorThe color of the filled polygon in RGBA format.
nNumber of points in the vector. The maximum is 65536.

◆ GRRLIB_NGoneFilled()

INLINE void GRRLIB_NGoneFilled ( const guVector  v[],
const u32  color[],
const u16  n 
)

Draw a filled polygon.

Parameters
vThe vector containing the coordinates of the polygon.
colorThe color of the filled polygon in RGBA format.
nNumber of points in the vector. The maximum is 65536.

◆ GRRLIB_NPlot()

INLINE void GRRLIB_NPlot ( const guVector  v[],
const u32  color[],
const u16  n 
)

Draw an array of points.

Parameters
vArray containing the points.
colorThe color of the points in RGBA format.
nNumber of points in the vector array. The maximum is 65536.

◆ GRRLIB_ObjectView()

void GRRLIB_ObjectView ( f32  posx,
f32  posy,
f32  posz,
f32  angx,
f32  angy,
f32  angz,
f32  scalx,
f32  scaly,
f32  scalz 
)

Set the view matrix to draw object (in this order scale, rotate AND trans).

Parameters
posxx position of the object.
posyy position of the object.
poszz position of the object.
angxx rotation angle of the object.
angyy rotation angle of the object.
angzz rotation angle of the object.
scalxx scale of the object.
scalyy scale of the object.
scalzz scale of the object.

◆ GRRLIB_ObjectViewInv()

void GRRLIB_ObjectViewInv ( f32  posx,
f32  posy,
f32  posz,
f32  angx,
f32  angy,
f32  angz,
f32  scalx,
f32  scaly,
f32  scalz 
)

Set the view matrix to draw object (in this order scale, trans AND rotate).

Parameters
posxx position of the object.
posyy position of the object.
poszz position of the object.
angxx rotation angle of the object.
angyy rotation angle of the object.
angzz rotation angle of the object.
scalxx scale of the object.
scalyy scale of the object.
scalzz scale of the object.

◆ GRRLIB_ObjectViewRotate()

void GRRLIB_ObjectViewRotate ( f32  angx,
f32  angy,
f32  angz 
)

Rotate the object matrix to draw object.

Parameters
angxx rotation angle of the object.
angyy rotation angle of the object.
angzz rotation angle of the object.

◆ GRRLIB_ObjectViewScale()

void GRRLIB_ObjectViewScale ( f32  scalx,
f32  scaly,
f32  scalz 
)

Scale the object matrix to draw object.

Parameters
scalxx scale of the object.
scalyy scale of the object.
scalzz scale of the object.

◆ GRRLIB_ObjectViewTrans()

void GRRLIB_ObjectViewTrans ( f32  posx,
f32  posy,
f32  posz 
)

Translate the object matrix to draw object.

Parameters
posxx position of the object.
posyy position of the object.
poszz position of the object.

◆ GRRLIB_Plot()

INLINE void GRRLIB_Plot ( const f32  x,
const f32  y,
const u32  color 
)

Draw a dot.

Parameters
xSpecifies the x-coordinate of the dot.
ySpecifies the y-coordinate of the dot.
colorThe color of the dot in RGBA format.
Author
Jespa

◆ GRRLIB_PrintBMF()

void GRRLIB_PrintBMF ( const f32  xpos,
const f32  ypos,
const GRRLIB_bytemapFont bmf,
const char *  text,
  ... 
)

Print formatted output with a ByteMap font.

This function could be slow, it should be used with GRRLIB_CompoStart and GRRLIB_CompoEnd.

Parameters
xposSpecifies the x-coordinate of the upper-left corner of the text.
yposSpecifies the y-coordinate of the upper-left corner of the text.
bmfThe ByteMap font to use.
textText to draw.
...Optional arguments.

◆ GRRLIB_Printf()

void GRRLIB_Printf ( const f32  xpos,
const f32  ypos,
const GRRLIB_texImg tex,
const u32  color,
const f32  zoom,
const char *  text,
  ... 
)

Print formatted output.

Parameters
xposSpecifies the x-coordinate of the upper-left corner of the text.
yposSpecifies the y-coordinate of the upper-left corner of the text.
texThe texture containing the character set.
colorText color in RGBA format. The alpha channel is used to change the opacity of the text.
zoomThis is a factor by which the text size will be increase or decrease.
textText to draw.
...Optional arguments.

◆ GRRLIB_PrintfTTF()

void GRRLIB_PrintfTTF ( int  x,
int  y,
GRRLIB_ttfFont myFont,
const char *  string,
unsigned int  fontSize,
const u32  color 
)

Print function for TTF font.

Parameters
xSpecifies the x-coordinate of the upper-left corner of the text.
ySpecifies the y-coordinate of the upper-left corner of the text.
myFontA TTF.
stringText to draw.
fontSizeSize of the font.
colorText color in RGBA format.

◆ GRRLIB_PrintfTTFW()

void GRRLIB_PrintfTTFW ( int  x,
int  y,
GRRLIB_ttfFont myFont,
const wchar_t *  utf32,
unsigned int  fontSize,
const u32  color 
)

Print function for TTF font.

Author
wplaat and DrTwox
Parameters
xSpecifies the x-coordinate of the upper-left corner of the text.
ySpecifies the y-coordinate of the upper-left corner of the text.
myFontA TTF.
utf32Text to draw.
fontSizeSize of the font.
colorText color in RGBA format.

◆ GRRLIB_PtInRect()

INLINE bool GRRLIB_PtInRect ( const int  hotx,
const int  hoty,
const int  hotw,
const int  hoth,
const int  wpadx,
const int  wpady 
)

Determine whether the specified point lies within the specified rectangle.

Parameters
hotxSpecifies the x-coordinate of the upper-left corner of the rectangle.
hotySpecifies the y-coordinate of the upper-left corner of the rectangle.
hotwThe width of the rectangle.
hothThe height of the rectangle.
wpadxSpecifies the x-coordinate of the point.
wpadySpecifies the y-coordinate of the point.
Returns
If the specified point lies within the rectangle, the return value is true otherwise it's false.

◆ GRRLIB_Rectangle()

INLINE void GRRLIB_Rectangle ( const f32  x,
const f32  y,
const f32  width,
const f32  height,
const u32  color,
const bool  filled 
)

Draw a rectangle.

Parameters
xSpecifies the x-coordinate of the upper-left corner of the rectangle.
ySpecifies the y-coordinate of the upper-left corner of the rectangle.
widthThe width of the rectangle.
heightThe height of the rectangle.
colorThe color of the rectangle in RGBA format.
filledSet to true to fill the rectangle.

◆ GRRLIB_RectInRect()

INLINE bool GRRLIB_RectInRect ( const int  rect1x,
const int  rect1y,
const int  rect1w,
const int  rect1h,
const int  rect2x,
const int  rect2y,
const int  rect2w,
const int  rect2h 
)

Determine whether a specified rectangle lies within another rectangle.

Parameters
rect1xSpecifies the x-coordinate of the upper-left corner of the rectangle.
rect1ySpecifies the y-coordinate of the upper-left corner of the rectangle.
rect1wSpecifies the width of the rectangle.
rect1hSpecifies the height of the rectangle.
rect2xSpecifies the x-coordinate of the upper-left corner of the rectangle.
rect2ySpecifies the y-coordinate of the upper-left corner of the rectangle.
rect2wSpecifies the width of the rectangle.
rect2hSpecifies the height of the rectangle.
Returns
If the specified rectangle lies within the other rectangle, the return value is true otherwise it's false.

◆ GRRLIB_RectOnRect()

INLINE bool GRRLIB_RectOnRect ( const int  rect1x,
const int  rect1y,
const int  rect1w,
const int  rect1h,
const int  rect2x,
const int  rect2y,
const int  rect2w,
const int  rect2h 
)

Determine whether a part of a specified rectangle lies on another rectangle.

Parameters
rect1xSpecifies the x-coordinate of the upper-left corner of the first rectangle.
rect1ySpecifies the y-coordinate of the upper-left corner of the first rectangle.
rect1wSpecifies the width of the first rectangle.
rect1hSpecifies the height of the first rectangle.
rect2xSpecifies the x-coordinate of the upper-left corner of the second rectangle.
rect2ySpecifies the y-coordinate of the upper-left corner of the second rectangle.
rect2wSpecifies the width of the second rectangle.
rect2hSpecifies the height of the second rectangle.
Returns
If the specified rectangle lies on the other rectangle, the return value is true otherwise it's false.

◆ GRRLIB_Screen2Texture()

void GRRLIB_Screen2Texture ( u16  posx,
u16  posy,
GRRLIB_texImg tex,
bool  clear 
)

Make a snapshot of the screen in a texture WITHOUT ALPHA LAYER.

Parameters
posxTop left corner of the grabbed part.
posyTop left corner of the grabbed part.
texA pointer to a texture representing the screen.
clearWhen this flag is set to true, the screen is cleared after copy.

◆ GRRLIB_ScrShot()

bool GRRLIB_ScrShot ( const char *  filename)

Make a PNG screenshot.

It should be called after drawing stuff on the screen, but before GRRLIB_Render(). libfat is required to use the function.

Parameters
filenameName of the file to write.
Returns
Returns true if everything worked, false if problems occurred.

◆ GRRLIB_SetAntiAliasing()

INLINE void GRRLIB_SetAntiAliasing ( const bool  aa)

Turn anti-aliasing on/off.

Parameters
aaSet to true to enable anti-aliasing (Default: Enabled).

◆ GRRLIB_SetBackgroundColour()

void GRRLIB_SetBackgroundColour ( u8  r,
u8  g,
u8  b,
u8  a 
)

Set the background parameter when screen is cleared.

Parameters
rRed component.
gGreen component.
bBlue component.
aAlpha component.

◆ GRRLIB_SetBlend()

INLINE void GRRLIB_SetBlend ( const GRRLIB_blendMode  blendmode)

Set a blending mode.

Parameters
blendmodeThe blending mode to use (Default: GRRLIB_BLEND_ALPHA).

◆ GRRLIB_SetHandle()

INLINE void GRRLIB_SetHandle ( GRRLIB_texImg tex,
const int  x,
const int  y 
)

Set a texture's X and Y handles.

For example, it could be used for the rotation of a texture.

Parameters
texThe texture to set the handle on.
xThe x-coordinate of the handle.
yThe y-coordinate of the handle.

◆ GRRLIB_SetLightAmbient()

void GRRLIB_SetLightAmbient ( u32  ambientcolor)

Set ambient color.

When no diffuse light is shining on a object, the color is equal to ambient color.

Parameters
ambientcolorAmbient color in RGBA format.

◆ GRRLIB_SetLightDiff()

void GRRLIB_SetLightDiff ( u8  num,
guVector  pos,
f32  distattn,
f32  brightness,
u32  lightcolor 
)

Set diffuse light parameters.

Parameters
numNumber of the light. It's a number from 0 to 7.
posPosition of the diffuse light (x/y/z).
distattnDistance attenuation.
brightnessBrightness of the light. The value should be between 0 and 1.
lightcolorColor of the light in RGBA format.

◆ GRRLIB_SetLightSpec()

void GRRLIB_SetLightSpec ( u8  num,
guVector  dir,
f32  shininess,
u32  lightcolor,
u32  speccolor 
)

Set specular light parameters.

Parameters
numNumber of the light. It's a number from 0 to 7.
dirDirection of the specular ray (x/y/z).
shininessShininess of the specular. ( between 4 and 254)
lightcolorColor of the light in RGBA format.
speccolorSpecular color in RGBA format.

◆ GRRLIB_SetLightSpot()

void GRRLIB_SetLightSpot ( u8  num,
guVector  pos,
guVector  lookat,
f32  angAttn0,
f32  angAttn1,
f32  angAttn2,
f32  distAttn0,
f32  distAttn1,
f32  distAttn2,
u32  lightcolor 
)

Set Spot light parameters.

Parameters
numNumber of the light. It's a number from 0 to 7.
posPosition of the spot light (x/y/z).
lookatWhere spot light look at (x/y/z).
angAttn0cone attenuation factor 0.
angAttn1cone attenuation factor 1.
angAttn2cone attenuation factor 2.
distAttn0Distance attenuation factor 0.
distAttn1Distance attenuation factor 1.
distAttn2Distance attenuation factor 2.
lightcolorColor of the light in RGBA format.

◆ GRRLIB_SetMidHandle()

INLINE void GRRLIB_SetMidHandle ( GRRLIB_texImg tex,
const bool  enabled 
)

Center a texture's handles.

For example, it could be used for the rotation of a texture.

Parameters
texThe texture to center.
enabled

◆ GRRLIB_SetPixelToFB()

INLINE void GRRLIB_SetPixelToFB ( int  x,
int  y,
u32  pokeColor 
)

Writes a pixel directly from the FrontBuffer.

Parameters
xThe x-coordinate within the FB.
yThe y-coordinate within the FB.
pokeColorThe color of the pixel in RGBA format.

◆ GRRLIB_SetPixelTotexImg()

INLINE void GRRLIB_SetPixelTotexImg ( const int  x,
const int  y,
GRRLIB_texImg tex,
const u32  color 
)

Set the color value of a pixel to a GRRLIB_texImg.

See also
GRRLIB_FlushTex
Parameters
xSpecifies the x-coordinate of the pixel in the texture.
ySpecifies the y-coordinate of the pixel in the texture.
texThe texture to set the color to.
colorThe color of the pixel in RGBA format.

◆ GRRLIB_SetTexture()

void GRRLIB_SetTexture ( GRRLIB_texImg tex,
bool  rep 
)

Set the texture to an object (contributed by chris_c aka DaShAmAn).

Parameters
texPointer to an image texture (GRRLIB_texImg format).
repTexture Repeat Mode, true will repeat it, false won't.

◆ GRRLIB_WidthTTF()

u32 GRRLIB_WidthTTF ( GRRLIB_ttfFont myFont,
const char *  string,
unsigned int  fontSize 
)

Get the width of a text in pixel.

Parameters
myFontA TTF.
stringThe text to check.
fontSizeThe size of the font.
Returns
The width of a text in pixel.

◆ GRRLIB_WidthTTFW()

u32 GRRLIB_WidthTTFW ( GRRLIB_ttfFont myFont,
const wchar_t *  utf32,
unsigned int  fontSize 
)

Get the width of a text in pixel.

Parameters
myFontA TTF.
utf32The text to check.
fontSizeThe size of the font.
Returns
The width of a text in pixel.