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 

sceGuOffset

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



Joined: 02 Oct 2005
Posts: 6

PostPosted: Wed Oct 05, 2005 4:14 am    Post subject: sceGuOffset Reply with quote

I started developing some samples to get used to the GU,
I have some code running, however there is a line that is comming back in every sample but I do not quit understand it (and I hate using lines I do not understand):

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

What is the meaning of that gu offset? I read in the .h file that the PSP has a virtual coordinate space and it has something to do with that, couldn't find more. I don't think there is no GL equivalent for that either (or am I wrong?)
Anyone with more info on that offset?

thanks,
NB
Back to top
View user's profile Send private message
ashleydb



Joined: 03 Oct 2005
Posts: 26
Location: USA

PostPosted: Wed Oct 05, 2005 4:38 am    Post subject: Reply with quote

The way I understand it, the PSP is essentially rendering to a texture which is 4096 x 4096. The offset call means you are only drawing to a section of that area the size of the PSP screen (480 x 272) in the direct center of that 4096 x 4096 area. That section is then what is displayed on the screen.
_________________
www.PSP-Files.com - PSP News, Hacks etc.

www.HiAsh.com - My work and stuff
Back to top
View user's profile Send private message Visit poster's website
Nuclear Bit



Joined: 02 Oct 2005
Posts: 6

PostPosted: Wed Oct 05, 2005 5:28 am    Post subject: Reply with quote

Thanks for the reply,
in fact yes that's what I was thinking too, but then it seems that the command is defining exactly the same as the setup of the viewport command that is usually following the GU offset:
sceGuViewport(2048,2048,SCR_WIDTH,SCR_HEIGHT);
the viewport command has the centerX and centerY within the larger window (4096x4096) and even more : the screen dimension.
So the difference between the GuOffset & the Viewport position becomes a bit unclear...
Back to top
View user's profile Send private message
chp



Joined: 23 Jun 2004
Posts: 313

PostPosted: Wed Oct 05, 2005 5:48 am    Post subject: Reply with quote

sceGuViewport() and sceGuOffset() control two different aspects of the hardware.

The coordinates from sceGuViewport() is applied by the 3D transform pipe to offset the transformed coordinate into screenspace. By using this, you can scale & move the viewport for free more or less.

sceGuOffset() sets where in the virtual coordinate space of 4096x4096 that the PSP will translate the framebuffer. This is most likely used to give enough space for scissoring until clipping has to be used.
_________________
GE Dominator
Back to top
View user's profile Send private message
Nuclear Bit



Joined: 02 Oct 2005
Posts: 6

PostPosted: Wed Oct 05, 2005 6:18 am    Post subject: Reply with quote

ok, is clear now.
thanks
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