Weird FPS camera and framebuffer problem

I am following this tutorial about framebuffers in OpenGL. I have implemented a FPS camera before and now I implemented the framebuffer.
Now as long as I don’t use any controls (WASD and mouse) it works perfectly. But as soon as I move the camera around, a weird error happens.
It’s as if the contents of the framebuffer texture from the last frame aren’t erased, but just the current frame’s contents are added.

I am using the object class from my previous question and a camera class and I’m also loading shaders with a function from another file, but it has nothing to do with this.

Code
main.cpp
object.h
camera.h
Shaders (for the framebuffer texture quad)

What am I missing?

It’s as if the contents of the framebuffer texture from the last frame aren’t erased, but just the current frame’s contents are added.

I did not read your code, but I’m pretty sure you made the right assumption. Just clear the FBO before rendering the new image, just like you clear other buffers.

See this: Framebuffer - OpenGL Wiki

Just clear the FBO before rendering the new image, just like you clear other buffers.

Exactly. Calling glClearColor and glClear after glBindFramebuffer fixed the problem.

Thanks