citro2d
Functions
Basic functions

Functions

bool C2D_Init (size_t maxObjects)
 Initialize citro2d. More...
 
void C2D_Fini (void)
 Deinitialize citro2d.
 
void C2D_Prepare (void)
 Prepares the GPU for rendering 2D content. More...
 
void C2D_Flush (void)
 Ensures all 2D objects so far have been drawn.
 
void C2D_SceneSize (u32 width, u32 height, bool tilt)
 Configures the size of the 2D scene. More...
 
static void C2D_SceneTarget (C3D_RenderTarget *target)
 Configures the size of the 2D scene to match that of the specified render target. More...
 
C3D_RenderTarget * C2D_CreateScreenTarget (gfxScreen_t screen, gfx3dSide_t side)
 Helper function to create a render target for a screen. More...
 
void C2D_TargetClear (C3D_RenderTarget *target, u32 color)
 Helper function to clear a rendertarget using the specified color. More...
 
static void C2D_SceneBegin (C3D_RenderTarget *target)
 Helper function to begin drawing a 2D scene on a render target. More...
 

Detailed Description

Function Documentation

C3D_RenderTarget* C2D_CreateScreenTarget ( gfxScreen_t  screen,
gfx3dSide_t  side 
)

Helper function to create a render target for a screen.

Parameters
[in]screenScreen (GFX_TOP or GFX_BOTTOM)
[in]sideSide (GFX_LEFT or GFX_RIGHT)
Returns
citro3d render target object
bool C2D_Init ( size_t  maxObjects)

Initialize citro2d.

Parameters
[in]maxObjectsMaximum number of 2D objects that can be drawn per frame.
Remarks
Pass C2D_DEFAULT_MAX_OBJECTS as a starting point.
Returns
true on success, false on failure
void C2D_Prepare ( void  )

Prepares the GPU for rendering 2D content.

Remarks
This needs to be done only once in the program if citro2d is the sole user of the GPU.
static void C2D_SceneBegin ( C3D_RenderTarget *  target)
inlinestatic

Helper function to begin drawing a 2D scene on a render target.

Parameters
[in]targetRender target to draw the 2D scene to
void C2D_SceneSize ( u32  width,
u32  height,
bool  tilt 
)

Configures the size of the 2D scene.

Parameters
[in]widthThe width of the scene, in pixels.
[in]heightThe height of the scene, in pixels.
[in]tiltWhether the scene is tilted like the 3DS's sideways screens.
static void C2D_SceneTarget ( C3D_RenderTarget *  target)
inlinestatic

Configures the size of the 2D scene to match that of the specified render target.

Parameters
[in]targetRender target
void C2D_TargetClear ( C3D_RenderTarget *  target,
u32  color 
)

Helper function to clear a rendertarget using the specified color.

Parameters
[in]targetRender target to clear
[in]color32-bit RGBA color value to fill the target with