Skip to main content
GameDev.net gamedev.net
🔒 Locked

Back Buffering in GDI

Started by Jazonxyz Oct 1, 2008 at 6:36 PM 1 replies 1k views
Original Post
Jazonxyz
Jazonxyz
How can I backbuffer in GDI? I tried this but it wont draw anything: RECT Rect; GetClientRect(GetMainWindow(),&Rect); HDC hDC = GetDC(GetMainWindow()); HDC BackBuffer = CreateCompatibleDC(hDC); FillRect(BackBuffer,&Rect,(HBRUSH)GetStockObject(BLACK_BRUSH)); BitBlt(hDC,0,0,800,600,BackBuffer,0,0,SRCCOPY);
rufus74
rufus74
You need to use a memory device context
The article is for MFC but I think it shouldn't be a big deal to convert it to GDI/Win32.
Hope this helps,
Cheers.
LessBread
LessBread
Here's sample code in C for a dinky little Win 32 GDI particle spewing toy. YMMV.
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes." - the Laughing Man

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.