Jamie Madill | dc35604 | 2013-07-19 16:36:57 -0400 | [diff] [blame] | 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" |
Jamie Madill | a85f6f1 | 2013-07-19 16:36:59 -0400 | [diff] [blame^] | 12 | #include "libGLESv2/angletypes.h" |
Jamie Madill | dc35604 | 2013-07-19 16:36:57 -0400 | [diff] [blame] | 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 | |
Jamie Madill | a85f6f1 | 2013-07-19 16:36:59 -0400 | [diff] [blame^] | 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 | |
| 39 | // TODO: comparison mode/func, min/max LOD |
| 40 | } |
| 41 | |
Jamie Madill | dc35604 | 2013-07-19 16:36:57 -0400 | [diff] [blame] | 42 | } |