PDA

View Full Version : OpenGL and DDB ?????



gardras
01-20-2002, 12:41 PM
how can I draw Opengl to DDB Bitmap in windows API?
i try like this:

hdc = GetDC(hWnd);
GlPlane.hdcMem = CreateCompatibleDC(hdc);
GlPlane.hBitmap = CreateCompatibleBitmap(hdc,cxClient,cyClient);
SelectObject(GlPlane.hdcMem,GlPlane.hBitmap);
hrc = wglCreateContext(GlPlane.hdcMem);
wglMakeCurrent(GlPlane.hdcMem,hrc);
ReleaseDC(hWnd,hdc);

it doesn't work
but what is wrong?????

dpsv
01-20-2002, 05:50 PM
Hi,
Use CreateDIBSection and use compatable DC with 0.

DPS

[This message has been edited by dpsv (edited 01-20-2002).]