citro3d
|
Base citro3d functions. More...
Go to the source code of this file.
Macros | |
#define | C3D_DEFAULT_CMDBUF_SIZE 0x40000 |
Default command buffer size. | |
Enumerations | |
enum | { C3D_UNSIGNED_BYTE = 0 , C3D_UNSIGNED_SHORT = 1 } |
Data type of indices for use with C3D_DrawElements(). More... | |
Functions | |
bool | C3D_Init (size_t cmdBufSize) |
Initializes citro3d. More... | |
void | C3D_Fini (void) |
Deinitializes citro3d. More... | |
float | C3D_GetCmdBufUsage (void) |
Retrieves the current command buffer usage. More... | |
void | C3D_BindProgram (shaderProgram_s *program) |
Binds a shader program to the current rendering state. More... | |
void | C3D_SetViewport (u32 x, u32 y, u32 w, u32 h) |
Sets the viewport for the current framebuffer. More... | |
void | C3D_SetScissor (GPU_SCISSORMODE mode, u32 left, u32 top, u32 right, u32 bottom) |
Defines the scissor box. More... | |
void | C3D_DrawArrays (GPU_Primitive_t primitive, int first, int size) |
Renders primitives from current vertex array buffer. More... | |
void | C3D_DrawElements (GPU_Primitive_t primitive, int count, int type, const void *indices) |
Renders primitives from current vertex array buffer in a manually specified order. More... | |
Immediate-mode vertex submission | |
void | C3D_ImmDrawBegin (GPU_Primitive_t primitive) |
Delimits the vertices of a primitive or a group of like primitives. More... | |
void | C3D_ImmSendAttrib (float x, float y, float z, float w) |
Specifies an immediate attribute. More... | |
void | C3D_ImmDrawEnd (void) |
Delimits the vertices of a primitive or a group of like primitives. More... | |
static void | C3D_ImmDrawRestartPrim (void) |
Specifies the end of the previous strip/fan and the beginning of a new one. More... | |
Fixed vertex attributes | |
C3D_FVec * | C3D_FixedAttribGetWritePtr (int id) |
Gets the pointer to the fixed attribute vector for the specified attribute index. More... | |
static void | C3D_FixedAttribSet (int id, float x, float y, float z, float w) |
Sets fixed attribute vector for the specified attribute index. More... | |
Base citro3d functions.
anonymous enum |
Data type of indices for use with C3D_DrawElements().
Enumerator | |
---|---|
C3D_UNSIGNED_BYTE | Unsigned 8-bit integer. |
C3D_UNSIGNED_SHORT | Unsigned 16-bit integer. |
void C3D_BindProgram | ( | shaderProgram_s * | program | ) |
Binds a shader program to the current rendering state.
[in] | program | Specifies the pointer to a shader program object whose executables are to be used as part of the current rendering state. |
void C3D_DrawArrays | ( | GPU_Primitive_t | primitive, |
int | first, | ||
int | size | ||
) |
Renders primitives from current vertex array buffer.
[in] | primitive | Specifies what kind of primitives to render. |
[in] | first | Specifies the starting index in the current buffers. |
[in] | size | Specifies the number of indices to be rendered. |
void C3D_DrawElements | ( | GPU_Primitive_t | primitive, |
int | count, | ||
int | type, | ||
const void * | indices | ||
) |
Renders primitives from current vertex array buffer in a manually specified order.
[in] | primitive | Specifies what kind of primitives to render. |
[in] | count | Specifies the number of indices to be rendered. |
[in] | type | Specifies the data type of the indices. May be C3D_UNSIGNED_BYTE or C3D_UNSIGNED_SHORT. |
[in] | indices | Specifies a pointer to where the indices are stored. |
void C3D_Fini | ( | void | ) |
Deinitializes citro3d.
C3D_FVec* C3D_FixedAttribGetWritePtr | ( | int | id | ) |
Gets the pointer to the fixed attribute vector for the specified attribute index.
[in] | id | Attribute index. |
|
inlinestatic |
Sets fixed attribute vector for the specified attribute index.
[in] | id | Attribute index. |
[in] | x | Specifies the X value of the attribute. |
[in] | y | Specifies the Y value of the attribute. |
[in] | z | Specifies the Z value of the attribute. |
[in] | w | Specifies the W value of the attribute. |
float C3D_GetCmdBufUsage | ( | void | ) |
Retrieves the current command buffer usage.
void C3D_ImmDrawBegin | ( | GPU_Primitive_t | primitive | ) |
Delimits the vertices of a primitive or a group of like primitives.
[in] | primitive | Specifies type of primitive or primitives that will be created using the vertices specified between C3D_ImmDrawBegin() and C3D_ImmDrawEnd(). |
void C3D_ImmDrawEnd | ( | void | ) |
Delimits the vertices of a primitive or a group of like primitives.
|
inlinestatic |
Specifies the end of the previous strip/fan and the beginning of a new one.
void C3D_ImmSendAttrib | ( | float | x, |
float | y, | ||
float | z, | ||
float | w | ||
) |
Specifies an immediate attribute.
[in] | x | Specifies the X value of the current attribute. |
[in] | y | Specifies the Y value of the current attribute. |
[in] | z | Specifies the Z value of the current attribute. |
[in] | w | Specifies the W value of the current attribute. |
bool C3D_Init | ( | size_t | cmdBufSize | ) |
Initializes citro3d.
[in] | cmdBufSize | Desired size of GPU command buffer. C3D_DEFAULT_CMDBUF_SIZE should generally be used here. |
cmdBufSize
. Conversely, you may want to decrease it if you're particularly concerned about memory consumption. void C3D_SetScissor | ( | GPU_SCISSORMODE | mode, |
u32 | left, | ||
u32 | top, | ||
u32 | right, | ||
u32 | bottom | ||
) |
Defines the scissor box.
[in] | mode | Specifies scissoring mode. |
[in] | left | Leftmost boundary in pixels. |
[in] | top | Topmost boundary in pixels. |
[in] | right | Rightmost boundary in pixels. |
[in] | bottom | Bottommost boundary in pixels. |
Sets the viewport for the current framebuffer.
[in] | x | X offset from the origin of the viewport in pixels. |
[in] | y | Y offset from the origin of the viewport in pixels. |
[in] | w | Width of the viewport in pixels. |
[in] | h | Height of the viewport in pixels. |