Archived

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

Armand

DX8 using DX7 DD surface problem.

Recommended Posts

Greetings. My problem is this. I''m using the DX8.1 SDK to create a program that uses DX7 DirectDraw surfaces{Front and back}. And I get screen corruption. Basicly I want the pixel control. Now I''ve tryed different res''s {{640, 480}, {800, 600) ,{1024, 768}} all with both 16 and 32 bit depths. All this on 2 different OS. {win98 and win2k} When I flip the screen I unlock the back surface, flip, relock the back surface and then set all the pixels with the value of the blue bit mask. The test stuff I''m showing is a box of colours to show the pallet in the top left corner. I''ve had various corruptions. Examples are.. * Top half of the screen showing what I want, the other showing random crap. * The background being pink. {I could almost understand green} * The lines making up my box of colours being repeted across the screen. To add yet more confusion, At 1024 by 768 by 16. It worked perfacly under win98. It was the same res as my background but half the bit depth. Anyone else had simmilar problems in the past?? Also I was wondering if there is any way of turning off the alpha channle in 16 bit mode? Hopefuly there is some small thing I''m missing. Thanks for reading this rant/question. It is a good day to code.

Share this post


Link to post
Share on other sites
Check out the util package that comes with directX
it shows some lock unlock and flip of the surfaces.

For the colors maybe u should check how u put the RGB bits together again.

Share this post


Link to post
Share on other sites
JoeZ: I will check out the Util. The objection I had was trying to find the relivant stuff to what I was doing outside of the CSurface stuff. I might not have look hard enought at it.
As for the colours. I didn''t think I was doing anything strange.
They stuff that I''m doing would be better for 32 bit but It seems to be working better for 16.

pipelayer_pres: How do you mean clearing the back buffer. If you mean using something like fill rec then no. If you mean set every pixel in the buffer to one color then yes. {I loop throught
and set all word values to the blue bit mask.}

I tryed some more tests last night.
The whole thing shows up fine in 1024 X 768 X 16 on either win2K or win98.

Question Whats the differance between the pitch and the screen width?

Share this post


Link to post
Share on other sites
Seeing your variable declarations and your rendering code will
help. Quick thought, you say you are setting all the word values to blue. This is fine in 32bpp, since each pixel is a word but not in 16bpp. You need to access the surface with a 16-bit pointer like unsigned short.

Share this post


Link to post
Share on other sites
pipelayer_pres: I can''t post the code just now.
{it''s at home, I''m at work.}
The example I modifyed it from is at
http://www.codeproject.com/directx/BasicDD.asp
. It has the same problem when I run it.


It is a good day to code.

Share this post


Link to post
Share on other sites