7 #include <magic_enum/magic_enum.hpp> 13 #include "Mountain/core.hpp" 22 #define TO_STRING(x) #x 23 #define STRINGIFY(x) TO_STRING(x) 29 enum class TrimOptions : uint8_t
38 using ProjectionFunc =
T(*)(
T);
41 constexpr ProjectionFunc<T> Identity = [](
T t) {
return t; };
48 template <
typename PtrT, Concepts::IntegralT IntT>
70 MOUNTAIN_API
void AlignImGuiCursor(float_t objectWidth, float_t alignment = 0.5f);
157 template <
typename T,
typename U>
163 MOUNTAIN_API
void OpenInExplorer(
const std::filesystem::path& path);
168 MOUNTAIN_API
void OpenInExplorer(
const std::filesystem::path& path, bool_t isFile);
172 MOUNTAIN_API
void OpenFile(
const std::filesystem::path& filepath);
175 template <std::ranges::input_range Container,
typename T>
180 template <std::ranges::input_range Container>
197 template <
typename Ret,
typename... Args>
201 MOUNTAIN_API int32_t TerminalCommand(
const std::string& command, bool_t asynchronous =
true);
203 MOUNTAIN_API
void CreateEmptyFile(
const std::filesystem::path& path);
205 MOUNTAIN_API
void SetThreadName(std::thread& thread,
const std::wstring& name);
207 template <
typename R,
typename... Args>
208 R CallSafe(
const std::function<
R(Args...)>&
function, Args&&... args);
210 MOUNTAIN_API std::wstring NarrowToWide(std::string_view str);
212 MOUNTAIN_API std::string WideToNarrow(std::wstring_view str);
214 MOUNTAIN_API std::string ToLower(std::string_view str);
216 MOUNTAIN_API std::string ToUpper(std::string_view str);
218 MOUNTAIN_API std::pair<float_t, std::string_view> ByteSizeUnit(int64_t size);
220 MOUNTAIN_API std::string GetBuiltinShadersPath();
222 MOUNTAIN_API std::string GetBuiltinAssetsPath();
224 MOUNTAIN_API std::string Trim(std::string_view str, TrimOptions options = TrimOptions::Both);
226 MOUNTAIN_API std::string GetLine(
const std::string& str,
size_t lineIndex);
228 MOUNTAIN_API uint16_t Concat16(uint8_t right, uint8_t left);
230 MOUNTAIN_API uint32_t Concat32(uint8_t right0, uint8_t right1, uint8_t left0, uint8_t left1);
232 template <u
int64_t Offset, u
int64_t Count>
233 constexpr uint64_t GetBits(
const uint64_t value);
235 template <Concepts::EnumT T>
236 constexpr Meta::Flags<T> ToFlags(
T enumValue);
241 enum class Type : uint8_t
287 ENUM_FLAGS(Mountain::Utils::TrimOptions)
289 #include "Mountain/utils/utils.inl"
constexpr float_t BackInOut(float_t t)
constexpr float_t CubicInOut(float_t t)
constexpr float_t QuadIn(float_t t)
MATH_TOOLBOX float_t ElasticIn(float_t t)
MATH_TOOLBOX float_t BounceIn(float_t t)
MOUNTAIN_API constexpr std::string RemoveNamespaces(const std::string &str)
Removes the namespaces indicators from the provided string.
constexpr float_t BackIn(float_t t)
MOUNTAIN_API bool_t StringEqualsIgnoreCase(std::string_view a, std::string_view b)
Checks if two strings are equal, case-insensitive.
constexpr float_t QuartOut(float_t t)
MATH_TOOLBOX float_t BounceInOut(float_t t)
MOUNTAIN_API void AlignImGuiCursor(float_t objectWidth, float_t alignment=0.5f)
Horizontally aligns the cursor of ImGui to be centered around a specific portion of the available spa...
MOUNTAIN_API float_t NormalizeAngle(float_t angle)
Normalizes an angle (clamps its value between 0 and 2 * PI)
Pointer< T > DynamicPointerCast(const Pointer< U > &value)
Equivalent of a dynamic_cast for Pointer "Pointers".
bool_t StringArrayContains(const Container &container, const std::string &element)
Returns whether a string array contains an element using Utils::StringEqualsIgnoreCase.
constexpr float_t CubicIn(float_t t)
MATH_TOOLBOX float_t ElasticInOut(float_t t)
MATH_TOOLBOX float_t CircOut(float_t t)
MOUNTAIN_API void OpenInExplorer(const std::filesystem::path &path)
Opens the specified path in the file explorer.
bool_t ArrayContains(const Container &container, T element)
Returns whether an array contains an element.
MATH_TOOLBOX float_t ExpoInOut(float_t t)
constexpr float_t QuadOut(float_t t)
constexpr float_t CubicOut(float_t t)
MOUNTAIN_API std::string HumanizeVariableName(const std::string &str)
Humanizes the provided variable name.
constexpr size_t FunctionAddress(std::function< Ret(Args...)> f)
Gets the address of a function.
MATH_TOOLBOX float_t SineOut(float_t t)
MOUNTAIN_API Vector3 GetQuaternionEulerAngles(const Quaternion &rot)
Converts a quaternion to its euler angle representation.
constexpr float_t QuartIn(float_t t)
MATH_TOOLBOX float_t SineIn(float_t t)
MATH_TOOLBOX float_t ElasticOut(float_t t)
constexpr float_t QuintIn(float_t t)
MATH_TOOLBOX float_t ExpoOut(float_t t)
MATH_TOOLBOX float_t BounceOut(float_t t)
constexpr float_t QuartInOut(float_t t)
Defines the Mountain::Pointer class.
MOUNTAIN_API constexpr float_t RemapValue(float_t oldValue, Vector2 oldRange, Vector2 newRange)
Remaps a value from one range to another.
Defines the Mountain::Concepts namespace which contains useful concepts used in the engine...
constexpr float_t BackOut(float_t t)
MATH_TOOLBOX float_t SineInOut(float_t t)
MOUNTAIN_API void OpenFile(const std::filesystem::path &filepath)
Opens the specified file on the user's computer.
constexpr PtrT * IntToPointer(IntT number)
Converts a integral number to a valid pointer without illegal size operations.
MOUNTAIN_API std::string HumanizeString(const std::string &str)
Humanizes the provided string.
MOUNTAIN_API Vector3 NormalizeAngles(Vector3 angles)
Normalizes a set of 3 angles in a Vector3 (clamps their value between 0 and 2 * PI) ...
MATH_TOOLBOX float_t ExpoIn(float_t t)
MATH_TOOLBOX float_t CircIn(float_t t)
constexpr float_t QuintOut(float_t t)
constexpr float_t QuadInOut(float_t t)
MOUNTAIN_API bool_t StringContainsIgnoreCase(std::string_view a, std::string_view b)
Checks if a string contains another one, case-insensitive.
size_t GetTypeHash()
Gets the hash code of a specified type.
constexpr float_t QuintInOut(float_t t)
MATH_TOOLBOX float_t CircInOut(float_t t)