116 lines
2.4 KiB
C++
116 lines
2.4 KiB
C++
// =============================================
|
|
// Aster: constants.h
|
|
// Copyright (c) 2020-2025 Anish Bhobe
|
|
// =============================================
|
|
|
|
#pragma once
|
|
|
|
#include <vulkan/vulkan_core.h>
|
|
|
|
#include <cstdint>
|
|
#include <cstdio>
|
|
|
|
#include <glm/glm.hpp>
|
|
#include <glm/gtx/quaternion.hpp>
|
|
|
|
#include <atomic>
|
|
|
|
namespace aster::types
|
|
{
|
|
using c8 = char;
|
|
using u8 = uint8_t;
|
|
using u16 = uint16_t;
|
|
using u32 = uint32_t;
|
|
using u64 = uint64_t;
|
|
using i8 = int8_t;
|
|
using i16 = int16_t;
|
|
using i32 = int32_t;
|
|
using i64 = int64_t;
|
|
using f32 = float;
|
|
using f64 = double;
|
|
using f128 = long double;
|
|
using b8 = bool;
|
|
using b32 = u32;
|
|
using usize = size_t;
|
|
using isize = intptr_t;
|
|
using uptr = uintptr_t;
|
|
using cstr = char const *;
|
|
|
|
constexpr f32
|
|
operator""_deg(long double degrees)
|
|
{
|
|
return glm::radians<f32>(static_cast<f32>(degrees));
|
|
}
|
|
|
|
constexpr f32
|
|
operator""_deg(unsigned long long int degrees)
|
|
{
|
|
return glm::radians<f32>(static_cast<f32>(degrees));
|
|
}
|
|
|
|
constexpr f32
|
|
operator""_rad(long double rads)
|
|
{
|
|
return static_cast<f32>(rads);
|
|
}
|
|
|
|
constexpr f32
|
|
operator""_rad(unsigned long long int rads)
|
|
{
|
|
return static_cast<f32>(rads);
|
|
}
|
|
|
|
using glm::ivec2;
|
|
using glm::ivec3;
|
|
using glm::ivec4;
|
|
using glm::quat;
|
|
using glm::vec2;
|
|
using glm::vec3;
|
|
using glm::vec4;
|
|
|
|
using glm::mat2;
|
|
using glm::mat3;
|
|
using glm::mat4;
|
|
|
|
template <typename T>
|
|
constexpr T MaxValue = std::numeric_limits<T>::max();
|
|
|
|
template <typename T>
|
|
constexpr T MinValue = std::numeric_limits<T>::min();
|
|
|
|
template <typename T>
|
|
constexpr T LowestValue = std::numeric_limits<T>::lowest();
|
|
|
|
template <typename T>
|
|
constexpr T ErrEpsilon = std::numeric_limits<T>::epsilon();
|
|
|
|
template <typename T>
|
|
constexpr T PositiveInf = std::numeric_limits<T>::infinity();
|
|
|
|
template <typename T>
|
|
constexpr T NegativeInf = -std::numeric_limits<T>::infinity();
|
|
|
|
template <typename T>
|
|
constexpr T Qnan = std::numeric_limits<T>::quiet_NaN();
|
|
|
|
template <typename T>
|
|
constexpr T Snan = std::numeric_limits<T>::signalling_NaN();
|
|
} // namespace aster::types
|
|
|
|
namespace aster
|
|
{
|
|
using namespace types;
|
|
|
|
namespace ansi_color
|
|
{
|
|
constexpr auto Black = "\u001b[30m";
|
|
constexpr auto Red = "\u001b[31m";
|
|
constexpr auto Green = "\u001b[32m";
|
|
constexpr auto Yellow = "\u001b[33m";
|
|
constexpr auto Blue = "\u001b[34m";
|
|
constexpr auto Magenta = "\u001b[35m";
|
|
constexpr auto Cyan = "\u001b[36m";
|
|
constexpr auto White = "\u001b[37m";
|
|
constexpr auto Reset = "\u001b[0m";
|
|
} // namespace ansi_color
|
|
} // namespace aster
|