View Full Version : Ways to render without pBuffer and FBO
12-04-2009, 05:49 AM
We are implementing an application which has to be generic across most of the graphic cards. Some cards may / may not support pBuffer and FBOs. Also, our engine cannot get hold of the window context.
Kindly suggest an optimized way to achieve it.
12-04-2009, 06:16 AM
Why do you want to use pbuffers or FBO ?
12-04-2009, 06:22 AM
We are implementing an application which has to be generic across most of the graphic cards. Some cards may / may not support pBuffer and FBOs. Also, our engine cannot get hold of the window context. Kindly suggest an optimized way to achieve it.
Thought I had a suggestion or you until that last sentence.
Let me get this straight. You'd like to render with GL, but you have no access to anything GL can render to? (pbuffer, FBO, system framebuffer/window)...
...oh. Ha ha! Very funny. Where's the camera?! :D
My guess is if you can't create your own window, pbuffer, or FBO (on this GPU or some other GPU or software renderable context like OSMesa), you're out of luck, almost by definition.
12-04-2009, 11:10 AM
I would suggest creating a proxy RenderTarget class that automatically handles whether to use an FBO, pBuffer or texture depending on the capabilities of the GPU. Checking for support for an FBO is trivial by checking to see if glGetString(GL_EXTENSIONS) contains the "GL_ARB_framebuffer_object" string. If it doesn't, you would then check for pBuffer support via the "WGL_ARB_pbuffer" string. If you're developing in a win32 environment, you can get the current active window's HWND handle by calling GetActiveWindow, http://msdn.microsoft.com/en-us/library/ms646292(VS.85).aspx. If there is no pBuffer support, simply resort to rendering to the normal framebuffer then copy the results to a texture. Its not that difficult once you realize you can access the window's handle via GetActiveWindow.
12-08-2009, 02:48 AM
Thank you for your suggestions. :)
The application is using xaml and the view area is a user control in it. I got HWndSrc of the user control using
HWndSrc hWnd = HWndSrc.FromVisual(MapArea); and have passed the hWnd.Handle to the engine.
There are many child controls in this window and only a part of this window is the viewarea.
Have used the glScissors to set the viewarea.
But i see that other parts of the window gets corrupted. Is there any way to avoid it?
And by any means, does any of these calls depends on resolution or OS. Coz it did not work in few other systems having Windows7 and XP with different resolution. To be specific, the implmentation using pBuffer works. But the implementation using window did not work.
Powered by vBulletin® Version 4.2.3 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.