• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.cpp : Implements the Sampler class, which represents a GLES 3
8 // sampler object. Sampler objects store some state needed to sample textures.
9 
10 #include "libGLESv2/Sampler.h"
11 #include "libGLESv2/angletypes.h"
12 
13 namespace gl
14 {
15 
Sampler(GLuint id)16 Sampler::Sampler(GLuint id)
17     : RefCountObject(id),
18       mMinFilter(GL_NEAREST_MIPMAP_LINEAR),
19       mMagFilter(GL_LINEAR),
20       mWrapS(GL_REPEAT),
21       mWrapT(GL_REPEAT),
22       mWrapR(GL_REPEAT),
23       mMinLod(-1000.0f),
24       mMaxLod(1000.0f),
25       mComparisonMode(GL_NONE),
26       mComparisonFunc(GL_LEQUAL)
27 {
28 }
29 
getState(SamplerState * samplerState) const30 void Sampler::getState(SamplerState *samplerState) const
31 {
32     samplerState->minFilter   = mMinFilter;
33     samplerState->magFilter   = mMagFilter;
34     samplerState->wrapS       = mWrapS;
35     samplerState->wrapT       = mWrapT;
36     samplerState->wrapR       = mWrapR;
37     samplerState->minLod      = mMinLod;
38     samplerState->maxLod      = mMaxLod;
39     samplerState->compareMode = mComparisonMode;
40     samplerState->compareFunc = mComparisonFunc;
41 }
42 
43 }
44