Merge branch 'gpu_examples'
This commit is contained in:
commit
22bde7d2a2
@ -144,7 +144,7 @@ void gpuUIEndFrame()
|
|||||||
GPUCMD_FlushAndRun(NULL);
|
GPUCMD_FlushAndRun(NULL);
|
||||||
gspWaitForP3D();//Wait for the gpu 3d processing to be done
|
gspWaitForP3D();//Wait for the gpu 3d processing to be done
|
||||||
//Copy the GPU output buffer to the screen framebuffer
|
//Copy the GPU output buffer to the screen framebuffer
|
||||||
//See http://3dbrew.org/wiki/GPU#Transfer_Engine for more details about the transfer engine
|
//See http://3dbrew.org/wiki/GPU#Transfer_Engine for more details about the transfer engine
|
||||||
GX_SetDisplayTransfer(NULL, gpuFBuffer, 0x019001E0, (u32*)gfxGetFramebuffer(GFX_TOP, GFX_LEFT, NULL, NULL), 0x019001E0, 0x01001000);
|
GX_SetDisplayTransfer(NULL, gpuFBuffer, 0x019001E0, (u32*)gfxGetFramebuffer(GFX_TOP, GFX_LEFT, NULL, NULL), 0x019001E0, 0x01001000);
|
||||||
gspWaitForPPF();
|
gspWaitForPPF();
|
||||||
|
|
||||||
@ -164,9 +164,9 @@ void gpuUIEndFrame()
|
|||||||
GPU_SetViewport((u32 *)osConvertVirtToPhys((u32)gpuDBuffer),
|
GPU_SetViewport((u32 *)osConvertVirtToPhys((u32)gpuDBuffer),
|
||||||
(u32 *)osConvertVirtToPhys((u32)gpuFBuffer),
|
(u32 *)osConvertVirtToPhys((u32)gpuFBuffer),
|
||||||
0, 0,
|
0, 0,
|
||||||
//Our screen is 400*240, but the GPU actually renders to 400*480 and then downscales it SetDisplayTransfer bit 24 is set
|
//Our screen is 400*240, but the GPU actually renders to 400*480 and then downscales it SetDisplayTransfer bit 24 is set
|
||||||
//This is the case here (See http://3dbrew.org/wiki/GPU#0x1EF00C10 for more details)
|
//This is the case here (See http://3dbrew.org/wiki/GPU#0x1EF00C10 for more details)
|
||||||
240*2, 400);
|
240*2, 400);
|
||||||
|
|
||||||
|
|
||||||
GPU_DepthMap(-1.0f, 0.0f); //Be careful, standard OpenGL clipping is [-1;1], but it is [-1;0] on the pica200
|
GPU_DepthMap(-1.0f, 0.0f); //Be careful, standard OpenGL clipping is [-1;1], but it is [-1;0] on the pica200
|
||||||
@ -194,11 +194,11 @@ void gpuUIEndFrame()
|
|||||||
|
|
||||||
//Our data
|
//Our data
|
||||||
static const vector_3f triangle_mesh[] =
|
static const vector_3f triangle_mesh[] =
|
||||||
{
|
{
|
||||||
{240.0f+60.0f, 120.0f, 0.5f},
|
{240.0f+60.0f, 120.0f, 0.5f},
|
||||||
{240.0f-60.0f, 120.0f+60.0f, 0.5f},
|
{240.0f-60.0f, 120.0f+60.0f, 0.5f},
|
||||||
{240.0f-60.0f, 120.0f-60.0f, 0.5f}
|
{240.0f-60.0f, 120.0f-60.0f, 0.5f}
|
||||||
};
|
};
|
||||||
|
|
||||||
static void* triangle_data = NULL;
|
static void* triangle_data = NULL;
|
||||||
|
|
||||||
@ -233,7 +233,7 @@ int main(int argc, char** argv)
|
|||||||
(u32[]) {0x0}, // buffer offsets (placeholders)
|
(u32[]) {0x0}, // buffer offsets (placeholders)
|
||||||
(u64[]) {0x0}, // attribute permutations for each buffer (identity again)
|
(u64[]) {0x0}, // attribute permutations for each buffer (identity again)
|
||||||
(u8[]) {1} // number of attributes for each buffer
|
(u8[]) {1} // number of attributes for each buffer
|
||||||
);
|
);
|
||||||
//Display the buffers data
|
//Display the buffers data
|
||||||
GPU_DrawArray(GPU_TRIANGLES, sizeof(triangle_mesh) / sizeof(triangle_mesh[0]));
|
GPU_DrawArray(GPU_TRIANGLES, sizeof(triangle_mesh) / sizeof(triangle_mesh[0]));
|
||||||
|
|
||||||
@ -248,7 +248,7 @@ int main(int argc, char** argv)
|
|||||||
aptExit();
|
aptExit();
|
||||||
srvExit();
|
srvExit();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user