Hey guys I'm trying to make a directdraw program to output certain statistics but it's not drawing fast enough. Does anyone know how to increase ddraw update speeds?

Thanks in advance!

Dani AI

Generated

If the program truly must stay on DirectDraw (as says), the fastest wins come from three things: run exclusive fullscreen, use page-flipping with video-memory back buffers, and avoid per-pixel or per-frame surface locks. 's suggestion to consider other APIs is valid — modern APIs remove many of these headaches — but the checklist below focuses on squeezing maximum speed from DirectDraw itself.

Practical checklist:

  • Get exclusive fullscreen (SetCooperativeLevel with exclusive/fullscreen) so the driver can do real hardware flips instead of going through the window compositor.
  • Create a primary surface that has attached back buffer(s) and flip it each frame instead of Blt-ing to the primary. Flip is far cheaper when the driver supports it.
  • Request video-memory/offscreen surfaces for sprites/tiles and keep static content there. Minimize Lock/Unlock calls: write into a single offscreen buffer (one Lock per frame), then Blt or Flip once.
  • Use BltFast for simple copies (no stretching/clipping) and color keying or hardware overlays for HUD/text when available.
  • Update only dirty rects rather than full-screen copies. Avoid GDI drawing on the primary surface and avoid per-pixel GetPixel/SetPixel loops.
  • Prefer 16/32-bit modes over 8-bit palette modes (palette conversions are slow).

Troubleshooting tips:

  • Check driver capabilities (DDCAPS) to confirm flipping, overlay, and hardware blits are supported; if not, the runtime is falling back to a software path.
  • If windowed performance is the issue, either switch to fullscreen or reduce interaction with the desktop compositor (DWM).
  • Profile with simple test cases: flip-only vs Blt-only, small-rect updates vs full-screen. If flips are fast but Blts are slow, restructure to favor flips.

If after this the updates are still too slow, consider rendering your 2D UI via a Direct3D path (or Direct2D) while keeping any legacy DirectDraw parts — that hybrid is a common real-world compromise.

Recommended Answers

All 4 Replies

Maybe you are doing it wrong.

DirectDraw is used to render graphics in applications where top performance is important

I don't use DirectDraw so I don't know if that's really true or not. Here's the source of that quote.

I'm doing it correct. It's known that the update rate of ddraw is slow.

Then maybe you should be using something else. OpenGL maybe? But I don't know if it will be any faster.

Has to be ddraw :(

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.