diff options
| author | Jason Sams <rjsams@android.com> | 2009-05-28 15:37:57 -0700 |
|---|---|---|
| committer | Jason Sams <rjsams@android.com> | 2009-05-28 16:16:46 -0700 |
| commit | 39c8bc7be5751ec52693d21abdf139c4dfd29a2c (patch) | |
| tree | 225ec280da5d370bca986ce2f3d81b50e9a2e892 /rsSampler.cpp | |
| parent | 1ef8b80bc49f415b93912fe7335f852953bde4a4 (diff) | |
Add sampler support
Diffstat (limited to 'rsSampler.cpp')
| -rw-r--r-- | rsSampler.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/rsSampler.cpp b/rsSampler.cpp index 3c008c9d..ca407db4 100644 --- a/rsSampler.cpp +++ b/rsSampler.cpp @@ -53,7 +53,21 @@ Sampler::~Sampler() void Sampler::setupGL() { + GLenum translate[] = { + GL_NEAREST, //RS_SAMPLER_NEAREST, + GL_LINEAR, //RS_SAMPLER_LINEAR, + GL_LINEAR_MIP_LINEAR, //RS_SAMPLER_LINEAR_MIP_LINEAR, + GL_WRAP, //RS_SAMPLER_WRAP, + GL_CLAMP_TO_EDGS, //RS_SAMPLER_CLAMP + + } + + //LOGE("setup gl"); + switch(mMagFilter) { + case RS_SAMPLER_ + } + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); @@ -76,7 +90,7 @@ void Sampler::unbindFromContext(SamplerState *ss) void SamplerState::setupGL() { - for (uint32_t ct=0; ct < 1/*RS_MAX_SAMPLER_SLOT*/; ct++) { + for (uint32_t ct=0; ct < RS_MAX_SAMPLER_SLOT; ct++) { Sampler *s = mSamplers[ct].get(); if (s) { s->setupGL(); @@ -140,4 +154,12 @@ RsSampler rsi_SamplerCreate(Context *rsc) return s; } +void rsi_SamplerDestroy(Context *rsc, RsSampler vs) +{ + Sampler * s = static_cast<Sampler *>(vs); + s->decRef(); + +} + + }} |
