Code: Select all
typedef struct {
float x,y,z;
} __vtxtex;
void SetupDisplay( void )
{
sceGuInit();
void* fbp0 = getStaticVramBuffer(BUF_WIDTH,SCR_HEIGHT,GU_PSM_8888);
void* fbp1 = getStaticVramBuffer(BUF_WIDTH,SCR_HEIGHT,GU_PSM_8888);
void* zbp = getStaticVramBuffer(BUF_WIDTH,SCR_HEIGHT,GU_PSM_4444);
sceGuStart(GU_DIRECT,list);
sceGuDrawBuffer(GU_PSM_8888,fbp0,BUF_WIDTH);
sceGuDispBuffer(SCR_WIDTH,SCR_HEIGHT,fbp1,BUF_WIDTH);
sceGuDepthBuffer(zbp,BUF_WIDTH);
sceGuOffset(2048 - (SCR_WIDTH/2),2048 - (SCR_HEIGHT/2));
sceGuViewport(2048,2048,SCR_WIDTH,SCR_HEIGHT);
sceGuDepthRange(0xc350,0x2710);
sceGuScissor(0,0,SCR_WIDTH,SCR_HEIGHT);
sceGuEnable(GU_SCISSOR_TEST);
sceGuFinish();
sceGuSync(0,0);
sceDisplayWaitVblankStart();
sceGuDisplay(GU_TRUE);
}
void draw()
{
//* Set Display List
sceGuStart(GU_DIRECT,list);
sceGuClearDepth(0);
sceGuClearColor( color.toOpenGLColor() );
sceGuClear(GU_COLOR_BUFFER_BIT | GU_DEPTH_BUFFER_BIT);
sceGumLoadIdentity();
sceGumMatrixMode(GU_PROJECTION);
sceGumLoadIdentity();
sceGumPerspective(45.0f,16.0f/9.0f,1.0f,2048.0f);
sceGumMatrixMode(GU_VIEW);
sceGumLoadIdentity();
sceGumMatrixMode(GU_MODEL);
sceGumLoadIdentity();
sceGuDisable(GU_DEPTH_TEST);
sceGuDisable(GU_LIGHTING);
sceGuDisable(GU_ALPHA_TEST);
sceGuFrontFace(GU_CW);
__vtxtex vtx[2];
for (int x = 0; x < 2; x++) { vtx[x].z = -1; }
vtx[0].x = 0;
vtx[0].y = 1;
vtx[1].x = 1;
vtx[1].y = 0;
sceGuColor(0xFFAABBCC);
sceGumDrawArray( GU_SPRITES, GU_VERTEX_32BITF|GU_TRANSFORM_3D, 2, 0, vtx );
//* Gu Finish
sceGuFinish();
sceGuSync(0,0);
sceDisplayWaitVblankStart();
sceGuSwapBuffers(); iDispBuffer ^= 1;
}
can you help me please?