Help me please

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
siberianstar
Posts: 70
Joined: Thu Jun 22, 2006 9:24 pm

Help me please

Post by siberianstar »

I dunno why this code doesn't draw anything

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 &#40;int x = 0; x < 2; x++&#41; &#123; vtx&#91;x&#93;.z = -1; &#125;
  vtx&#91;0&#93;.x = 0;
  vtx&#91;0&#93;.y = 1;
  vtx&#91;1&#93;.x = 1;
  vtx&#91;1&#93;.y = 0;
 
  sceGuColor&#40;0xFFAABBCC&#41;;
  sceGumDrawArray&#40; GU_SPRITES, GU_VERTEX_32BITF|GU_TRANSFORM_3D, 2, 0, vtx &#41;;  
 
  
	//* Gu Finish
	sceGuFinish&#40;&#41;;
	sceGuSync&#40;0,0&#41;;
	sceDisplayWaitVblankStart&#40;&#41;;
	sceGuSwapBuffers&#40;&#41;; iDispBuffer ^= 1;

 
&#125;

can you help me please?
siberianstar
Posts: 70
Joined: Thu Jun 22, 2006 9:24 pm

Post by siberianstar »

solved, it was a cache problem
Post Reply