Home | History | Annotate | Download | only in libGLESv2
      1 #include "precompiled.h"
      2 //
      3 // Copyright (c) 2013 The ANGLE Project Authors. All rights reserved.
      4 // Use of this source code is governed by a BSD-style license that can be
      5 // found in the LICENSE file.
      6 //
      7 
      8 // Sampler.cpp : Implements the Sampler class, which represents a GLES 3
      9 // sampler object. Sampler objects store some state needed to sample textures.
     10 
     11 #include "libGLESv2/Sampler.h"
     12 #include "libGLESv2/angletypes.h"
     13 
     14 namespace gl
     15 {
     16 
     17 Sampler::Sampler(GLuint id)
     18     : RefCountObject(id),
     19       mMinFilter(GL_NEAREST_MIPMAP_LINEAR),
     20       mMagFilter(GL_LINEAR),
     21       mWrapS(GL_REPEAT),
     22       mWrapT(GL_REPEAT),
     23       mWrapR(GL_REPEAT),
     24       mMinLod(-1000.0f),
     25       mMaxLod(1000.0f),
     26       mComparisonMode(GL_NONE),
     27       mComparisonFunc(GL_LEQUAL)
     28 {
     29 }
     30 
     31 void Sampler::getState(SamplerState *samplerState) const
     32 {
     33     samplerState->minFilter   = mMinFilter;
     34     samplerState->magFilter   = mMagFilter;
     35     samplerState->wrapS       = mWrapS;
     36     samplerState->wrapT       = mWrapT;
     37     samplerState->wrapR       = mWrapR;
     38     samplerState->minLod      = mMinLod;
     39     samplerState->maxLod      = mMaxLod;
     40     samplerState->compareMode = mComparisonMode;
     41     samplerState->compareFunc = mComparisonFunc;
     42 }
     43 
     44 }
     45