Question

I am trying to create a generic list box in OpenGl ES (for the iPhone/iTouch) and I am running into a bit of a conundrum with clipping the ListBoxItems. Each ListBoxItem object will know how to draw itself. The ListBox I am making will just draw each one after another. But what if the number of items is larger than the ListBox? I will need to be able to scroll (not a problem) the ListBoxItems up and down. It will be a smooth scroll, so there will be times when a ListBoxItem will be half (or more, or less) visible and the other portion will be hidden because it is "outside" the ListBox area. How do I get this clipping to work correctly when I am making my ListBox widget?

Thanks for any help or links you have,

~Eric

Was it helpful?

Solution

If you need to crop your rendering use glScissor!

  void glScissor( GLint x,
          GLint y,
          GLsizei width,
          GLsizei height )
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top