41 gl46core::glCreateSamplers(1, &samplerID);
42 gl46core::glSamplerParameterf(samplerID, gl46core::GL_TEXTURE_LOD_BIAS, descriptor.
_lod.
_bias);
43 gl46core::glSamplerParameterf(samplerID, gl46core::GL_TEXTURE_MIN_LOD, descriptor.
_lod.
_min);
44 gl46core::glSamplerParameterf(samplerID, gl46core::GL_TEXTURE_MAX_LOD, descriptor.
_lod.
_max);
45 gl46core::glSamplerParameteri(samplerID, gl46core::GL_TEXTURE_MIN_FILTER, getMinFilterMode(descriptor.
_minFilter, descriptor.
_mipSampling));
46 gl46core::glSamplerParameteri(samplerID, gl46core::GL_TEXTURE_MAG_FILTER, getMagFilterMode(descriptor.
_magFilter));
51 constexpr gl46core::GLint black_transparent_int[] = { 0, 0, 0, 0 };
52 constexpr gl46core::GLint black_opaque_int[] = { 0, 0, 0, 1 };
53 constexpr gl46core::GLint white_opaque_int[] = { 1, 1, 1, 1 };
54 constexpr gl46core::GLfloat black_transparent_float[] = { 0.f, 0.f, 0.f, 0.f };
55 constexpr gl46core::GLfloat black_opaque_float[] = { 0.f, 0.f, 0.f, 1.f };
56 constexpr gl46core::GLfloat white_opaque_float[] = { 1.f, 1.f, 1.f, 1.f };
69 gl46core::GLuint customColour[] =
76 gl46core::glSamplerParameterIuiv(samplerID, gl46core::GL_TEXTURE_BORDER_COLOR, customColour);
81 gl46core::glSamplerParameterfv(samplerID, gl46core::GL_TEXTURE_BORDER_COLOR, fColour.
_v);
88 gl46core::glSamplerParameteri(samplerID, gl46core::GL_TEXTURE_COMPARE_MODE,
to_base( gl46core::GL_COMPARE_REF_TO_TEXTURE));
92 gl46core::glSamplerParameteri(samplerID, gl46core::GL_TEXTURE_COMPARE_MODE,
to_base( gl46core::GL_NONE));
98 gl46core::glSamplerParameterf(samplerID, gl46core::GL_TEXTURE_MAX_ANISOTROPY, maxAnisotropy);
102 gl46core::glSamplerParameterf( samplerID, gl46core::GL_TEXTURE_MAX_ANISOTROPY, 1.f );
107 gl46core::glObjectLabel( gl46core::GL_SAMPLER,
120 gl46core::glDeleteSamplers(1, &handle);
static const DeviceInformation & GetDeviceInformation() noexcept
static void Destruct(gl46core::GLuint &handle)
static gl46core::GLuint Construct(const SamplerDescriptor &descriptor)
constexpr bool ENABLE_GPU_VALIDATION
Error callbacks, validations, buffer checks, etc. are controlled by this flag. Heavy performance impa...
std::array< gl46core::GLenum, to_base(TextureWrap::COUNT)> glWrapTable
std::array< gl46core::GLenum, to_base(ComparisonFunction::COUNT)> glCompareFuncTable
Str StringFormat(const char *fmt, Args &&...args)
FColour4 ToFloatColour(const UColour4 &byteColour) noexcept
gl46core::GLenum getMinFilterMode(const TextureFilter minFilter, const TextureMipSampling mipSampling)
gl46core::GLenum getMagFilterMode(const TextureFilter magFilter)
Handle console commands that start with a forward slash.
constexpr U32 to_U32(const T value)
constexpr F32 to_F32(const T value)
size_t GetHash(const PropertyDescriptor< T > &descriptor) noexcept
constexpr gl46core::GLuint GL_NULL_HANDLE
Invalid object value. Used to compare handles and determine if they were properly created.
@ COUNT
Place all properties above this.
constexpr auto to_base(const Type value) -> Type
TextureFilter _minFilter
Texture filtering mode.
TextureWrap _wrapU
Texture wrap mode (Or S-R-T)
U8 _anisotropyLevel
The value must be in the range [0...255] and is automatically clamped by the max HW supported level.
ComparisonFunction _depthCompareFunc
Used for depth comparison (COUNT = disabled)
TextureBorderColour _borderColour
Used with CLAMP_TO_BORDER as the background colour outside of the texture border.
TextureMipSampling _mipSampling
UColour4 _customBorderColour
Used with custom border colours.
F32 _min
OpenGL eg: used by TEXTURE_MIN_LOD and TEXTURE_MAX_LOD.
F32 _bias
OpenGL eg: used by TEXTURE_LOD_BIAS.