🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

DirectDraw skipping lines

Started by
2 comments, last by Omalacon 24 years, 8 months ago
Are u using the lpitch member from the lock?

Do note you need to div the lpitch by 2.

Advertisement
Yeah I am using lPitch, but I didn't know you needed to divide by 2. Why is that, every example I have seen uses just lPitch, and I have made other programs that work using just lPitch.

.. oh and one other thing that doesn't explain why it is skipping a row in each individual pixel.

[This message has been edited by Omalacon (edited October 20, 1999).]

For some reason DirectDraw is drawing pixels in a really funny manner, and it does this in every screen mode I have tried. The pixels seem to have a top line, then a skipped line, then another line in the pixel ITSELF! Then on top of that, it skips ever other line.

I am using Direct X 7 interface and writing directly to the surface (yes using the proper procedure of locking the surface and then getting the pointer, and I am in 16bpp and using a WORD array to access the surface)

Anybody seen this before, and know what causes this? Thanks

-Omalacon

The pitch is stored as the number of BYTES that the line takes up, so if the surface is in 24-bit, you must devide by 3 rather than by 2 (16-bit) or 4 (32-bit). Just remember, With and Height are stored as the number of pixels, Pitch is stored as the number of bytes. (Read "Width vs. Pitch" in the SDK docs)

This topic is closed to new replies.

Advertisement