我正在将帧缓冲区绘制成图像,它曾经工作正常,但是有些东西坏了,我不知道是什么......
任何帮助都会很棒 .
我收到错误“QGLFramebufferObject:Framebuffer不完整,缺少附件” .
它似乎间歇性地工作 .
VoxelEditor::VoxelEditor(QWidget *parent)
: QGLWidget(QGLFormat(QGL::SampleBuffers), parent)
{
makeCurrent();
catchFbo = new QGLFramebufferObject(PICTURE_SIZE, PICTURE_SIZE);
void VoxelEditor::renderToImage() {
saveGLState();
const int nrPics = 360 / DEGREES_BETWEEN_PICTURES;
for (int i = 0; i < nrPics; i++) {
catchFbo->bind();
glColorMask(true, true, true, true);
glClearColor(0,0,0,0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LESS);
glEnable(GL_MULTISAMPLE);
glLoadIdentity();
GLfloat x = GLfloat(PICTURE_SIZE) /