Odd memory / render problem

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

Moderators: cheriff, TyRaNiD

Post Reply
white rabbit
Posts: 60
Joined: Wed Jul 06, 2005 7:03 pm

Odd memory / render problem

Post by white rabbit »

I have a mesh class, and if I have just one, it's fine. If I have two, then the memory looks fine (thanks to TyRaNiD for PSPLink!), but nothing gets rendered.

I thought I was out of RAM - odd as I have almost nothing else alloc'ed, but hey... But on checking, the memory is fine, and contains all valid data.

It's as though there's some memory corruption, but I can't see it when I look for it.

I've tried just alloc'ing some memory, and the same thing happens - e.g. memory looks ok, but nothing gets rendered.

Has anybody else had anything like this?
white rabbit
Posts: 60
Joined: Wed Jul 06, 2005 7:03 pm

Post by white rabbit »

Hmmm, I think I've got it - I call sceGuTexMode() when I call any texture. It seems fine to call it once, but no more... that right?

Also, I'm having a bit of a multi-texture issue.

I want to use 2 texture images, one for each sceGumDrawArray(), but only the last one called in sceGuTexImage() seems to be used...
e.g.

Code: Select all

unsigned short *image1 = SomeLoadImageFunction( fileName1 );
unsigned short *image2 = SomeLoadImageFunction( fileName2 );

sceGuStart( GU_DIRECT, renderList );

SomeTextureSetupCode( Use16bpp, nonSwizzeled );

sceGuTexImage( 0, width1, height1, bufferWidth1, image1 );
sceGumDrawArray( GU_TRINAGLE_FAN, GU_TEXTURE_16BIT | GU_NORMAL_16BIT | GU_VERTEX_16BIT | GU_TRANSFORM_3D, 4, 0, square );

sceGumTranslate( &vectorThatMovesItABitOverSoWeCanSeeBothSquares );

sceGuTexImage( 0, width2, height2, bufferWidth2, image2 );
sceGumDrawArray( GU_TRINAGLE_FAN, GU_TEXTURE_16BIT | GU_NORMAL_16BIT | GU_VERTEX_16BIT | GU_TRANSFORM_3D, 4, 0, square );

sceGuFinish();

(hacked on this forum - not real code)

But it seems that when this gets rendered, the pipeline maps the texture onto the surface last thing, and uses the image memory pointed to last... so all textures are image2 - not displaying image1 AND image2.

Does this mean I can only ever have a single texture image in each cycle? Or am I doing something really weird?
Post Reply