blob: 4e3f23128423696dcd76484390c33b69e8d97523 [file] [log] [blame]
Jamie Madilldc356042013-07-19 16:36:57 -04001#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 Madilla85f6f12013-07-19 16:36:59 -040012#include "libGLESv2/angletypes.h"
Jamie Madilldc356042013-07-19 16:36:57 -040013
14namespace gl
15{
16
17Sampler::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 Madilla85f6f12013-07-19 16:36:59 -040031void 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 Madilldc356042013-07-19 16:36:57 -040042}