28 : auto_mipmapping_enabled_(kAutoMipmappingChanged, false, this),
29 max_anisotropy_(kMaxAnisotropyChanged, 1.f, 1.f, 32.f, this),
30 min_lod_(kMinLodChanged, -1000.f, this),
31 max_lod_(kMaxLodChanged, 1000.f, this),
33 kCompareFunctionChanged, kLess, kAlways, kNotEqual, this),
34 compare_mode_(kCompareModeChanged, kNone, kCompareToTexture, kNone, this),
35 min_filter_(kMinFilterChanged, kNearest, kNearest, kLinearMipmapLinear,
37 mag_filter_(kMagFilterChanged, kNearest, kNearest, kLinear, this),
38 wrap_r_(kWrapRChanged, kRepeat, kClampToEdge, kMirroredRepeat, this),
39 wrap_s_(kWrapSChanged, kRepeat, kClampToEdge, kMirroredRepeat, this),
40 wrap_t_(kWrapTChanged, kRepeat, kClampToEdge, kMirroredRepeat, this) {}
52 template <> ION_API
const EnumHelper::EnumData<Sampler::CompareFunction>
53 EnumHelper::GetEnumData() {
54 static const GLenum kValues[] = {
55 GL_ALWAYS, GL_EQUAL, GL_GREATER, GL_GEQUAL, GL_LESS, GL_LEQUAL, GL_NEVER,
58 static const char* kStrings[] = {
59 "Always",
"Equal",
"Greater",
"GreaterOrEqual",
"Less",
"LessOrEqual",
63 "EnumHelper size mismatch");
64 return EnumData<Sampler::CompareFunction>(
71 template <> ION_API
const EnumHelper::EnumData<Sampler::CompareMode>
72 EnumHelper::GetEnumData() {
73 static const GLenum kValues[] = { GL_COMPARE_REF_TO_TEXTURE, GL_NONE };
74 static const char* kStrings[] = {
"CompareToTexture",
"None" };
76 "EnumHelper size mismatch");
77 return EnumData<Sampler::CompareMode>(
83 template <> ION_API
const EnumHelper::EnumData<Sampler::FilterMode>
84 EnumHelper::GetEnumData() {
85 static const GLenum kValues[] = {
86 GL_NEAREST, GL_LINEAR, GL_NEAREST_MIPMAP_NEAREST, GL_NEAREST_MIPMAP_LINEAR,
87 GL_LINEAR_MIPMAP_NEAREST, GL_LINEAR_MIPMAP_LINEAR
89 static const char* kStrings[] = {
90 "Nearest",
"Linear",
"NearestMipmapNearest",
"NearestMipmapLinear",
91 "LinearMipmapNearest",
"LinearMipmapLinear"
94 "EnumHelper size mismatch");
95 return EnumData<Sampler::FilterMode>(
101 template <> ION_API
const EnumHelper::EnumData<Sampler::WrapMode>
102 EnumHelper::GetEnumData() {
103 static const GLenum kValues[] = {
104 GL_CLAMP_TO_EDGE, GL_REPEAT, GL_MIRRORED_REPEAT
106 static const char* kStrings[] = {
"ClampToEdge",
"Repeat",
"MirroredRepeat" };
108 "EnumHelper size mismatch");
109 return EnumData<Sampler::WrapMode>(
This template class can be used to map between two kinds of indices when the following assumptions ap...
~Sampler() override
The destructor is protected because all base::Referent classes must have protected or private destruc...
#define ION_STATIC_ASSERT(expr, message)
Copyright 2016 Google Inc.
A Sampler object represents texture parameters that control how texture data is accessed in shaders...