PDA

View Full Version : Offtopic windows question



Divide Overflow
12-23-2000, 06:18 AM
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 http://www.opengl.org/discussion_boards/ubb/smile.gif

Someone ?

Geoff
12-26-2000, 06:07 AM
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?

Divide Overflow
12-26-2000, 01:36 PM
Just pure windows http://www.opengl.org/discussion_boards/ubb/smile.gif

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

Divide Overflow
12-27-2000, 01:20 AM
Do I need to force the pen to draw in the second buffer ?

masterpoi
12-27-2000, 12:57 PM
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.

Divide Overflow
12-28-2000, 03:59 AM
Thanx, got it to work