mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 04:53:36 +00:00
To expand with full Organic Maps and Maps.ME commits history run: git remote add om-historic [om-historic.git repo url] git fetch --tags om-historic git replace squashed-history historic-commits
62 lines
1.1 KiB
C++
62 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include "base/assert.hpp"
|
|
|
|
#include <cstdint>
|
|
|
|
namespace dp
|
|
{
|
|
enum class TextureFormat : uint8_t
|
|
{
|
|
RGBA8,
|
|
Alpha,
|
|
RedGreen,
|
|
DepthStencil,
|
|
Depth,
|
|
Unspecified
|
|
};
|
|
|
|
inline std::string DebugPrint(TextureFormat tf)
|
|
{
|
|
switch (tf)
|
|
{
|
|
case TextureFormat::RGBA8: return "RGBA8";
|
|
case TextureFormat::Alpha: return "Alpha";
|
|
case TextureFormat::RedGreen: return "RedGreen";
|
|
case TextureFormat::DepthStencil: return "DepthStencil";
|
|
case TextureFormat::Depth: return "Depth";
|
|
case TextureFormat::Unspecified: return "Unspecified";
|
|
}
|
|
|
|
UNREACHABLE();
|
|
return {};
|
|
}
|
|
|
|
enum class TextureFilter : uint8_t
|
|
{
|
|
Nearest,
|
|
Linear
|
|
};
|
|
|
|
enum class TextureWrapping : uint8_t
|
|
{
|
|
ClampToEdge,
|
|
Repeat
|
|
};
|
|
|
|
inline uint8_t GetBytesPerPixel(TextureFormat format)
|
|
{
|
|
uint8_t result = 0;
|
|
switch (format)
|
|
{
|
|
case TextureFormat::RGBA8: result = 4; break;
|
|
case TextureFormat::Alpha: result = 1; break;
|
|
case TextureFormat::RedGreen: result = 2; break;
|
|
case TextureFormat::DepthStencil: result = 4; break;
|
|
case TextureFormat::Depth: result = 4; break;
|
|
default: ASSERT(false, ()); break;
|
|
}
|
|
return result;
|
|
}
|
|
} // namespace dp
|