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

Author Topic: Drawing circle with texture?  (Read 2638 times)

0 Members and 1 Guest are viewing this topic.

Robbis_1

  • Newbie
  • *
  • Posts: 9
    • View Profile
Drawing circle with texture?
« on: August 27, 2011, 01:03:31 pm »
Hey, I'm currently using SFML 2.0 and I'm drawing a circle using sf::Shape and the AddPoint function. This is all working good, but I'd like to apply a texture to the circle.

I just want to apply it in a simple way, so it would look like you took a quad, rendered it with a texture and then put a circle in the middle of it and sampled only those parts inside the circle. In other words, I'd like to apply an UV map to my circle somehow.

Is there any way of doing this in SFML? Or would I have to do it with OpenGL? If it's the latter, then I could use some help with it.  :wink:

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Drawing circle with texture?
« Reply #1 on: August 27, 2011, 01:56:53 pm »
Texturing shapes is not yet possible in SFML, but it will be with the new rendering system that Laurent is currently implementing. The final release of SFML 2.0 should offer this functionality.

By the way, do you need more flexibility that you add points manually using AddPoint() instead of calling sf::Shape::Circle()?
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Robbis_1

  • Newbie
  • *
  • Posts: 9
    • View Profile
Drawing circle with texture?
« Reply #2 on: August 27, 2011, 02:07:36 pm »
Ah, thanks. I guess I'll have to wait then.

Yes, I'm creating really big spheres, so I'm only creating the part of the sphere that's inside the screen. This allows me to make it in a higher resolution and only draw the points that's inside the screen.

 

anything