Clipping TextRenderer text?

I’m trying to get TextRenderer to obey a clipping rectangle, but it seems to ignore both the

gl.glScissor(x,y,w,h); gl.glEnable(GL.GL_SCISSOR_TEST);

and the

java.awt.Graphics.setClip(x,y,w,h);

functions.

Is clipping actually possible with TextRenderer? If so, how is it done?

Thanks,

  • Ben

:smiley:

I’ve managed to find out what I was doing wrong! I was calling gl.glScissor(x,y,w,h); gl.glEnable(GL.GL_SCISSOR_TEST); before calling TextRenderer.beginRendering(...), but I should have been calling it between TextRenderer.beginRendering(...); and TextRenderer.endRendering(...);!

I hope this helps other people who are having the same problem as me.

Actually, that’s weird, as OpenGL is a state machine, so it must remember your state (which is: enable scissor test)

The fact that it behaves like you subscribe, is probably due to very lousy coding in TextRenderer.beginRendering(...)