diff options
| author | 2009-05-28 15:37:57 -0700 | |
|---|---|---|
| committer | 2009-05-28 16:16:46 -0700 | |
| commit | 02fb2cb531035779a25dbf9595e0628ea40585b0 (patch) | |
| tree | c8151779dd70e8242412a327add168a0e5444a4e /libs/rs/rsSampler.cpp | |
| parent | 206b83190708738552be7760acfeefa1143555b5 (diff) | |
Add sampler support
Diffstat (limited to 'libs/rs/rsSampler.cpp')
| -rw-r--r-- | libs/rs/rsSampler.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/libs/rs/rsSampler.cpp b/libs/rs/rsSampler.cpp index 3c008c9de8cc..ca407db40381 100644 --- a/libs/rs/rsSampler.cpp +++ b/libs/rs/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(); + +} + + }} |