I want to render into a texture, which is larger than my current viewport. I use the fboClass and create an FBO for that purpose. What I would like to do is setting the viewport to according to the texture dimensions (512x512). However, I only get correct results, when setting the viewport according to my current canvas resolution (640x480). As a consequence I cannot render to the whole y-extend of the texture…
Any ideas, how to solve this issue?
Thanks for the replies! Unfortunately I cannot post the whole code, since it is part of a bigger software project. But after the gluOrtho2D call, there happens only very basic rendering.
What is about the glViewport call, do I need to set it?
Don’t Disturb was pointing out the lack of glViewport call in the above code, you should do:
glPushAttrib(GL_TRANSFORM_BIT);
GLint viewport[4];
glGetIntegerv(GL_VIEWPORT, viewport);
// after saving the current viewport attributes do glViewport(0, 0, 512, 512);