From 3a3d93c7db96c7d4a1ff4785755c4c16599b1e92 Mon Sep 17 00:00:00 2001 From: lisyarus Date: Wed, 30 Sep 2020 16:21:16 +0300 Subject: [PATCH] Add signed & two-component pixel traits --- libs/gfx/include/psemek/gfx/texture.hpp | 40 +++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/libs/gfx/include/psemek/gfx/texture.hpp b/libs/gfx/include/psemek/gfx/texture.hpp index 411bf6a3..80b9ad7e 100644 --- a/libs/gfx/include/psemek/gfx/texture.hpp +++ b/libs/gfx/include/psemek/gfx/texture.hpp @@ -18,6 +18,14 @@ namespace psemek::gfx static constexpr GLenum type = gl::UNSIGNED_BYTE; }; + template <> + struct pixel_traits> + { + static constexpr GLenum internal_format = gl::RG8; + static constexpr GLenum format = gl::RG; + static constexpr GLenum type = gl::UNSIGNED_BYTE; + }; + template <> struct pixel_traits> { @@ -34,6 +42,38 @@ namespace psemek::gfx static constexpr GLenum type = gl::UNSIGNED_BYTE; }; + template <> + struct pixel_traits + { + static constexpr GLenum internal_format = gl::R8; + static constexpr GLenum format = gl::RED; + static constexpr GLenum type = gl::BYTE; + }; + + template <> + struct pixel_traits> + { + static constexpr GLenum internal_format = gl::RG8; + static constexpr GLenum format = gl::RG; + static constexpr GLenum type = gl::BYTE; + }; + + template <> + struct pixel_traits> + { + static constexpr GLenum internal_format = gl::RGB8; + static constexpr GLenum format = gl::RGB; + static constexpr GLenum type = gl::BYTE; + }; + + template <> + struct pixel_traits> + { + static constexpr GLenum internal_format = gl::RGBA8; + static constexpr GLenum format = gl::RGBA; + static constexpr GLenum type = gl::BYTE; + }; + template <> struct pixel_traits {