I am running a C++ 3d realtime application on winxp that itself runs on VMWare Workstation 9.0. I have 3d acceleration disabled in VMWare so I only have the windows OpenGL implementation to use. I am rendering high resolution screenshots from my application using a hidden win32 window. But it seems not possible to render a higher resolution than the WinXP has its desktop at. What is the reason for this? Is an opengl context constrained to desktop resolution in GDI opengl? The area in the screenshot image that is outside screen resolution is just black.
1 Answers
I cannot tell you the reason for this implementation decision. But note that it fully conforms to the OpenGL 1.1 specification:
4.1.1 Pixel Ownership test
The first test is to determine if the pixel at location (x_w,y_w) in the framebuffer is currently owned by the GL (more precisely, by this GL context). If it is not, the window system decides the fate of the incoming fragment. Possible results are that the fragment is discarded..."
In a sense you are even "lucky" that a hidden window works, because technically it doesn't own the pixels. (If I should speculate about the reason, note that the OpenGL v1.1 implementation has been around since at least Windows 98. And graphics resources used to be really expensive...)
Maybe an OpenGL software implementation like Mesa3d is an option for you? As far as I remember, they support framebuffer objects, which are the preferred method for off-screen rendering nowadays. (Depending on the required resolution and the limits of your GL implementation you might still be forced to render and assemble tiles.)