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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - jstasiak

Pages: [1]
1
Solution is as good as it fit my needs - ergo it is good solution dispite your opinion. :)
My point is - if a lot of people need a lot (different) of shortcuts - maybe one should take most wanted and put into SFML? Libraries are to make life easier and to programmers code less as far as I remember - but it's only my $0.03.

2
In my code I pretty often use rects and calculate their corners, this is why I use a subclass of Rect<T> class to get following behaviour:

Code: [Select]

template <typename T>
sf::Vector2<T> Rect<T>::GetP1() const
{
return Vector2<T>(Left, Top);
}

template <typename T>
sf::Vector2<T> Rect<T>::GetP2() const
{
return Vector2<T>(Right, Bottom);
}


I believe it could be useful to add it to SFML. It makes code like
Code: [Select]

Rectangle(rect.left, rect.top, rect.right, rect.bottom, ...);
// or
Rectangle(Vector2f(rect.left, rect.top), Vector2f(rect.right, rect.bottom), ...);

a little shorter:
Code: [Select]

Rectangle(rect.GetP1(), rect.GetP2(), ...);

Pages: [1]