Changeset 11007
- Timestamp:
- 01/26/10 18:04:55 (3 years ago)
- Location:
- OpenSceneGraph/trunk/src/osgViewer
- Files:
-
- 2 modified
-
PixelBufferWin32.cpp (modified) (1 diff)
-
PixelBufferX11.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgViewer/PixelBufferWin32.cpp
r10824 r11007 633 633 osg::notify(osg::NOTICE) << "\tRequested size (" << _traits->width << "," << _traits->height << ")" << std::endl; 634 634 osg::notify(osg::NOTICE) << "\tPbuffer size (" << iWidth << "," << iHeight << ")" << std::endl; 635 _traits->width = iWidth; 636 _traits->height = iHeight; 635 637 } 636 638 -
OpenSceneGraph/trunk/src/osgViewer/PixelBufferX11.cpp
r10813 r11007 251 251 attributes.push_back( GLX_PBUFFER_HEIGHT ); 252 252 attributes.push_back( _traits->height ); 253 attributes.push_back( GLX_LARGEST_PBUFFER ); 254 attributes.push_back( GL_TRUE ); 253 255 attributes.push_back( 0L ); 254 256 … … 258 260 } 259 261 } 260 262 if (_pbuffer) 263 { 264 int iWidth = 0; 265 int iHeight = 0; 266 glXQueryDrawable(_display, _pbuffer, GLX_WIDTH , (unsigned int *)&iWidth); 267 glXQueryDrawable(_display, _pbuffer, GLX_HEIGHT , (unsigned int *)&iHeight); 268 269 if (_traits->width != iWidth || _traits->height != iHeight) 270 { 271 osg::notify(osg::NOTICE) << "PixelBufferX11::init(), pbuffer created with different size then requsted" << std::endl; 272 osg::notify(osg::NOTICE) << "\tRequested size (" << _traits->width << "," << _traits->height << ")" << std::endl; 273 osg::notify(osg::NOTICE) << "\tPbuffer size (" << iWidth << "," << iHeight << ")" << std::endl; 274 _traits->width = iWidth; 275 _traits->height = iHeight; 276 } 277 } 261 278 XFree( fbconfigs ); 262 279 } … … 268 285 { 269 286 GLXFBConfigSGIX fbconfig = glXGetFBConfigFromVisualSGIX( _display, _visualInfo ); 270 271 _pbuffer = glXCreateGLXPbufferSGIX(_display, fbconfig, _traits->width, _traits->height, 0 ); 272 287 typedef std::vector <int> AttributeList; 288 289 AttributeList attributes; 290 attributes.push_back( GLX_LARGEST_PBUFFER_SGIX ); 291 attributes.push_back( GL_TRUE ); 292 attributes.push_back( 0L ); 293 294 _pbuffer = glXCreateGLXPbufferSGIX(_display, fbconfig, _traits->width, _traits->height, &attributes.front() ); 295 if (_pbuffer) 296 { 297 int iWidth = 0; 298 int iHeight = 0; 299 glXQueryGLXPbufferSGIX(_display, _pbuffer, GLX_WIDTH_SGIX , (unsigned int *)&iWidth); 300 glXQueryGLXPbufferSGIX(_display, _pbuffer, GLX_HEIGHT_SGIX, (unsigned int *)&iHeight); 301 302 if (_traits->width != iWidth || _traits->height != iHeight) 303 { 304 osg::notify(osg::NOTICE) << "PixelBufferX11::init(), SGIX_pbuffer created with different size then requsted" << std::endl; 305 osg::notify(osg::NOTICE) << "\tRequested size (" << _traits->width << "," << _traits->height << ")" << std::endl; 306 osg::notify(osg::NOTICE) << "\tPbuffer size (" << iWidth << "," << iHeight << ")" << std::endl; 307 _traits->width = iWidth; 308 _traits->height = iHeight; 309 } 310 } 273 311 XFree( fbconfig ); 274 312 }
