PDA

View Full Version : Clipping text



halo
04-11-2005, 05:33 PM
Problem:
http://www.leadwerks.com/post/glprob4.png

Using glViewport() before the text render, to limit the size of the drawing area to fit the blue box, had no effect. How can I clip the text to fit inside the label area?

halo
04-11-2005, 05:54 PM
I thought for sure that using a clipping plane would fix things, but look! It only clips entire text, and doesn't do a thing for overhanging text that begins on the non-clipping side of the plane:
http://www.leadwerks.com/post/glprob5.png

Relic
04-13-2005, 05:48 AM
Try glEnable(GL_SCISSOR_TEST) and glScissor(x,y,w,h) (screen coordinates!) with each blue box's content.
Or if screen coordinates are too difficult, request a pixelformat with stencil buffer, the blue boxes fill the stencil and the font drawing tests against it.