|
楼主 |
发表于 2009-10-6 17:53:36
|
显示全部楼层
FBO是什么?
我刚找了一篇文章 从osg::Camera:rawCallBack派生了一个类 使用Viewer->getCamera()->setPostDrawCallBack(new ****);打点跟踪不到类的operator()(const osg::Camera& camera)方法中
贴代码:
class TestCameraCallBack:public osg::Camera::DrawCallback
{
public:
TestCameraCallBack(void){};
~TestCameraCallBack(void){};
public:
void operator()(const osg::Camera &camera) const
{
osg::Image *image;
image = new osg::Image();
osg::GraphicsContext::WindowingSystemInterface *wsi=
osg::GraphicsContext::getWindowingSystemInterface();
unsigned int width,height;
wsi->getScreenResolution(osg::GraphicsContext::ScreenIdentifier(0),
width,height);
image->allocateImage(width,height,1,GL_RGB,GL_UNSIGNED_BYTE);
image->readPixels(0,0,width,height,GL_RGB,GL_UNSIGNED_BYTE);
image->setFileName("a122.bmp");
osgDB::writeImageFile(*image,"F:\\captureImages\\a122.bmp");
}
};
viewer.getCamera()->setPostDrawCallback(new TestCameraCallBack()); |
|