Archived

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

DirectDraw pisses me off...

This topic is 5175 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

Well, here I am at college, running around and testing my game on various machines throughout the campus. Well, I have a Win98 and Win2000 machine at home. Well, I got the game to run perfectly there, but there are some computers at this college that still don''t run it correctly. The problem is some images turn to mush. Not all of them, but just a few. The only thing that I think it could be is different video cards having problems creating the sizes of surfaces that I need. Do some video cards restrict the dimensions of surfaces; such as allowing only multiples of a certain number. Currently, my surfaces are all multiples of 32. Here is an example of how some of the images turn out when blitted: This... 00000000 00111100 00111100 00111100 00000000 turns to this... 01100011 00110001 00011000 10001100 11000110 Now, most machines run the program fine, but some of them turn the images to garbage.

Share this post


Link to post
Share on other sites
Do you take into account that surface stride (scanline width in memory) may not necessary equal BytesPerPixel*width?
Some display adapters allocate a cache space next to surfaces, usually for internal copy optimizations.

-Nik

[edited by - Nik02 on October 13, 2003 1:33:18 PM]

Share this post


Link to post
Share on other sites
If you are asking for 16 bpp bit depth, there are two common formats among the cards: R5G6B5 and R5G5B5. This can cause images to beome garbled. Also when writing directly to surfaces you need to adjust the pitch to account for different bit depths in any calculations you do.

Share this post


Link to post
Share on other sites
Question:

If I have dx9 installed on my system, can I still use directdraw in the same way as is mentioned in the dx7 documentation? I copied the first tutorial from the dx7 directdraw documentation and upon compiling, I get either 3 or 48 errors depending on if I type "IDIRECTDRAW7 lpdd;" (3 errors) or "LPDIRECTDRAW7 lpdd;" (the way it was in the dx7 docs/48 errors). I''ve linked to ddraw.lib and included ddraw.h, so that doesn''t seem to be the problem, and I''ve always been told that dx is backwards compatible. The crazy thing is that dx9 only mentions directdraw within the directshow category whereas before it was in directx graphics.

Share this post


Link to post
Share on other sites
quote:
Original post by obi-wan shinobi
Question:

If I have dx9 installed on my system, can I still use directdraw in the same way as is mentioned in the dx7 documentation?


Yes.
Only thing you can''t do is to mix, for example, DirectDraw7 with Direct3D9, or DirectInput7 with DirectInput9.
With each DX category, you need to stick to a specific version.

-Nik

Share this post


Link to post
Share on other sites