Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions include/Color.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ class Color : public ::Color {
return ::ColorToInt(*this);
}

inline std::string ToString() const {
return TextFormat("Color(%d, %d, %d, %d)", r, g, b, a);
}

inline operator std::string() const {
return ToString();
}

/**
* Returns color with alpha applied, alpha goes from 0.0f to 1.0f
*/
Expand Down
8 changes: 8 additions & 0 deletions include/Vector2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ class Vector2 : public ::Vector2 {
return !(*this == other);
}

inline std::string ToString() const {
return TextFormat("Vector2(%f, %f)", x, y);
}

inline operator std::string() const {
return ToString();
}

#ifndef RAYLIB_CPP_NO_MATH
/**
* Add two vectors (v1 + v2)
Expand Down
8 changes: 8 additions & 0 deletions include/Vector3.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ class Vector3 : public ::Vector3 {
return !(*this == other);
}

inline std::string ToString() const {
return TextFormat("Vector3(%f, %f, %f)", x, y, z);
}

inline operator std::string() const {
return ToString();
}

#ifndef RAYLIB_CPP_NO_MATH
/**
* Add two vectors
Expand Down
8 changes: 8 additions & 0 deletions include/Vector4.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ class Vector4 : public ::Vector4 {
return {x, y, z, w};
}

inline std::string ToString() const {
return TextFormat("Vector4(%f, %f, %f, %f)", x, y, z, w);
}

inline operator std::string() const {
return ToString();
}

#ifndef RAYLIB_CPP_NO_MATH
inline Vector4 Multiply(const ::Vector4& vector4) const {
return QuaternionMultiply(*this, vector4);
Expand Down