gettings started: some questions

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

Moderators: cheriff, TyRaNiD

Post Reply
Riviera Kid
Posts: 9
Joined: Sat Oct 29, 2005 5:02 am

gettings started: some questions

Post by Riviera Kid »

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.
jsgf
Posts: 254
Joined: Tue Jul 12, 2005 11:02 am
Contact:

Re: gettings started: some questions

Post by jsgf »

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.
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).
Paco
Posts: 54
Joined: Sun Oct 09, 2005 6:53 pm

Re: gettings started: some questions

Post by Paco »

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
Post Reply