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 - Aesthete

Pages: [1]
1
Feature requests / Re: Vector2/Vector3 Zero member
« on: May 03, 2015, 11:34:45 am »
The use of it definitely sides on convenience, over performance. But yes, I agree this belongs in the same category as why the Vector classes don't have math functionality. I would vote yay on adding mathematical functionality to the Vector classes anyway (Normalize, Normalized, Magnitude, MagnitudeSqr, Dot, Cross), It's not often I am using a Vector class without needing such functionality.

And not that performance is really an issue as you mentioned, but adding a handful of const static vectors available is trivial.

I'm sure many people have gone out and written their own utility functions as I did to deal with the math operations. I'll check the other threads to follow the discussions on such operations in Vector classes, unless you want to explain why it's unlikely to be accepted in future versions?

2
Feature requests / Vector2/Vector3 Zero member
« on: May 02, 2015, 11:06:46 pm »
Wondering if there is a reason SFML doesn't have a Zero Vector member (0,0). I understand that the Vector constructors will zero them by default, but there are (and always will be) situations where I don't want to instantiate a new vector.

Same goes for members such as: UnitX, UnitY, UnitX, One. You can imagine what these do.. Unit vectors are used alot in various trig calculations, and One is particularly useful when you want to multiply by a scalar.

template <typename T>
class Vector3
{
...
public:
    static const Vector3<T> Zero;
};
template <typename T> Vector3<T> Vector3<T>::Zero = Vector3<T>(0.0f, 0.0f, 0.0f);

// Avoiding an extra copy
void SetPosition(const Vector2f& v);

SetPosition(Vector2f::Zero);
// vs.
SetPosition(Vector2f());

// Constructing a vector of all 42
Vector2i answerVec = Vector2i::One * 42;

Happy to submit a patch, if people think it's useful.

3
Graphics / Loading PNG?
« on: June 26, 2010, 02:23:40 pm »
I had the same problem with some Menu Button sprites that were 48-bit.

I wasn't going to make them again so I just opened them in MS Paint, through the edit option and saved them again. Saves them as 32-bit.

Pages: [1]