Qbasicnews.com

Full Version: Translucency in DirectX (DDraw 7).
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm too lazy to check (I have little internet time now). You know that in most libs (i.e. Future.Lib) you call some kind of

Code:
SetBlender 127

and from that point every library function that draws something does it translucently using "127" as the translucency level. You have to call some kind of

Code:
SetBlender 0

To have it drawing stuff solidly again.

Can that be done easily in DirectDraw? I mean, can you call some sort of function or set some sort of property so the surfaces are blitted and the primitives are drawn translucently in subsequent calls to bitblt and stuff, or should I have to define special translucent surfaces/call special functions?

Thanks Smile (I'm porting BSC3 (the engine that runs "Zhandha") to VB and I got stuck when I found the blending stuff Tongue)
I don't know how it works in DirectX, but in OpenGL the alpha channels are used for translucency data, so that each point of a polygon or so can have a translucency. I think it also works with textures the same way.

I don't know if DirectX and OpenGL are the same at these points, but perhaps you could try searching for alpha channels or something. Or you could ask Microsoft about blending... Wink
For my TinyPTC extension library, I alpha blended each pixel manually. It's probably a little slow, as each pixel (source and destination both) have to be split down into their respective RGB values, calculated, and then combined into a new value which is then blitted. I was always under the impression that DirectDraw had no alpha blending functions built-in, but I've heard that Direct3D does, and from what I understand, using DX8's quads for sprites allows you to do stuff like alpha-blending, rotation, and scaling, plus other fun stuff like shearing and perspective modifications.
I believe there is a dx alpha translucency. Dunno the exact command though. :*(
adosorken is right.
You can't do alpha blending with DirectDraw without doing it by yourself.
But in Direct3D you can do it.
Thanks. I've downloaded tons of VB sources that perform various blits.

Anyhow, I just wanted to draw a translucent black box for the text boxes. I'll see what I can do; if it is too slow expect just a black box Sad
If it was only for a textbox I'd give it try. I don't think that it would slow down the system that much.