summaryrefslogtreecommitdiff
path: root/config/types.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-01-01 17:56:26 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2024-01-01 17:56:26 +0000
commitd5cdbbf38380239524e351cb69aec94090884ca5 (patch)
tree5d7dff2f2775701069806eceb4eaef23b22eba3f /config/types.h
parentReformat with new clang-format (diff)
parentRemove more use of legacy types (diff)
downloadilt-d5cdbbf38380239524e351cb69aec94090884ca5.tar.bz2
ilt-d5cdbbf38380239524e351cb69aec94090884ca5.tar.xz
ilt-d5cdbbf38380239524e351cb69aec94090884ca5.zip
Merge remote-tracking branch 'origin/terrain'
Diffstat (limited to 'config/types.h')
-rw-r--r--config/types.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/config/types.h b/config/types.h
new file mode 100644
index 0000000..aff0390
--- /dev/null
+++ b/config/types.h
@@ -0,0 +1,53 @@
+#pragma once
+
+#include "glad/gl.h"
+#include <glm/geometric.hpp>
+
+using Distance = float; // deprecate
+using RelativeDistance = float;
+using GlobalDistance = int32_t;
+using CalcDistance = int64_t;
+using Angle = float;
+
+template<glm::length_t D> using Position = glm::vec<D, Distance>; // deprecate
+template<glm::length_t D> using RelativePosition = glm::vec<D, RelativeDistance>;
+template<glm::length_t D> using GlobalPosition = glm::vec<D, GlobalDistance>;
+template<glm::length_t D> using CalcPosition = glm::vec<D, CalcDistance>;
+template<glm::length_t D> using Size = glm::vec<D, Distance>;
+template<glm::length_t D> using Scale = glm::vec<D, float>;
+template<glm::length_t D> using Direction = glm::vec<D, float>;
+template<glm::length_t D> using Normal = Direction<D>;
+template<glm::length_t D> using Rotation = glm::vec<D, Angle>;
+template<glm::length_t Channels> using Colour = glm::vec<Channels, float>;
+
+using Position2D = Position<2>; // deprecate
+using Position3D = Position<3>; // deprecate
+using BaryPosition = glm::vec<2, float>;
+using RelativePosition2D = RelativePosition<2>;
+using RelativePosition3D = RelativePosition<3>;
+using RelativePosition4D = RelativePosition<4>;
+using GlobalPosition2D = GlobalPosition<2>;
+using GlobalPosition3D = GlobalPosition<3>;
+using GlobalPosition4D = GlobalPosition<4>;
+using CalcPosition2D = CalcPosition<2>;
+using CalcPosition3D = CalcPosition<3>;
+using CalcPosition4D = CalcPosition<4>;
+using Size2D = Size<2>;
+using Size3D = Size<3>;
+using Scale2D = Scale<2>;
+using Scale3D = Scale<3>;
+using Direction2D = Direction<2>;
+using Direction3D = Direction<3>;
+using Normal2D = Normal<2>;
+using Normal3D = Normal<3>;
+using Rotation2D = Rotation<2>;
+using Rotation3D = Rotation<3>;
+using TextureRelCoord = glm::vec<2, float>;
+using TextureRelRegion = glm::vec<4, float>;
+using TextureAbsCoord = glm::vec<2, GLsizei>;
+using TextureAbsRegion = glm::vec<4, GLsizei>;
+using RGB = Colour<3>;
+using RGBA = Colour<4>;
+using ScreenRelCoord = glm::vec<2, float>;
+using ScreenAbsCoord = glm::vec<2, uint16_t>;
+using ViewPort = glm::vec<4, GLsizei>;