• Advertisement

Archived

This topic is now archived and is closed to further replies.

Guest Anonymous Poster

Old versions of direct x

This topic is 6661 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Is there an graphics accelerator in the other computer that uses another pixel-format ? If so, then it's your code that causes those green sprites and not DirectDraw.

CU

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

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
OK, yes the graphics accelerators are different in the computers, but I still don't understand how I can fix the Pixel Format problem.

How did I set the pixel format in the first place?

What is it?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Hello, I've been using direct draw from version 5.0. My problem is that when I take my program to another computer with a more recent version of direct x, the sprites are all green.

I've tried changing monitor resolutions and colour depth myself, via the display settings, but they don't work either.

I'm not using very much of direct draw - just Blt, Flip, CreateSurface, and all the basic initialisation routines.

Is there an incompatibility? I thought all old DirectX games were meant to work with new versions?

Aarrgghhh, I'm going mad...

see ya

Share this post


Link to post
Share on other sites
Are you using 16-bit? If so, most cards use the 565 format, that is 5 bits for red and blue and 6 bits for green. Other cards use a 555 format.

After you've created your surface you can call the function GetPixelFormat, then check the bitmask values it contains like so like so:

LPDIRECTDRAWSURFACE lpdds; //already created
DDPIXELFORMAT ddpf;
int r_mask,g_mask,b_mask

lpdds->GetPixelFormat (&ddpf);
r_mask = ddpf.RBitMask;
g_mask = ddpf.GBitMask
b_mask = ddpf.BBitMask

You don't need to check all of them of course, only the green mask. After that, well, you can create macros for adjusting color values and whatnot. I haven't messed with it much. You can find an article about it at http://dxpm.cjb.net in the archives under DirectX. You have to create an ID and password, but it's free.


Share this post


Link to post
Share on other sites

  • Advertisement