SFML community forums

Bindings - other languages => DotNet => Topic started by: Wibbs on March 20, 2010, 09:22:12 pm

Title: Displaying a clipped part of tree-list (for scrolling etc)
Post by: Wibbs on March 20, 2010, 09:22:12 pm
Hi all,

I'm trying to implement a tree-list view contained within a scrollable pane, but I can't work out the best way of displaying a small part of the overall tree.  I need to be able to clip it horizontally if any of the strings are too long, and vertically if the list has too many items for the size of the display pane, the idea being to implement scrollbars to navigate the list.

I would appreciate any pointers as to how to approach this.  

Thanks,

Wibbs
Title: Displaying a clipped part of tree-list (for scrolling etc)
Post by: Laurent on March 21, 2010, 11:42:37 am
This is not possible, but a simple workaround is to use the glScissor OpenGL function.

This kind of feature should be added soon to SFML 2.
Title: Displaying a clipped part of tree-list (for scrolling etc)
Post by: Wibbs on March 21, 2010, 01:11:56 pm
Hmmm, you're talking about someone with absolutely no experience with OpenGL at all here... :wink:

Also, how do you access opengl calls through .net with sfml, as it doesn't seem to work in the same way as the tutorial shows for c++?
Title: Displaying a clipped part of tree-list (for scrolling etc)
Post by: Laurent on March 21, 2010, 01:31:58 pm
You have to use Tao.OpenGL (google for it) to access OpenGL in .Net.

To enable clipping you just have two functions to call:
Code: [Select]
Gl.glEnable(Gl.GL_SCISSOR_TEST); // call glDisable to disable
Gl.glScissor(left, top, width, height);