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 

sceGuStart Question

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



Joined: 24 Oct 2006
Posts: 14

PostPosted: Tue Oct 24, 2006 1:27 pm    Post subject: sceGuStart Question Reply with quote

This is probably a very n00bish question but I can't figure it out. I am just starting out with the graphics API that comes with the PSP SDK and I am struggling with understanding what a few of the functions do (there is only so much the comments in the header files can tell you), in this case it's sceGuStart. Let me show the code before I ask my questions:

Code:

// headers

#define ALIGNED __attribute__((aligned(16)))

static unsigned int ALIGNED list[262144];
static bool running = true;

// all of my other global variables, callbacks, etc...

int main(int argc, char *argv[])
{
      // variables, init code etc...
     
      while (running)
      {
            sceGuStart(GU_DIRECT, list);      // CONFUSING, ARRRGGGG
           
            // actually do the rendering here
      }
     
      // all of my de-init code
     
      return 0;
}


Ok, so my questions are:

  • What is sceGuStart for?
  • Why GU_DIRECT?
  • Why does sceGuStart need 'list' (and why is list the size it is)?

Am I making this way too complicated or is this similar to OpenGL display lists?

Thanks a ton :) !
- dega
Back to top
View user's profile Send private message AIM Address
swordman



Joined: 27 Dec 2005
Posts: 27

PostPosted: Mon Oct 30, 2006 3:56 pm    Post subject: Reply with quote

Hi, I'm studing the graphics function too.
The sceGuStart function anable the hardware rendering (I think.)
The list parameter is a place in memory that willl be used by GU function to store it's internal commands and calculatio0n results. GU use it on its own.
It's like the ogl display list.
Can't remember chat GU_DIRECT is, sorry.
Back to top
View user's profile Send private message
dega



Joined: 24 Oct 2006
Posts: 14

PostPosted: Mon Oct 30, 2006 4:32 pm    Post subject: Reply with quote

Thanks for the reply!

Since my post I have learned some more about sceGuStart. Like you said, it is for display lists. From what I understand, the reason that a list is needed for any rendering is because the GU library needs it for all of its internal processing. As for GU_DIRECT, it causes any instructions/data in the list to be processed immediately (unlike something like GU_CALL, which builds the list to be later called with sceGuCallList). Also, the size of the list can pretty much be anything - the only rule is that it must be at least the size that sceGuFinish (since it returns the size of the data put into the list) would return after all of the rendering code.
Back to top
View user's profile Send private message AIM Address
adrahil



Joined: 16 Mar 2006
Posts: 277

PostPosted: Wed Nov 01, 2006 4:42 am    Post subject: Reply with quote

The size of the list is width*height*2, to some extent :P (it actually looks like the nearest power of 2 to that number...) Why that? Only the gods know ;)
Back to top
View user's profile Send private message
chp



Joined: 23 Jun 2004
Posts: 313

PostPosted: Fri Nov 03, 2006 4:39 am    Post subject: Reply with quote

The list is that size because I deemed it a good size that could be filled with a lot of data when I wrote the samples. You can set it to whatever size you want. Read the documentation generated from pspgu.h (or read pspgu.h directly), and read the samples.
_________________
GE Dominator
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