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 setMinFilter(GLenum minFilter)24 void setMinFilter(GLenum minFilter) { mMinFilter = minFilter; } setMagFilter(GLenum magFilter)25 void setMagFilter(GLenum magFilter) { mMagFilter = magFilter; } setWrapS(GLenum wrapS)26 void setWrapS(GLenum wrapS) { mWrapS = wrapS; } setWrapT(GLenum wrapT)27 void setWrapT(GLenum wrapT) { mWrapT = wrapT; } setWrapR(GLenum wrapR)28 void setWrapR(GLenum wrapR) { mWrapR = wrapR; } setMinLod(GLfloat minLod)29 void setMinLod(GLfloat minLod) { mMinLod = minLod; } setMaxLod(GLfloat maxLod)30 void setMaxLod(GLfloat maxLod) { mMaxLod = maxLod; } setComparisonMode(GLenum comparisonMode)31 void setComparisonMode(GLenum comparisonMode) { mComparisonMode = comparisonMode; } setComparisonFunc(GLenum comparisonFunc)32 void setComparisonFunc(GLenum comparisonFunc) { mComparisonFunc = comparisonFunc; } 33 getMinFilter()34 GLenum getMinFilter() const { return mMinFilter; } getMagFilter()35 GLenum getMagFilter() const { return mMagFilter; } getWrapS()36 GLenum getWrapS() const { return mWrapS; } getWrapT()37 GLenum getWrapT() const { return mWrapT; } getWrapR()38 GLenum getWrapR() const { return mWrapR; } getMinLod()39 GLfloat getMinLod() const { return mMinLod; } getMaxLod()40 GLfloat getMaxLod() const { return mMaxLod; } getComparisonMode()41 GLenum getComparisonMode() const { return mComparisonMode; } getComparisonFunc()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