2019-09-16 20:56:48 +00:00
|
|
|
#ifndef __GL_SAMPLERS_H
|
|
|
|
#define __GL_SAMPLERS_H
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
enum ESampler
|
|
|
|
{
|
2019-09-16 21:28:26 +00:00
|
|
|
NoSampler = -1,
|
2019-09-16 20:56:48 +00:00
|
|
|
SamplerRepeat,
|
|
|
|
SamplerClampX,
|
|
|
|
SamplerClampY,
|
|
|
|
SamplerClampXY,
|
2019-10-19 17:10:09 +00:00
|
|
|
SamplerNoFilterRepeat,
|
|
|
|
SamplerNoFilterClampX,
|
|
|
|
SamplerNoFilterClampY,
|
|
|
|
SamplerNoFilterClampXY,
|
|
|
|
Sampler2DFiltered, // Currently unused shpuld be used for 2D content
|
2019-09-16 20:56:48 +00:00
|
|
|
NumSamplers
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class FSamplerManager
|
|
|
|
{
|
|
|
|
// We need 6 different samplers: 4 for the different clamping modes,
|
|
|
|
// one for 2D-textures and one for voxel textures
|
|
|
|
unsigned int mSamplers[NumSamplers];
|
|
|
|
|
|
|
|
void UnbindAll();
|
2019-09-23 21:33:59 +00:00
|
|
|
void CreateSamplers();
|
2019-09-16 20:56:48 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
FSamplerManager();
|
|
|
|
~FSamplerManager();
|
|
|
|
|
|
|
|
uint8_t Bind(int texunit, int num, int lastval);
|
|
|
|
void SetTextureFilterMode(int mode, int aniso);
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|