GPUTexture: Add type correct GPU_SAMPLER_MAX constant for C++

This avoid having to cast when using it in `.cc` and `.hh` files.
This commit is contained in:
Clément Foucault
2022-08-30 22:05:34 +02:00
parent 36e74cc4f7
commit f5ea2a6434

View File

@@ -49,7 +49,12 @@ typedef enum eGPUSamplerState {
* #GPU_SAMPLER_MAX is not a valid enum value, but only a limit.
* It also creates a bad mask for the `NOT` operator in #ENUM_OPERATORS.
*/
#ifdef __cplusplus
static constexpr eGPUSamplerState GPU_SAMPLER_MAX = eGPUSamplerState(GPU_SAMPLER_ICON + 1);
#else
static const int GPU_SAMPLER_MAX = (GPU_SAMPLER_ICON + 1);
#endif
ENUM_OPERATORS(eGPUSamplerState, GPU_SAMPLER_ICON)
#ifdef __cplusplus