I am a college student. I am trying to do some openGL work without creating a main window, i.e. not using glut or wxWindows. In order to get DC and RC, I tried these ways:
But when calling wglMakeCurrent(hdc, hrc), both do not work. Method glGetString(GL_EXTENSIONS)just returns null. Is there any way I can do it, or I have to create a window? Hope some experts could give me a help.
Thank you for your suggestions. The reason to do this is trying to reduce some overhead when displaying is not needed.
I do work on pbuffer now and have read some nvidia papers on these topic. Some just mentioned “get your current window’s device and render context”, but did not explain in detail why. If we just want the image file, a window is really not needed from the high level viewpoint, but maybe some low level implementation details require such a window. I wonder if someone could tell me the “detail”.
[This message has been edited by xiao (edited 06-18-2002).]
You can open a context without using a window, you just need to set the flag that you want to render to an off screen bitmap in the rendering context setup.