X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fsampler.h;h=bd8db31fdc8f9601f5ac2ac55e9762cead38fef4;hb=3bc34893905a2df622894aadcb6669f27f186772;hp=43d1e5412a2fe3df0bb732ac42bc6b1344e1b003;hpb=6065f6622cc275dc0b20baaf7c267e71169d18f3;p=libs%2Fgl.git diff --git a/source/core/sampler.h b/source/core/sampler.h index 43d1e541..bd8db31f 100644 --- a/source/core/sampler.h +++ b/source/core/sampler.h @@ -3,8 +3,8 @@ #include #include "color.h" -#include "gl.h" #include "predicate.h" +#include "sampler_backend.h" namespace Msp { namespace GL { @@ -12,38 +12,38 @@ namespace GL { enum TextureFilter { /// No filtering - NEAREST = GL_NEAREST, + NEAREST, /// Bilinear filtering - LINEAR = GL_LINEAR, + LINEAR, /// Mipmapping without filtering - NEAREST_MIPMAP_NEAREST = GL_NEAREST_MIPMAP_NEAREST, + NEAREST_MIPMAP_NEAREST, /// Linear filtering between two mipmap levels - NEAREST_MIPMAP_LINEAR = GL_NEAREST_MIPMAP_LINEAR, + NEAREST_MIPMAP_LINEAR, /// Bilinear filtering on the closest mipmap level - LINEAR_MIPMAP_NEAREST = GL_LINEAR_MIPMAP_NEAREST, + LINEAR_MIPMAP_NEAREST, /// Trilinear filtering between two mipmap levels - LINEAR_MIPMAP_LINEAR = GL_LINEAR_MIPMAP_LINEAR + LINEAR_MIPMAP_LINEAR }; enum TextureWrap { /// Tile the texture infinitely - REPEAT = GL_REPEAT, + REPEAT, /// Extend the texels at the edge of the texture to infinity - CLAMP_TO_EDGE = GL_CLAMP_TO_EDGE, + CLAMP_TO_EDGE, /// Sampling outside the texture will return border color - CLAMP_TO_BORDER = GL_CLAMP_TO_BORDER, + CLAMP_TO_BORDER, /// Tile the texture, with every other repetition mirrored - MIRRORED_REPEAT = GL_MIRRORED_REPEAT + MIRRORED_REPEAT }; @@ -61,8 +61,10 @@ for magnification and NEAREST_MIPMAP_LINEAR for minification. If texture coordinates fall outside of the principal range of the texture, wrapping is applied. The default for all directions is REPEAT. */ -class Sampler +class Sampler: public SamplerBackend { + friend SamplerBackend; + public: class Loader: public DataFile::ObjectLoader { @@ -96,7 +98,6 @@ private: COMPARE = 128 }; - unsigned id; TextureFilter min_filter; TextureFilter mag_filter; float max_anisotropy; @@ -152,9 +153,7 @@ public: void refresh() const { if(dirty_params) update(); } - unsigned get_id() const { return id; } - - void set_debug_name(const std::string &); + using SamplerBackend::set_debug_name; };