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

Author Topic: SFML in the future.  (Read 15157 times)

0 Members and 1 Guest are viewing this topic.

vechestva

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: SFML in the future.
« Reply #15 on: March 18, 2013, 11:16:04 am »
...
You do not understand me. I was referring to the cast to the parent class.
Example even have to SFML:
classes Shape, Sprite and Text are the methods of Transformable, so they inherit from him.
It follows from this that I can use methods getPosition() and I do not need to know which type is inherited particular instance Drawable.

for example:
void Object::Foo(sf::Transformable* transformable)
{
    ...
    transformable->getPosition();
    ...
}


sf::Shape* rect = new sf::RectangleShape;
...
object.Foo(dynamic_cast<sf::RectangleShape*>(rect));
 
« Last Edit: March 18, 2013, 11:33:01 am by vechestva »
I do not know much English.

vechestva

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: SFML in the future.
« Reply #16 on: March 18, 2013, 11:33:30 am »
Fixed the last post
I do not know much English.

Demone

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: SFML in the future.
« Reply #17 on: June 03, 2013, 10:34:43 pm »
the static variables are not singletongs in SFML case because are not accessible from outside directly. There very few. I can remember only VideModes and of course all GLfunctions adresses.

Always avoid Singletons. That's an antipattern.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: SFML in the future.
« Reply #18 on: June 03, 2013, 10:59:47 pm »
Please don't resurrect threads with a discussion that ended months ago...
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development: