From Laurens Voerman, "Wile working with pbuffers I noticed that the Win32 implementation uses the attribute WGL_PBUFFER_LARGEST_ARB.

> quote from http://www.opengl.org/registry/specs/ARB/wgl_pbuffer.txt
>    The following attributes are supported by wglCreatePbufferARB:
>
>      WGL_PBUFFER_LARGEST_ARB     If this attribute is set to a
>                                  non-zero value, the largest
>                                  available pbuffer is allocated
>                                  when the allocation of the pbuffer
>                                  would otherwise fail due to
>                                  insufficient resources.  The width
>                                  or height of the allocated pbuffer
>                                  never exceeds <iWidth> and <iHeight>,
>                                  respectively.  Use wglQueryPbufferARB
>                                  to retrieve the dimensions of the
>                                  allocated pbuffer.

It notifies the user when the size is not as requested, but I could find no way for the program to detect this. I've added two lines to write the new size back into the _traits, I think this is appropriate, but I am not absolutely sure.

In PixelBufferX11 was no support, so I've added GLX_LARGEST_PBUFFER(_SGIX) support, with the same writeback to the _trais.


I have tested the GLX_LARGEST_PBUFFER version on linux and the WGL_PBUFFER_LARGEST_ARB with windows, all tested with the modified autocapture I just submitted.


"autocapture --pbuffer --window 100 100 18192 18192 cow.osg.\[0,0,-22.7\].trans"
gives me a 4096x4096 image on my windows machine,
and a 8192x8192 image on linux."
This commit is contained in:
Robert Osfield
2010-01-26 17:04:55 +00:00
parent bad5a4d43a
commit 306f45fbf2
2 changed files with 43 additions and 3 deletions

View File

@@ -632,6 +632,8 @@ void PixelBufferWin32::init()
osg::notify(osg::NOTICE) << "PixelBufferWin32::init(), pbuffer created with different size then requsted" << std::endl;
osg::notify(osg::NOTICE) << "\tRequested size (" << _traits->width << "," << _traits->height << ")" << std::endl;
osg::notify(osg::NOTICE) << "\tPbuffer size (" << iWidth << "," << iHeight << ")" << std::endl;
_traits->width = iWidth;
_traits->height = iHeight;
}
_initialized = true;