I have been experimenting with some post-processing effects and I have been using FBOs to store stuff.
The problem is, I attempt to resize them when I change resolution. I get no errors, however the image has been stretched so that I only see about the bottom-left quarter of it on my screen.
I have looked over the internet and and found issues such as not using glTexStorage because it is immutable, and being sure to call glViewport after binding a framebuffer. As far as I can see I'm not missing anything simple like that.
Here are some (very dark) screen shots showing the issue:
Please excuse the horrible graphics. I am working on a bloom filter and these images only contain the bright bits so it looks dark and weird.

My FBOs are initialised with a blank texture attached to GL_COLOR_ATTACHMENT0. Here is the rough pseudo code (in java). (my actual code is abstracted behind a game engine I'm writing)
Generating texture:
// Creates the texture
this.id = glGenTextures();
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glBindTexture(GL_TEXTURE_2D, this.id);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
// Set up texture scaling
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, magnification);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, minification);
Filling it with data: (data is a ByteBuffer filled with 0s)
glTexImage2D(GL_TEXTURE_2D, 0, colorMode, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);
glGenerateMipmap(GL_TEXTURE_2D);
Binding the framebuffer:
glBindFramebuffer(GL_FRAMEBUFFER, this.id);
glViewport(0, 0, width, height); // width and height taken from width and height of framebuffer texture
Resizing the framebuffer:
// stores new width and height to be used with glViewport
this.width = width;
this.height = height;
// resize renderbuffer
if(renderbuffer != 0) {
glBindRenderbuffer(GL_RENDERBUFFER, renderbuffer);
glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT, width, height);
glBindRenderbuffer(GL_RENDERBUFFER, 0);
}
glBindTexture(GL_TEXTURE_2D, texture);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);
glGenerateMipmap(GL_TEXTURE_2D); // do i need this?
Thanks very much in advance if you can spot an issue with my code. Let me know if you need the full source as well.