Problem with sceGuDrawArray

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

Moderators: cheriff, TyRaNiD

Post Reply
skwi
Posts: 22
Joined: Tue May 16, 2006 4:28 am

Problem with sceGuDrawArray

Post by skwi »

hello everybody
I can use sceGuDrawArray to draw in 2D with GU_TRANSFORM_2D but in 3D with GU_TRANSFORM_3D only sceGumDrawArray work, but sceGuDrawArray draw nothing, why ?
my program use the same GU initialisation as the sample "cube", and in the sample "cube" too, when I replace sceGumDrawArray by sceGuDrawArray, nothing is draw, why ? and what can I do to draw things in 3D with sceGuDrawArray
thank you for the answer
chp
Posts: 313
Joined: Wed Jun 23, 2004 7:16 am

Post by chp »

Because sceGumDraw*()-functions flush the matrix-cache before it calls sceGuDraw*(). Use sceGumUpdateMatrix() prior to sceGuDrawArray() if you use the gum-library to transform your geometry.
GE Dominator
skwi
Posts: 22
Joined: Tue May 16, 2006 4:28 am

Post by skwi »

thank you, I'll try to change things
skwi
Posts: 22
Joined: Tue May 16, 2006 4:28 am

Post by skwi »

but is guDrawArray faster as gumDrawarray? is there any advantages to use guDrawArray instead of gumDrawArray ?
chp
Posts: 313
Joined: Wed Jun 23, 2004 7:16 am

Post by chp »

sceGuDrawArray() is the function that actually renders anything. sceGumDrawArray() is a convenience-function in PSPGUM that makes sure that matrices modified by sceGum*()-functions are flushed to the hardware. It's basically this:

Code: Select all

void sceGumDrawArray(...)
{
 sceGumUpdateMatrix();
 sceGuDrawArray(...);
}
GE Dominator
skwi
Posts: 22
Joined: Tue May 16, 2006 4:28 am

Post by skwi »

thank you a lot
i think i understand now

but i'll continue programming later cause my psp screen is broken
Post Reply