Correct GPU_DrawArray() parameter order, fix GPU examples
This commit is contained in:
parent
2e43fd1a40
commit
11a5001f33
@ -83,7 +83,7 @@ static void sceneRender(void)
|
||||
GPU_SetFloatUniformMatrix(GPU_GEOMETRY_SHADER, uLoc_projection, &projection);
|
||||
|
||||
// Draw the VBO - GPU_UNKPRIM allows the geoshader to control primitive emission
|
||||
GPU_DrawArray(GPU_UNKPRIM, vertex_list_count);
|
||||
GPU_DrawArray(GPU_UNKPRIM, 0, vertex_list_count);
|
||||
}
|
||||
|
||||
static void sceneExit(void)
|
||||
|
@ -76,7 +76,7 @@ static void sceneRender(void)
|
||||
GPU_SetFloatUniformMatrix(GPU_VERTEX_SHADER, uLoc_projection, &projection);
|
||||
|
||||
// Draw the VBO
|
||||
GPU_DrawArray(GPU_TRIANGLES, vertex_list_count);
|
||||
GPU_DrawArray(GPU_TRIANGLES, 0, vertex_list_count);
|
||||
}
|
||||
|
||||
static void sceneExit(void)
|
||||
|
@ -186,7 +186,7 @@ static void sceneRender(void)
|
||||
GPU_SetFloatUniform(GPU_VERTEX_SHADER, uLoc_lightClr, (u32*)(float[]){1.0f, 1.0f, 1.0f, 1.0f}, 1);
|
||||
|
||||
// Draw the VBO
|
||||
GPU_DrawArray(GPU_TRIANGLES, vertex_list_count);
|
||||
GPU_DrawArray(GPU_TRIANGLES, 0, vertex_list_count);
|
||||
}
|
||||
|
||||
static void sceneExit(void)
|
||||
|
@ -294,7 +294,7 @@ void GPU_SetTexture(GPU_TEXUNIT unit, u32* data, u16 width, u16 height, u32 para
|
||||
void GPU_SetTextureBorderColor(GPU_TEXUNIT unit,u32 borderColor);
|
||||
void GPU_SetTexEnv(u8 id, u16 rgbSources, u16 alphaSources, u16 rgbOperands, u16 alphaOperands, GPU_COMBINEFUNC rgbCombine, GPU_COMBINEFUNC alphaCombine, u32 constantColor);
|
||||
|
||||
void GPU_DrawArray(GPU_Primitive_t primitive, u32 n, u32 first);
|
||||
void GPU_DrawArray(GPU_Primitive_t primitive, u32 first, u32 count);
|
||||
void GPU_DrawElements(GPU_Primitive_t primitive, u32* indexArray, u32 n);
|
||||
void GPU_FinishDrawing();
|
||||
|
||||
|
@ -485,7 +485,7 @@ void GPU_SetTexEnv(u8 id, u16 rgbSources, u16 alphaSources, u16 rgbOperands, u16
|
||||
GPUCMD_AddIncrementalWrites(GPUREG_0000|GPU_TEVID[id], param, 0x00000005);
|
||||
}
|
||||
|
||||
void GPU_DrawArray(GPU_Primitive_t primitive, u32 n, u32 first)
|
||||
void GPU_DrawArray(GPU_Primitive_t primitive, u32 first, u32 count)
|
||||
{
|
||||
//set primitive type
|
||||
GPUCMD_AddMaskedWrite(GPUREG_PRIMITIVE_CONFIG, 0x2, primitive);
|
||||
@ -493,7 +493,7 @@ void GPU_DrawArray(GPU_Primitive_t primitive, u32 n, u32 first)
|
||||
//index buffer address register should be cleared (except bit 31) before drawing
|
||||
GPUCMD_AddWrite(GPUREG_INDEXBUFFER_CONFIG, 0x80000000);
|
||||
//pass number of vertices
|
||||
GPUCMD_AddWrite(GPUREG_NUMVERTICES, n);
|
||||
GPUCMD_AddWrite(GPUREG_NUMVERTICES, count);
|
||||
//set first vertex
|
||||
GPUCMD_AddWrite(GPUREG_DRAW_VERTEX_OFFSET, first);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user