I have some code for rendering a button in an application and I want to clip the text if it's wider than the button itself. Here a bit of code to describe what I'm doing:

GL.Scissor(Frame.X, ScreenSize.Y - Frame.Y - Frame.Height, Frame.Width, Frame.Height);

RenderRect(Frame, Color.Red);
RenderText(Text, Color.White);


I'm using OpenTK and QuickFont as the text rendering library. The main problem is, the rectangle gets clipped just like it should, but the text will render outside the scissor region if it's too long. I wondered what QuickFont was actually doing during the text rendering, but I couldn't find anything else than some GL.PushMatrix and GL.LoadIdentity calls that could interfere. Are these functions resetting the scissor test? Would a GL.PushMatrix call make it so that it would be possible to render outside the clipping rectangle?



You must log in to answer this question.

Browse other questions tagged .