帧缓冲区对象错误?

时间:2013-11-27 11:40:10

标签: c++ opengl

我想在程序中实现一个Framebuffer对象。我已经包括了

#include <GL/glew.h> 
#include <GL/glut.h> 

我收到以下错误:

 error: ‘glGenFrameBuffers’ was not declared in this scope

error: ‘GL_FRAME_BUFFER’ was not declared in this scope

error: ‘glBindFrameBuffer’ was not declared in this scope

我创建Framebuffer对象的代码如下:

GLuint fbo;
glGenFrameBuffers(1 , &fbo);
glBindFrameBuffer(GL_FRAME_BUFFER, fbo);

当我运行以下代码来创建顶点缓冲区对象时,项目编译:

GLuint vbod;
glGenBuffers(1 , &vbod);
glBindBuffer(GL_ARRAY_BUFFER, vbod);

1 个答案:

答案 0 :(得分:3)

Framebuffer被认为是一个单词,因此请使用downcase buffers并从常量中删除下划线:

GLuint fbo;
glGenFramebuffers(1 , &fbo);
glBindFramebuffer(GL_FRAMEBUFFER, fbo);