Jump to content

  • Log In with Google      Sign In   
  • Create Account


Old versions of direct x


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 24 October 1999 - 05:45 PM

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


Sponsor:

#2 NuFAN   Members   -  Reputation: 122

Like
Likes
Like

Posted 22 October 1999 - 12:30 AM

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


#3 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 23 October 1999 - 09:58 PM

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?


#4 Aldacron   GDNet+   -  Reputation: 3064

Like
Likes
Like

Posted 24 October 1999 - 05:45 PM

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.







Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS