Just use the other constructor for FrameBuffer. You are using the 1.x variant in a 2.0 context, which doesn't work because the whole gl API has changed between 1.x and 2. Sadly, i can't really detect the current version, so it's left to you to do the 'right thing'.