[osg-users] How to resize when using PIXEL_BUFFER?

Robert Osfield robert.osfield at gmail.com
Fri Feb 5 12:28:56 PST 2016


Hi Greg,

I haven't attempted doing what you are doing before so can't answer
with specific solutions.  General comments would be that Pixel Buffers
are essentially fixed size with no support for resizing.

To provide a something equivalent to resize functionality you could
allocate a new pixel buffer with the new size or create an oversized
pixel buffer at the start that you just use a viewport at the size you
wish to render at.  Potentially you could use FrameBufferObjects
within a PixelBuffer so rather than rendering directly to the
PixelBuffer's frame buffer you render to one FBO and reallocate a FBO
when you need a resize.  The advantage with use a FBO is that you
never need to destroy a graphics context and all the GL objects
associated with it, this means the costs will be much lower for
creating a new window size as creating/destoying a FBO will just
require re-allocation of it, all the rest of the GL objects like
textures, VBO's etc. can remain allocated.

Robert.



More information about the osg-users mailing list