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 

Newbie question on gu...

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



Joined: 07 Jun 2005
Posts: 70

PostPosted: Thu Mar 30, 2006 9:07 pm    Post subject: Newbie question on gu... Reply with quote

Hi,

I´trying to get sprites working, but there are things that I don´t unerstand and help doesn´t clarifies it, here they are:

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

Helps says that this centers the coordinate space. Then sets a viewport starting at 2048,2048.

Whit this configuration won´t we miss part of the screen we wrote?, if we start writing at 2048-(src_WIDTH/2) and viewpot starts at 2048?.

Umm, Perhaps I´m messed, but I´m a dx man, haven´t used ogl for years.

Thanks in advance,
HexDump.
Back to top
View user's profile Send private message
Raphael



Joined: 17 Jan 2006
Posts: 646
Location: Germany

PostPosted: Fri Mar 31, 2006 7:59 am    Post subject: Reply with quote

Quote:
Helps says that this centers the coordinate space.

That's exactly what it does - it sets the screen pixel coordinate where the virtual screen coordinate system originates, ie. where the pixel will be plotted if the coordinates are (0,0,0). Since you're able to set vertices to negative and positive values, you'll get clear why you don't miss anything of the virtual viewport. It's just one half screen space to top, bottom, left and right from the sceGuOffset position.
I know the name is somewhat misleading, as you might think thats where the GU starts drawing, meaning where the first pixel on screen is located.

Hope that clears that out
Back to top
View user's profile Send private message Visit poster's website
HexDump



Joined: 07 Jun 2005
Posts: 70

PostPosted: Fri Mar 31, 2006 6:24 pm    Post subject: Reply with quote

Thanks a lot Raphael, you've been really helpfull as allways.


HexDump.
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