Player Colors

Started by
5 comments, last by Tank2k 24 years, 7 months ago
Hello Tank2k

When your graphics card doesn't support source colorkeys than DirectDraw will emulate it in software. To do this in hardware you have to buy a graphics card which supports that.

VirtualNext

Advertisement
Hi,
it DOES support both destination and source color keying, have a look at your documentation and change the flags. I guess nearly every card built after 1997 should support this, so this doesn't seem to be a problem to me.

It's not possible to do in hardware when your hardware doesn't support it, that's life, but I guess it normally should support it.

CU

------------------
Skullpture Entertainment
#40842461

Graphix Coding @Skullpture Entertainmenthttp://www.skullpture.de
Thanks, that gives me some hope. I'll look at it again.

BTW, does everything default to software emulation if your hardware
doesn't support it? I remember trying to to use Blt and DDBLTFX to do
some surface stretching, but the function failed on me, so I had to write
it myself to get around it. Should this also be emulated in software?

It was setup like this as I remember it:

ZeroMemory( &ddbltfx, sizeof(DDBLTFX) );
ddbltfx.dwSize = sizeof(DDBLTFX);
ddbltfx.dwDDFX = DDBLTFX_ARITHSTRETCHY;

// Stretch the test_surface to the entire back surface
back_surface->Blt(NULL, test_surface, NULL, DDBLT_DDFX | DDBLT_WAIT, &ddbltfx);

-Tank2k

quote:
does everything default to software emulation if your hardware doesn't support it?

No. There are some things that are just too slow in software to make it worth doing. Overlays are one example. For others, you'll have to check the DX documentation.

I got it to work finally. Thanks! (couldn't get DirectX
stretching to work however, oh well).

-Tank2k

I am working on a 2D tile-based game and I would like to create
different player colors for my units like Warcraft II. I thought
I could use 2 different transparency colors, one for the player
color on the unit, and one for the background color around the unit.
I could then blt the player color on the unit surface (using a source
colorkey), and the blt the complete unit to the background (using a
dest colorkey).

However DirectX tells me it does not support source colorkey blts,
only dest colorkey blts!

Well, I really don't want to do this in software, as it would be
simply too slow. Does anyone have advice how I would do this? Is it
still possible in hardware (DirectX)?

-Tank2k

DirectDraw streatching sucks anyways. It doesn't do any filtering, so it looks all blocky.

This topic is closed to new replies.

Advertisement