Wrong clipping

Hello, I have an application that renders text. The problem is that it’s quite a heavy algorithm and for reasons I can’t divulge on right now I need to render to a texture. So when I create the text I create a square texture, set the viewport, … This all works fine.
However, if my text is bigger than my original screen-size, it gets clipped. This is a problem, as the texture with the text on it moves inside the original window, and I see where it gets clipped. Does anyone have any suggestions why it would clip like that? I mean, I changed the viewport and used the gluOrtho2D function to set the right viewport and viewing volume, yet it still clips at windowside.

Thanking you in advance,
Vincenz

I just noticed why this happens.
–> From MSDN
If any of the pixels within the specified rectangle of the current frame buffer are outside the read window associated with the current rendering context, then the values obtained for those pixels are undefined. No change is made to the internalFormat, width, height, or border parameter of the specified texture array or to texel values outside the specified texture sub-image.

–>

How would I circumvent this?
Thanks again.

It is hard to tell with out seening your view setup and ortho settings.

But when you use bitmap fonts you can not scale them to fit the window like a texture maped bitmap font.

Bitmaps size does not scale, vs. a texture which can be scaled.

I hope this makes sense…

Hmm, oops I forgot to mention I’m using the glCopyTexSubImage function. And that this function has the limitation written above. I guess the easiest solution would just be to render the scene in different pieces and then glue them together :stuck_out_tongue:

Also look at only changing your glViewport, with window re-size and not your glortho or perspective.

Originally posted by Vincenz:
Hmm, oops I forgot to mention I’m using the glCopyTexSubImage function. And that this function has the limitation written above. I guess the easiest solution would just be to render the scene in different pieces and then glue them together :stuck_out_tongue:

Perhaps I explained myself in the wrong way.
This has nothing to do with the windows code, or windows resize code or whatsoever. But I figured out how to solve it. I’ll generate the texture I need piecewise, I hope the performance does not suffer too much under it.