1 // 2 // Copyright (c) 2013 The ANGLE Project Authors. All rights reserved. 3 // Use of this source code is governed by a BSD-style license that can be 4 // found in the LICENSE file. 5 // 6 7 // Sampler.h : Defines the Sampler class, which represents a GLES 3 8 // sampler object. Sampler objects store some state needed to sample textures. 9 10 #ifndef LIBGLESV2_SAMPLER_H_ 11 #define LIBGLESV2_SAMPLER_H_ 12 13 #include "common/RefCountObject.h" 14 15 namespace gl 16 { 17 struct SamplerState; 18 19 class Sampler : public RefCountObject 20 { 21 public: 22 Sampler(GLuint id); 23 24 void setMinFilter(GLenum minFilter) { mMinFilter = minFilter; } 25 void setMagFilter(GLenum magFilter) { mMagFilter = magFilter; } 26 void setWrapS(GLenum wrapS) { mWrapS = wrapS; } 27 void setWrapT(GLenum wrapT) { mWrapT = wrapT; } 28 void setWrapR(GLenum wrapR) { mWrapR = wrapR; } 29 void setMinLod(GLfloat minLod) { mMinLod = minLod; } 30 void setMaxLod(GLfloat maxLod) { mMaxLod = maxLod; } 31 void setComparisonMode(GLenum comparisonMode) { mComparisonMode = comparisonMode; } 32 void setComparisonFunc(GLenum comparisonFunc) { mComparisonFunc = comparisonFunc; } 33 34 GLenum getMinFilter() const { return mMinFilter; } 35 GLenum getMagFilter() const { return mMagFilter; } 36 GLenum getWrapS() const { return mWrapS; } 37 GLenum getWrapT() const { return mWrapT; } 38 GLenum getWrapR() const { return mWrapR; } 39 GLfloat getMinLod() const { return mMinLod; } 40 GLfloat getMaxLod() const { return mMaxLod; } 41 GLenum getComparisonMode() const { return mComparisonMode; } 42 GLenum getComparisonFunc() const { return mComparisonFunc; } 43 44 void getState(SamplerState *samplerState) const; 45 46 private: 47 GLenum mMinFilter; 48 GLenum mMagFilter; 49 GLenum mWrapS; 50 GLenum mWrapT; 51 GLenum mWrapR; 52 GLfloat mMinLod; 53 GLfloat mMaxLod; 54 GLenum mComparisonMode; 55 GLenum mComparisonFunc; 56 }; 57 58 } 59 60 #endif // LIBGLESV2_SAMPLER_H_ 61