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

Author Topic: v1.6 - Clipping (shapes, Strings..)  (Read 2195 times)

0 Members and 1 Guest are viewing this topic.

adikid89

  • Newbie
  • *
  • Posts: 13
    • MSN Messenger - adikid89@yahoo.com
    • View Profile
v1.6 - Clipping (shapes, Strings..)
« on: March 23, 2011, 07:25:06 pm »
I'm working on a gui system of sorts... and I'm wondering how I could clip stuff like sfml Shapes and Strings like this:

http://img88.imageshack.us/img88/6035/unclipped.png to => http://img25.imageshack.us/i/clipped.png/

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
v1.6 - Clipping (shapes, Strings..)
« Reply #1 on: March 23, 2011, 07:49:47 pm »
You can't do it with SFML. The best workaround is to use the OpenGL function glScissor.
Laurent Gomila - SFML developer

adikid89

  • Newbie
  • *
  • Posts: 13
    • MSN Messenger - adikid89@yahoo.com
    • View Profile
v1.6 - Clipping (shapes, Strings..)
« Reply #2 on: March 23, 2011, 07:58:30 pm »
Quote from: "Laurent"
You can't do it with SFML. The best workaround is to use the OpenGL function glScissor.

Doh... I don't know OpenGL.. I've put off learning it for a while..
I guess it's time to do a tad of research.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
v1.6 - Clipping (shapes, Strings..)
« Reply #3 on: March 23, 2011, 08:25:52 pm »
It's very simple, no need to learn anything about OpenGL
Code: [Select]
glEnable(GL_SCISSOR_TEST);
glScissor(left, top, width, height);
// draw your stuff
glDisable(GL_SCISSOR_TEST);
Laurent Gomila - SFML developer

adikid89

  • Newbie
  • *
  • Posts: 13
    • MSN Messenger - adikid89@yahoo.com
    • View Profile
v1.6 - Clipping (shapes, Strings..)
« Reply #4 on: March 23, 2011, 09:04:06 pm »
Oh! I see. I pretty much got it working. Thanks!