From d6e99a696aa582b81018078b68f6600c8030d643 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Tue, 7 Nov 2023 02:51:42 +0000 Subject: WIP typedefing all the things - headers --- config/types.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 config/types.h (limited to 'config') diff --git a/config/types.h b/config/types.h new file mode 100644 index 0000000..a84be90 --- /dev/null +++ b/config/types.h @@ -0,0 +1,34 @@ +#pragma once + +#include "glad/gl.h" +#include + +using Distance = float; +using Angle = float; + +template using Position = glm::vec; +template using Size = glm::vec; +template using Scale = glm::vec; +template using Direction = glm::vec; +template using Normal = Direction; +template using Rotation = glm::vec; +template using Colour = glm::vec; + +using Position2D = Position<2>; +using Position3D = Position<3>; +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 TextureAbsCoord = glm::vec<2, GLsizei>; +using RGB = Colour<3>; +using RGBA = Colour<4>; +using ScreenRelCoord = glm::vec<2, float>; +using ScreenAbsCoord = glm::vec<2, uint16_t>; -- cgit v1.2.3 From d771fbda2c171cfbc36cc0eb3122c1a02ffbb081 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 9 Nov 2023 01:57:27 +0000 Subject: WIP typedefing just about everything else --- config/types.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'config') diff --git a/config/types.h b/config/types.h index a84be90..d99735e 100644 --- a/config/types.h +++ b/config/types.h @@ -27,8 +27,11 @@ 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>; -- cgit v1.2.3 From 0aa665c3648d788755b00c9e431c872d57fddbb8 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 25 Nov 2023 16:28:39 +0000 Subject: Model positions as integers Introduces test failure in arcs due to rounding, but I don't want to create a complicated fix as link positions are still floats and hopefully that'll go away... somehow --- config/types.h | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'config') diff --git a/config/types.h b/config/types.h index d99735e..6fc7b61 100644 --- a/config/types.h +++ b/config/types.h @@ -3,10 +3,14 @@ #include "glad/gl.h" #include -using Distance = float; +using Distance = float; // deprecate +using RelativeDistance = float; +using GlobalDistance = int32_t; using Angle = float; -template using Position = glm::vec; +template using Position = glm::vec; // deprecate +template using RelativePosition = glm::vec; +template using GlobalPosition = glm::vec; template using Size = glm::vec; template using Scale = glm::vec; template using Direction = glm::vec; @@ -14,8 +18,15 @@ template using Normal = Direction; template using Rotation = glm::vec; template using Colour = glm::vec; -using Position2D = Position<2>; -using Position3D = Position<3>; +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 Size2D = Size<2>; using Size3D = Size<3>; using Scale2D = Scale<2>; -- cgit v1.2.3 From 442e226dbdfbe8f281f1f23805695ebb1a5fedc3 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 17 Dec 2023 18:55:26 +0000 Subject: Add 64bit integer types for calculations --- config/types.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'config') diff --git a/config/types.h b/config/types.h index 6fc7b61..aff0390 100644 --- a/config/types.h +++ b/config/types.h @@ -6,11 +6,13 @@ using Distance = float; // deprecate using RelativeDistance = float; using GlobalDistance = int32_t; +using CalcDistance = int64_t; using Angle = float; template using Position = glm::vec; // deprecate template using RelativePosition = glm::vec; template using GlobalPosition = glm::vec; +template using CalcPosition = glm::vec; template using Size = glm::vec; template using Scale = glm::vec; template using Direction = glm::vec; @@ -27,6 +29,9 @@ 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>; -- cgit v1.2.3