AboutBlogContact
TechnologySeptember 30, 1995 2 min read 150Updated: June 22, 2026

DirectDraw: Accessing Video Hardware Directly on Windows

AunimedaAunimeda
📋 Table of Contents

It’s late 1995, and the transition from DOS to Windows 95 is a nightmare for game developers. In DOS, we had total control-we could write directly to video memory at 0xA0000 and get every ounce of performance. In Windows, we’re stuck with GDI, which is about as fast as a snail on a cold day. But Microsoft has finally released the "Game SDK," and at its heart is DirectDraw.

Bypassing the GDI

DirectDraw isn't a high-level drawing API. It’s a hardware abstraction layer that gives us a pointer to the "surface" of the video memory. It allows for hardware-accelerated "blits" (block transfers) and page flipping, which are essential for smooth animation.

// DirectDraw: Getting a pointer to the front buffer
DDSURFACEDESC ddsd;
ddsd.dwSize = sizeof(ddsd);
lpDDSPrimary->Lock(NULL, &ddsd, DDLOCK_WAIT, NULL);
unsigned char* pVideoMemory = (unsigned char*)ddsd.lpSurface;
// Now we can write to pixels just like in DOS!
pVideoMemory[y * ddsd.lPitch + x] = color_index;
lpDDSPrimary->Unlock(NULL);

The End of the "DOS Prompt"

For the first time, we can write a game that runs in a window or full-screen without losing that raw speed. It’s not perfect-COM (Component Object Model) is a bit of a chore to work with, and the documentation is sparse-but it’s the bridge we needed.

A New Playground

We’re seeing the first wave of "DirectX" games hitting the shelves. If this takes off, the PC might finally become a unified gaming platform instead of a collection of incompatible sound cards and video drivers. I’ve spent my weekend rewriting our sprite engine to use DirectDraw surfaces, and the frame rate on my Pentium 90 has doubled. The DOS era is officially closing.

Read Also

C++0x: The Long Road to C++11aunimeda
Technology

C++0x: The Long Road to C++11

The C++ committee is working on 'C++0x.' With features like auto, lambda expressions, and rvalue references, it's a massive update to a veteran language.

The Wii Remote: When Accelerometers Met Gamingaunimeda
Technology

The Wii Remote: When Accelerometers Met Gaming

Nintendo is walking away from the 'Teraflop War' to focus on a new way to play. The Wii Remote might just be the most disruptive piece of hardware in a decade.

Second Life: The First Real Metaverse?aunimeda
Technology

Second Life: The First Real Metaverse?

Linden Lab's Second Life is more than a game; it's a platform for a digital society. But can we really live in a 3D world?

Need IT development for your business?

We build websites, mobile apps and AI solutions. Free consultation.

Get Consultation All articles