alpha blend - blitalphaimagetoscreen()

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

Moderators: cheriff, TyRaNiD

Post Reply
dbeyer3069
Posts: 81
Joined: Mon Dec 19, 2005 4:09 pm

alpha blend - blitalphaimagetoscreen()

Post by dbeyer3069 »

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
dbeyer3069
Posts: 81
Joined: Mon Dec 19, 2005 4:09 pm

partially solved

Post by dbeyer3069 »

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
Post Reply