Hello again!
I managed to get FBO’s working after a lot of headache, and scouring the internet of examples. I know, it shouldn’t be that hard! Anyway, when rendering to the texture, ie. after calling these two lines of code:
glBindTexture(GL_TEXTURE_2D, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, frameBufferID);
Weird stuff begins to happen. This is the code I use to render some points, and a quad (just to test).
glDisable(GL_POINT_SMOOTH);
glPointSize(2.0f);
glBegin(GL_POINTS);
glColor4f(0.0f, 1.0f, 1.0f, 1.0f);
for (int x = 0; x < 200; x++) {
for (int y = 0; y < 200; y ++) {
glVertex2i(x * 2, y * 2);
}
}
glEnd();
glBegin(GL_QUADS);
glColor4f(1.0f, 0.0f, 1.0f, 1.0f);
glVertex2i(100, 100);
glVertex2i(100, 150);
glVertex2i(150, 150);
glVertex2i(150, 100);
glEnd();
And this works great! Does exactly as I wanted, rendering a large blue box filled with points, and a smaller purple box in the middle.
However, when I change the second glColor4f (in GL_QUADS) method to red (simply changing the third 1.0f to 0.0f), I can no longer see the big blue area (it turns the same colour as the glClear colour). This is literally the only thing that I change, I can go back and forth between the two. The frame rate remains the same as it was when it was rendering everything which is also weird.
Is this a common problem, is there any way to fix it?
Thanks.