Jump to content
  • Advertisement
Sign in to follow this  
The_Nerd

OpenGL Two un-important questions (mostly)

This topic is 4993 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

One: Is OpenGL 2.0 out yet and is it supported on Linux? Two: I remember someone saying that you can use clipplans instead of using the stencil test, cissor box, or glviewport. What way is the best to clip allot of stuff inside allot of rectangles (to be exact, clipping GUI object's children for a GUI system)? Also, is it possible to clip to a rectangular area any where on the screen using clipplans?

Share this post


Link to post
Share on other sites
Advertisement
1/ i believe only with 3dlabs cards, though ati/nvidia are nearly there.
2/ scissor is the best but the problem is u only have one of them, viewport is something else (so it doesnt count).
though for a GUI ild use nothing, ie whats the purpose of clipplanes in this case

Share this post


Link to post
Share on other sites
Viewport sets the transform but does no clipping. If you want to make sure your gui element does not go outside a rectangle then use a scissor test. You do only get one at a time, but you can change it for each gui item. If you want to clip gui items to each other you could control the draw order to draw the top ones first or you could use the depth buffer and draw them at different z values. If you really need complex screen space clipping you could also use the stencil buffer.

From your description it sounds like you want to make sure a gui child is clipped to it's parent's rectangle. In that case before you draw each child just set the scissor rect to the parent rect.

You could also use clip planes, but they don't really make sense for 2d usually. You should be able to get the same effect here with scissor rect.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!