3 #include "forwarddecl/Tex.hpp"
5 #include "forwarddecl/Ren.hpp"
11 enum class TextureType {
14 namespace textureType::unsafe {
15 constexpr TextureType fromSDLEnum(
const int a) noexcept {
16 if (a == SDL_TEXTUREACCESS_STATIC)
17 return TextureType::Static;
18 if (a == SDL_TEXTUREACCESS_STREAMING)
19 return TextureType::Lock;
21 return TextureType::Ren;
23 constexpr
int toSDLEnum(
const TextureType a) noexcept {
24 if (a == TextureType::Static)
25 return SDL_TEXTUREACCESS_STATIC;
26 if (a == TextureType::Lock)
27 return SDL_TEXTUREACCESS_STREAMING;
29 return SDL_TEXTUREACCESS_TARGET;
44 Tex(
const Tex& that) =
delete;
47 Tex& operator=(
const Tex& that) =
delete;
48 Tex& operator=(
Tex&& that) noexcept;
50 friend void swap(
Tex& a,
Tex& b) noexcept;
55 uint8_t getAlphaMod();
56 void setAlphaMod(
const uint8_t i);
59 void setRGBMod(
const RGB i);
63 SDL_Texture* unsafeRaw() noexcept;
64 const SDL_Texture* unsafeRaw()
const noexcept;
82 pixelfmt::Id format()
const noexcept;
114 uint32_t& unsafePoint(
const geom::Pos p) noexcept;
115 const uint32_t& unsafePoint(
const geom::Pos p)
const noexcept;
117 void* unsafeRaw() noexcept;
118 const void* unsafeRaw()
const noexcept;