forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Help me please

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
siberianstar



Joined: 22 Jun 2006
Posts: 70

PostPosted: Thu Jul 13, 2006 1:41 am    Post subject: Help me please Reply with quote

I dunno why this code doesn't draw anything

Code:


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?
Back to top
View user's profile Send private message
siberianstar



Joined: 22 Jun 2006
Posts: 70

PostPosted: Thu Jul 13, 2006 3:45 am    Post subject: Reply with quote

solved, it was a cache problem
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group