- Timestamp:
- 05/24/08 10:13:55 (5 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/examples/osgscreencapture/osgscreencapture.cpp
r8333 r8334 51 51 _mode(mode), 52 52 _fileName(name), 53 _pixelFormat(GL_ RGB),53 _pixelFormat(GL_BGR), 54 54 _type(GL_UNSIGNED_BYTE), 55 55 _width(0), … … 194 194 osg::Image* image = _imageBuffer[_currentImageIndex].get(); 195 195 196 #if 1 196 197 image->readPixels(0,0,_width,_height, 197 198 _pixelFormat,_type); 199 #endif 198 200 199 201 if (!_fileName.empty()) … … 252 254 } 253 255 256 #if 1 254 257 glReadPixels(0, 0, _width, _height, _pixelFormat, _type, 0); 258 #endif 255 259 256 260 GLubyte* src = (GLubyte*)ext->glMapBuffer(GL_PIXEL_PACK_BUFFER_ARB, … … 315 319 316 320 321 bool doCopy = copy_pbo!=0; 322 if (copy_pbo==0) 323 { 324 ext->glGenBuffers(1, ©_pbo); 325 ext->glBindBuffer(GL_PIXEL_PACK_BUFFER_ARB, copy_pbo); 326 ext->glBufferData(GL_PIXEL_PACK_BUFFER_ARB, image->getTotalSizeInBytes(), 0, GL_STREAM_READ); 327 328 osg::notify(osg::NOTICE)<<"Generating pbo "<<read_pbo<<std::endl; 329 } 330 317 331 if (read_pbo==0) 318 332 { … … 328 342 } 329 343 344 #if 1 330 345 glReadPixels(0, 0, _width, _height, _pixelFormat, _type, 0); 331 332 333 if ( copy_pbo!=0)346 #endif 347 348 if (doCopy) 334 349 { 335 350
