Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Displaying a clipped part of tree-list (for scrolling etc)  (Read 4173 times)

0 Members and 1 Guest are viewing this topic.

Wibbs

  • Newbie
  • *
  • Posts: 40
    • View Profile
Displaying a clipped part of tree-list (for scrolling etc)
« 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

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Displaying a clipped part of tree-list (for scrolling etc)
« Reply #1 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.
Laurent Gomila - SFML developer

Wibbs

  • Newbie
  • *
  • Posts: 40
    • View Profile
Displaying a clipped part of tree-list (for scrolling etc)
« Reply #2 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++?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Displaying a clipped part of tree-list (for scrolling etc)
« Reply #3 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);
Laurent Gomila - SFML developer