Im having issues with the current framebuffer, what should be really easy to solve, but im breaking my head over it.
Currently my implementation of binding / unbinding looks like this:
public void Bind(){
EXTFramebufferObject.glBindFramebufferEXT( EXTFramebufferObject.GL_FRAMEBUFFER_EXT, FBOId);
glPushAttrib(GL_VIEWPORT_BIT);
glPushAttrib(GL_COLOR_BUFFER_BIT);
glViewport( 0, 0, viewportwidth, viewportheight);
glMatrixMode(GL_PROJECTION);
glClearColor(0,0,0,0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
}
public void Unbind(){
EXTFramebufferObject.glBindFramebufferEXT( EXTFramebufferObject.GL_FRAMEBUFFER_EXT, 0);
glPopAttrib();
glPopAttrib();
}
However the framebuffer does not scale to viewportwidth, viewportheight
Instead, the output is an oddly scaled version between the framebuffer dimensions and the normal screen dimensions.
Im trying to render an image to a buffer (512, 512), the screen is however (1200, 900)
so how do i set the framebuffer to 512, 512 instead of having it locked at 1200, 900?
Any help appriciated.