Newbie question on gu...

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
HexDump
Posts: 70
Joined: Tue Jun 07, 2005 9:18 pm

Newbie question on gu...

Post by HexDump »

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.
User avatar
Raphael
Posts: 646
Joined: Tue Jan 17, 2006 4:54 pm
Location: Germany
Contact:

Post by Raphael »

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
HexDump
Posts: 70
Joined: Tue Jun 07, 2005 9:18 pm

Post by HexDump »

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


HexDump.
Post Reply