| View previous topic :: View next topic |
| Author |
Message |
BlackDragon777
Joined: 15 Sep 2005 Posts: 32
|
Posted: Fri Sep 23, 2005 1:42 am Post subject: PSP gu library. Drawing Lines |
|
|
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!!!! |
|
| Back to top |
|
 |
BlackDragon777
Joined: 15 Sep 2005 Posts: 32
|
Posted: Fri Sep 23, 2005 1:48 am Post subject: |
|
|
| 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! |
|
| Back to top |
|
 |
BlackDragon777
Joined: 15 Sep 2005 Posts: 32
|
Posted: Fri Sep 23, 2005 11:33 am Post subject: |
|
|
| Nevermind. I got it now. Thanks anyways though! |
|
| Back to top |
|
 |
BlackDragon777
Joined: 15 Sep 2005 Posts: 32
|
Posted: Fri Sep 23, 2005 2:13 pm Post subject: |
|
|
Well I can draw triangles. However I can't seem to draw lines afterall.
This is how I setup my code for drawing lines.
| Code: |
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);
|
However I don't see a line on the screen. Is there something wrong with the way I arrange my points in memory? Thanks! |
|
| Back to top |
|
 |
chp
Joined: 23 Jun 2004 Posts: 313
|
Posted: Fri Sep 23, 2005 4:10 pm Post subject: |
|
|
Even though you bypass the transform, you need to specify a Z-component. So I hope your structure looks like this:
| Code: |
typedef struct
{
float x,y,z;
} point2D;
|
Otherwise it'll read the vertices improperly. _________________ GE Dominator |
|
| Back to top |
|
 |
ector
Joined: 12 May 2005 Posts: 195
|
Posted: Sat Sep 24, 2005 3:49 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
chp
Joined: 23 Jun 2004 Posts: 313
|
Posted: Sat Sep 24, 2005 4:06 am Post subject: |
|
|
sceGuGetMemory() has always "uncached" the pointer. Users just keep forgetting it when they aren't using that function. :) _________________ GE Dominator |
|
| Back to top |
|
 |
BlackDragon777
Joined: 15 Sep 2005 Posts: 32
|
Posted: Sat Sep 24, 2005 6:49 am Post subject: |
|
|
Well just for reference incase anyone else encounters my same problem,
my point2D structure looked like so,
| Code: |
typedef struct
{
int x,y;
} point2D;
|
When in actuality, like chp suggested, it should look like so,
| Code: |
typedef struct
{
float x,y,z;
} point2D;
|
Thanks for all the help everyone! |
|
| Back to top |
|
 |
|