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 

gettings started: some questions

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



Joined: 29 Oct 2005
Posts: 9

PostPosted: Sat Nov 05, 2005 8:45 am    Post subject: gettings started: some questions Reply with quote

A few questions about some functions and how stuff works

sceGuStart(GU_DIRECT,list);

this takes in an array of ints. What does the array contain? is it all of your commands which will then get executed when sceGuFinish() is called?

sceGuOffset(2048 - (SCR_WIDTH/2),2048 - (SCR_HEIGHT/2));

i dont see the point of this?
it seams 0,0 is way off the screen and at the bottom right. Is there anyway to put 0,0 at the top left, a matrix maybe?

thankyou.
Back to top
View user's profile Send private message
jsgf



Joined: 12 Jul 2005
Posts: 254

PostPosted: Sat Nov 05, 2005 9:17 am    Post subject: Re: gettings started: some questions Reply with quote

Riviera Kid wrote:
sceGuStart(GU_DIRECT,list);

this takes in an array of ints. What does the array contain? is it all of your commands which will then get executed when sceGuFinish() is called?

Right, you need to make sure list[] is big enough to hold all your commands; libgu doesn't do any command buffer management for you.

Quote:
sceGuOffset(2048 - (SCR_WIDTH/2),2048 - (SCR_HEIGHT/2));

i dont see the point of this?
it seams 0,0 is way off the screen and at the bottom right. Is there anyway to put 0,0 at the top left, a matrix maybe?

The rasterizer considers the center of the screen to be at 2048,2048, so this translates everything over there. You can use sceViewport to set the centre and width+height of your viewport. It also depends on whether you're bypassing the transform pipeline or not (setting GU_TRANSFORM_2D in your vertex formats).
Back to top
View user's profile Send private message Visit poster's website
Paco



Joined: 09 Oct 2005
Posts: 54

PostPosted: Sat Nov 05, 2005 10:09 am    Post subject: Re: gettings started: some questions Reply with quote

Riviera Kid wrote:
sceGuStart(GU_DIRECT,list);

this takes in an array of ints. What does the array contain? is it all of your commands which will then get executed when sceGuFinish() is called?

sceGuOffset(2048 - (SCR_WIDTH/2),2048 - (SCR_HEIGHT/2));

i dont see the point of this?

The list will be used as a buffer where further sceGuXXX commands get stored. At the point where you call sceGuStart(), the list doesn't need to contain anything.

The 2048x2048 offset that jsgf explained seems to be there to make 2D clipping easier for the chip.
_________________
Paco
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