forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Odd memory / render problem

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
white rabbit



Joined: 06 Jul 2005
Posts: 60

PostPosted: Tue Jun 13, 2006 11:09 pm    Post subject: Odd memory / render problem Reply with quote

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?
Back to top
View user's profile Send private message
white rabbit



Joined: 06 Jul 2005
Posts: 60

PostPosted: Wed Jun 14, 2006 7:29 pm    Post subject: Reply with quote

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:

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?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group