[SDL] Help with slow GDI code?

Sam Lantinga slouken at devolution.com
Wed Jul 12 00:06:20 PDT 2006

Can anyone tell me why this wouldn't create a bitmap in video memory?

    hdc = GetDC(hwnd);
    hbm = CreateCompatibleBitmap(hdc, window->w, window->h);

The behavior I'm seeing is that manually clearing a DIB and using BitBlt()
to copy it to a window is actually slightly faster than creating a bitmap
as above, using a brush to clear it, and then copying the bitmap to the
window using BitBlt().

	-Sam Lantinga, Senior Software Engineer, Blizzard Entertainment

More information about the SDL mailing list