Hey, i've been trying to draw a surface to the backbuffer using stretchrect(); and it works, but doesn't send in the alpha.
I've set the render states for alpha blending to true:
d3ddev->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
d3ddev->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
d3ddev->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);
and i've loaded the surface successfully:
D3DXLoadSurfaceFromFile(tilesurface1, NULL, NULL, "Title_Screen_text1.png", NULL, D3DX_DEFAULT, 0, NULL);
And also, i have the backbuffer format set to A8R8G8B8.
3d models that are textured seem to work fine with alpha blending, but surfaces don't.
I'm using stretchrect for drawing my surfaces, is this a bad thing? I've heard of this thing called "BlittoSurface", but i don't know how to use it. Can someone please help me?
Directx 9 surfaces with alpha don't work!
Started by Solid_Spy, Dec 07 2012 10:59 AM
3 replies to this topic
Sponsor:
#2 Members - Reputation: 173
Posted 07 December 2012 - 07:15 PM
Alright, well if no-ones able to help me, i guess i'll just have to resort to using 3d quads. it would probably be better anyways since it would make it so that i can apply some cool 3d effects to it. However, i still wan't to learn how to make surfaces with alpha. Please help me.
Edited by Solid_Spy, 07 December 2012 - 07:23 PM.
#4 Members - Reputation: 173
Posted 07 December 2012 - 08:40 PM
Yep, StretchRect isn't a "real" drawing function, in that it doesn't respect all your render-states. Drawing a quad (or a triangle) is the right thing to do.
i guess i'll just have to resort to using 3d quads
Ok, however, I found this cool function called UpdateSurface, however it isn't much different from stretchrect it looks like, but it still doesn't fix the alpha problem.
I want to be able to draw surfaces over other surfaces for shader effects as well, such as adding bloom to an original image, how would i get the alpha to work? This is literally driving me nuts.
Edited by Solid_Spy, 07 December 2012 - 10:15 PM.






