From c7a9730897a8cd7261e3a10d978b865899ab4e0c Mon Sep 17 00:00:00 2001 From: Metehan Tuncbilek Date: Thu, 8 Aug 2024 15:53:18 +0300 Subject: [PATCH] casting operators --- openVulkanoCpp/Math/RGB565.hpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/openVulkanoCpp/Math/RGB565.hpp b/openVulkanoCpp/Math/RGB565.hpp index 9077f5d..f496777 100644 --- a/openVulkanoCpp/Math/RGB565.hpp +++ b/openVulkanoCpp/Math/RGB565.hpp @@ -340,6 +340,20 @@ namespace OpenVulkano::Math bool operator==(const RGB565& other) const { return value == other.value; } bool operator!=(const RGB565& other) const { return value != other.value; } + + template || std::is_signed_v>> + operator Math::Vector4() { return Get4(); } + template || std::is_signed_v>> + operator Math::Vector3() { return Get3(); } + template || std::is_signed_v>> + operator Math::Vector4_SIMD() { return Get4SIMD(); } + template || std::is_signed_v>> + operator Math::Vector3_SIMD() { return Get3SIMD(); } + template>> + operator Math::Vector4() { return Get4Normalized(); } + template>> + operator Math::Vector3() { return Get3Normalized(); } + }; static_assert(sizeof(RGB565) == 2);