So where can I read the documentation on the gu library. Also how to I draw lines using the hardware. Are there some tutorials? I checked out the Lines smaple in the pspsdk however I didn't quite follow it. I don't know exactly what all the commands do. Can someone point me in the right direction please? Thanks!
GOD Bless you Always!!!!
PSP gu library. Drawing Lines
-
- Posts: 32
- Joined: Thu Sep 15, 2005 8:26 am
Also when I say I want to draw lines using the hardware, I mean I want to do it similar to the way you do it on a PS2. I don't want to use software by using a function that plots pixels on a line. I want to send a simple graphics packet to the gs in the PSP and have it draw the line for me. Any ideas where I can get more info on this? Thanks!
-
- Posts: 32
- Joined: Thu Sep 15, 2005 8:26 am
-
- Posts: 32
- Joined: Thu Sep 15, 2005 8:26 am
Well I can draw triangles. However I can't seem to draw lines afterall.
This is how I setup my code for drawing lines.
However I don't see a line on the screen. Is there something wrong with the way I arrange my points in memory? Thanks!
This is how I setup my code for drawing lines.
Code: Select all
Points = (point2D *)sceGuGetMemory(sizeof(point2D)*2);
Points[0].x = 10;
Points[0].y = 11;
Points[1].x = 100;
Points[1].y = 110;
sceGuDrawArray(GU_LINES, GU_VERTEX_32BITF | GU_TRANSFORM_2D, 2, 0, Points);
Even though you bypass the transform, you need to specify a Z-component. So I hope your structure looks like this:
Otherwise it'll read the vertices improperly.
Code: Select all
typedef struct
{
float x,y,z;
} point2D;
GE Dominator
Also, remember to flush the cache or to "uncache" the pointer.. or does sceGuGetMemory do that nowadays?
http://www.dtek.chalmers.se/~tronic/PSPTexTool.zip Free texture converter for PSP with source. More to come.
-
- Posts: 32
- Joined: Thu Sep 15, 2005 8:26 am
Well just for reference incase anyone else encounters my same problem,
my point2D structure looked like so,
When in actuality, like chp suggested, it should look like so,
Thanks for all the help everyone!
my point2D structure looked like so,
Code: Select all
typedef struct
{
int x,y;
} point2D;
Code: Select all
typedef struct
{
float x,y,z;
} point2D;