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 

alpha blend - blitalphaimagetoscreen()

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



Joined: 19 Dec 2005
Posts: 81

PostPosted: Wed Dec 21, 2005 4:06 pm    Post subject: alpha blend - blitalphaimagetoscreen() Reply with quote

I am trying to get a 24 x 32 png to blit correctly to the screen while blending in (alpha blending - transparency) over my 480 x 272 background. It is 24 x 32 because it's a game character.

I am using the graphics.c library with this basic code:

initGraphics();

image = loadPngImage("ms0:/PSP/GAME/filename.png");

blitImageToScreen(0, 0, 480, 272, image, 0, 0);

image2 = loadPngImage("ms0:/PSP/GAME/alphablit.png");

// mygetNextPower() in the next function just returns the next highest power of 2

blitAlphaImageToScreen(0, 0, mygetNextPower(24), mygetNextPower(32), image2, 24*x, 32*y);
flipScreen();

###

The first blit works fine.

I saw that the loadPngImage() automatically sets the ->textureWidth and ->textureHeight to a power of 2 -- so I did the same thing.

I have looked at the initgraphics() carefully as well and have looked at a few example apps and still nothing is showing up (entire image blitted completely transparent or is failing - not sure which). If I use blitimagetoscreen instead of the blitalpha function, the transparent area comes out black.

It looks like the sceGuTex..() functions are setup correctly for my purpose (as best I can tell with my limited experience here) so I am lost.

Please help!

Thanks in advance.

David Beyer
Back to top
View user's profile Send private message
dbeyer3069



Joined: 19 Dec 2005
Posts: 81

PostPosted: Fri Dec 23, 2005 5:58 am    Post subject: partially solved Reply with quote

See my other post (most recent "ALPHA BLENDING -- PLEASE HELP") for more info on how I got it working.

Hope this is helpful to someone.

David Beyer
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