citro2d
|
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... | |
void | C2D_ViewReset (void) |
Resets the model transformation matrix. More... | |
void | C2D_ViewSave (C3D_Mtx *matrix) |
Saves the current model transformation matrix. More... | |
void | C2D_ViewRestore (const C3D_Mtx *matrix) |
Restores a previously saved model transformation matrix. More... | |
void | C2D_ViewTranslate (float x, float y) |
Translates everything drawn via the model matrix. More... | |
void | C2D_ViewRotate (float rotation) |
Rotates everything drawn via the model matrix. More... | |
static void | C2D_ViewRotateDegrees (float rotation) |
Rotates everything drawn via the model matrix. More... | |
void | C2D_ViewShear (float x, float y) |
Shears everything drawn via the model matrix. More... | |
void | C2D_ViewScale (float x, float y) |
Scales everything drawn via the model matrix. 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... | |
C3D_RenderTarget* C2D_CreateScreenTarget | ( | gfxScreen_t | screen, |
gfx3dSide_t | side | ||
) |
Helper function to create a render target for a screen.
[in] | screen | Screen (GFX_TOP or GFX_BOTTOM) |
[in] | side | Side (GFX_LEFT or GFX_RIGHT) |
bool C2D_Init | ( | size_t | maxObjects | ) |
Initialize citro2d.
[in] | maxObjects | Maximum number of 2D objects that can be drawn per frame. |
void C2D_Prepare | ( | void | ) |
Prepares the GPU for rendering 2D content.
|
inlinestatic |
Helper function to begin drawing a 2D scene on a render target.
[in] | target | Render target to draw the 2D scene to |
void C2D_SceneSize | ( | u32 | width, |
u32 | height, | ||
bool | tilt | ||
) |
Configures the size of the 2D scene.
[in] | width | The width of the scene, in pixels. |
[in] | height | The height of the scene, in pixels. |
[in] | tilt | Whether the scene is tilted like the 3DS's sideways screens. |
|
inlinestatic |
Configures the size of the 2D scene to match that of the specified render target.
[in] | target | Render target |
void C2D_TargetClear | ( | C3D_RenderTarget * | target, |
u32 | color | ||
) |
Helper function to clear a rendertarget using the specified color.
[in] | target | Render target to clear |
[in] | color | 32-bit RGBA color value to fill the target with |
void C2D_ViewReset | ( | void | ) |
Resets the model transformation matrix.
void C2D_ViewRestore | ( | const C3D_Mtx * | matrix | ) |
Restores a previously saved model transformation matrix.
[in] | matrix | Pointer to matrix to restor |
void C2D_ViewRotate | ( | float | rotation | ) |
Rotates everything drawn via the model matrix.
[in] | rotation | Rotation in the counterclockwise direction in radians |
|
inlinestatic |
Rotates everything drawn via the model matrix.
[in] | rotation | Rotation in the counterclockwise direction in degrees |
void C2D_ViewSave | ( | C3D_Mtx * | matrix | ) |
Saves the current model transformation matrix.
[out] | matrix | Pointer to save the current matrix to |
void C2D_ViewScale | ( | float | x, |
float | y | ||
) |
Scales everything drawn via the model matrix.
[in] | x | Scale factor in the x direction |
[in] | y | Scale factor in the y direction |
void C2D_ViewShear | ( | float | x, |
float | y | ||
) |
Shears everything drawn via the model matrix.
[in] | x | Shear factor in the x direction |
[in] | y | Shear factor in the y direction |
void C2D_ViewTranslate | ( | float | x, |
float | y | ||
) |
Translates everything drawn via the model matrix.
[in] | x | Translation in the x direction |
[in] | y | Translation in the y direction |