Files
Z3D/include/config/primitives.hpp
2025-03-28 13:09:34 +01:00

63 lines
1.2 KiB
C++

#pragma once
#include <tuple>
#include <array>
#include "glm/gtc/type_aligned.hpp"
#include "util/id_type.hpp"
namespace z3d
{
using u8 = std::uint8_t;
using u16 = std::uint16_t;
using u32 = std::uint32_t;
using u64 = std::uint64_t;
using i8 = std::int8_t;
using i16 = std::int16_t;
using i32 = std::int32_t;
using i64 = std::int64_t;
using size = ssize_t;
using f32 = float;
using f64 = double;
template<glm::length_t L, typename T>
using vec = glm::vec<L, T, glm::packed_highp>;
using vec2 = vec<2, f32>;
using vec3 = vec<3, f32>;
using vec4 = vec<4, f32>;
template<glm::length_t C, glm::length_t R, typename T>
using mat = glm::mat<C, R, T, glm::packed_highp>;
using mat3 = mat<4, 4, f32>;
using mat4 = mat<4, 4, f32>;
template<typename T>
using optional = std::optional<T>;
template<typename T, std::size_t Count>
using array = std::array<T, Count>;
template<typename T>
using vector = std::vector<T>;
template<class T, std::size_t Extent = std::dynamic_extent>
using array_view = std::span<T, Extent>;
template<typename... Ts>
using structure = std::tuple<Ts...>;
using string_view = std::string_view;
using vertex_index = u32;
using index_triangle = array<vertex_index, 3>;
template<int ID>
using identifier = ztu::id_type<u32, ID>;
}