Offtopic windows question

How can I do a simple 2D virtual screen in windows? I am doing something like

HGC hdc = GetWindowDC( Test1Window->Handle );
HPEN pen = CreatePen( PS_SOLID,0,0x011aa00 );
SelectObject(hdc, pen);

for(i = 0; i < 50; i++)
for (long j = 0; j < 50; j++)
SetPixel( hdc2, i+30, j+30, 15);

However, I hate the flickering

Someone ?

Good question…heh heh.

I wonder if you’d have to use DX and specifiy a double buffered surface? I’m assuming that would be overkill?

Just pure windows

But I did specify a double buffer in the setpixelformat function.

Do I need to force the pen to draw in the second buffer ?

you’ll have to create a second memory device context using CreateCompatibleDC and CreateCompatibleBitmap. Draw on that DC and bitblt it to your primary surface. For more information see MSDN.

Thanx, got it to work