74 lines
1.4 KiB
C++
74 lines
1.4 KiB
C++
#pragma once
|
|
#ifndef REAL_BUILD
|
|
# include "externals.hh"
|
|
#endif
|
|
|
|
|
|
enum class E_TexType {
|
|
RGBA8 ,
|
|
RGBA16F ,
|
|
RGB8 ,
|
|
RGB16F ,
|
|
R8 ,
|
|
R16F ,
|
|
};
|
|
|
|
enum class E_TexSampling {
|
|
NEAREST ,
|
|
LINEAR ,
|
|
};
|
|
|
|
enum class E_TexWrap {
|
|
REPEAT ,
|
|
CLAMP_EDGE ,
|
|
CLAMP_BORDER
|
|
};
|
|
|
|
struct T_Texture
|
|
{
|
|
T_Texture( ) = delete;
|
|
T_Texture( T_Texture const& ) = delete;
|
|
T_Texture( T_Texture&& ) = delete;
|
|
|
|
T_Texture(
|
|
__rd__ const uint32_t width ,
|
|
__rd__ const uint32_t height ,
|
|
__rd__ const E_TexType type ,
|
|
__rd__ const uint32_t levels = 1 );
|
|
~T_Texture( );
|
|
|
|
T_Texture& samplingMode(
|
|
__rd__ const E_TexSampling mode );
|
|
T_Texture& wrap(
|
|
__rd__ const E_TexWrap mode );
|
|
|
|
GLuint id( ) const noexcept { return id_; }
|
|
uint32_t levels( ) const noexcept { return levels_; }
|
|
uint32_t width( ) const noexcept { return width_; }
|
|
uint32_t height( ) const noexcept { return height_; }
|
|
|
|
private:
|
|
GLuint id_;
|
|
uint32_t levels_ , width_ , height_;
|
|
};
|
|
|
|
struct T_TextureBinding
|
|
{
|
|
T_TextureBinding( ) = delete;
|
|
T_TextureBinding( T_TextureBinding const& ) = delete;
|
|
T_TextureBinding( T_TextureBinding&& ) = delete;
|
|
|
|
explicit T_TextureBinding(
|
|
__rd__ const uint32_t binding );
|
|
|
|
void clear( );
|
|
void set( __rd__ const uint32_t uniform ,
|
|
__rd__ T_Texture const& texture );
|
|
|
|
void bind( ) const;
|
|
|
|
private:
|
|
const uint32_t binding_;
|
|
uint32_t uniform_;
|
|
T_Texture const* texture_;
|
|
};
|