Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Clipping fonts, GUI stuff

This topic is 5823 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I want to clip a bitmapped font to a certain region. (Think of a multi-line TextBox where the characters need to be clipped to the boundaries of the textbox) I''m also interesting in clipping things contained in a window to the interior of a window. I''ve thought of the following options: 1) Additional clip planes - I''ve tried this and I can''t get it to work. If I draw text and a quad right on top of each other, the quad gets clipped, but the text doesn''t. Does only geometrical data like lines and triangles get clipped by the clipping planes? Has anyone else been able to get this working? 2) Using the stencil buffer - this is kind of bad because I need to clear the stencil buffer each time cause there could be overlapping widgets that both need clipping. 3) Using glViewport() - haven''t tried this yet, but it could be slow. 4) Render to a texture the size of the region I want to clip to, and then render the texture to the screen. This is not good because if there are lots of windows open that need clipping, they each need a texture and thats alot of memory. 5) For windows, I can use software clipping to clip the widgets/controls to the interior of the window because they are just be textured rectangles. But I don''t see anyway to clip text to a window because the characters are stored in display lists... either you call the list or you don''t... Any ideas, comments? Regards, Z01

Share this post

Link to post
Share on other sites
Guest Anonymous Poster
The glScissor function defines the scissor box.

void glScissor(
GLint x,
GLint y,
GLsizei width,
GLsizei height

The glScissor function defines a rectangle, called the scissor box, in WINDOW COORDINATES. The first two parameters, x and y, specify the lower-left corner of the box. The width and height parameters specify the width and height of the box.

The scissor test is enabled and disabled using glEnable and glDisable with argument GL_SCISSOR_TEST.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!