0

I want to implement a Framebuffer Object in my program. I have included

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

I get the following errors:

 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

My code to create the Framebuffer Object is as follows:

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

When I run the following code to create a Vertex Buffer Object, the project compiles:

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

1 Answer 1

3

Framebuffer is considered one word, so use downcase buffers and remove the underscore from the constant:

GLuint fbo;
glGenFramebuffers(1 , &fbo);
glBindFramebuffer(GL_FRAMEBUFFER, fbo);
Sign up to request clarification or add additional context in comments.

1 Comment

@user2670468: To that end, if you acknowledge that Framebuffer is one word it is much clearer that they are not Buffer Objects. They are just objects whose name happens to end with "...buffer" ;) It is an important distinction for many things because Buffer Objects in OpenGL have unique properties when it comes to resource allocation, sharing, etc.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.