Though a good Windows programmer I am quite new to OpenGL which I am trying to use through Delphi. The problem I am trying to deal with is this:
I want to get OpenGL do draw not to a Window but to an offscreen bitmap.
The reasons for wanting to do this are complicated and go deep into the application context within which I need to use OpenGL, but briefly it is partly to do with the fact that in my application I have to trap WM_ERASE_BKGND and WM_PAINT to handle painting of different parts of the window in a very unusual way.
Only one of those parts is to be rendered using OpenGL and I want to continue using the approach I use with the other parts - paint to an offscreen bitmap and then do a BitBlt.
I have found that simply doing ChoosePixelFormat with PFD_DRAW_TO_BITMAP (with a Windows bitmap DC) and then calling SetPixelFormat fails - which I gather must be because what OpenGL calls a bitmap is not quite a Windows bitmap.
However, I suspect that there must be a way. Any help will be greatly appreciated.