PDA

View Full Version : A DXDraw question



anubis79
11-01-2004, 01:06 PM
In my project Form1.WindowState is wsMaximized. My DXDraw1 component' s height is 600 and width is 800 and screen resolution is 1024*768. Now I'd like to present Form1 in 32-bit and DXDraw1 in 8-bit. How can I do this in Fullscreen or Windowed mode. Everybody thanks who can help...

anubis79
12-01-2004, 04:50 PM
I think my question isn't clear enough. Ok. Now I'll try to explain it much better. Main phrase is that:

"DXDraw1's Surface or any DirectDraw's Surface color depth is depended display bitcount." It means:

In fullscreen mode if we have a DXDraw1 component and when this DXDraw1 is initialized, DXDraw1.Surface's color depth or pixel format is the same with DXDraw1.Display.Bitcount.
In windowed mode If we have a DXDraw1 component and when it's initialized, DXDraw1.Surface's color depth or pixel format is the same with Windows system. (if Windows runs 32-bit, the surface is 32-bit.)

In my project, I need to specify the surface color depth without depended on display color depth or bit count. For example, display or screen color depth is 32-bit and DXDraw1.Surface or any DirectDraw's Surface color depth is 8-bit.

I'm working on it in two days and I'll be crazy. Please help me...

holybyte
12-01-2004, 07:04 PM
If i understand you right, you need DXDraw Surface with another BPP than current screen mode in windows has ??
Simply set the needed bpp up in the DXDRAW object property page. If your app runs in fullscreen mode - the GUI resolution is automatically changed to that one of DXDraw. Maybe there's code in your program that setup DXDraw with the windows bpp ?

Under Delphix/samples/graphic/basic is an example program which use 8bpp / windowed mode.

anubis79
13-01-2004, 05:54 PM
I've solved the problem to change DelphiX's originality:
In DXDraws.pas there is a function like this:

function TDirectDrawSurface.GetBitCount: Integer;
begin
Result := SurfaceDesc.ddpfPixelFormat.dwRGBBitCount;
end;

and I changed it like this:

function TDirectDrawSurface.GetBitCount: Integer;
begin
Result := 8;
end;

Thank you for your reply holybyte...