Add depth & depth-stencil pixel formats
This commit is contained in:
parent
2898e2a2c3
commit
c9ee47a79b
1 changed files with 27 additions and 0 deletions
|
|
@ -6,6 +6,17 @@
|
|||
namespace psemek::gfx
|
||||
{
|
||||
|
||||
struct depth24_pixel
|
||||
{
|
||||
std::uint8_t depth[3];
|
||||
};
|
||||
|
||||
struct depth24_stencil8_pixel
|
||||
{
|
||||
std::uint8_t depth[3];
|
||||
std::uint8_t stencil;
|
||||
};
|
||||
|
||||
template <typename Pixel>
|
||||
struct pixel_traits;
|
||||
|
||||
|
|
@ -81,4 +92,20 @@ namespace psemek::gfx
|
|||
static constexpr GLenum type = gl::FLOAT;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct pixel_traits<depth24_pixel>
|
||||
{
|
||||
static constexpr GLenum internal_format = gl::DEPTH_COMPONENT24;
|
||||
static constexpr GLenum format = gl::DEPTH_COMPONENT;
|
||||
static constexpr GLenum type = gl::UNSIGNED_BYTE;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct pixel_traits<depth24_stencil8_pixel>
|
||||
{
|
||||
static constexpr GLenum internal_format = gl::DEPTH24_STENCIL8;
|
||||
static constexpr GLenum format = gl::DEPTH_STENCIL;
|
||||
static constexpr GLenum type = gl::UNSIGNED_BYTE;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue