mirror of https://github.com/axmolengine/axmol.git
remove texture2d::setSamplerDescriptor
This commit is contained in:
parent
70b9031714
commit
fb87eec3f5
|
@ -707,21 +707,20 @@ void Texture2D::setAliasTexParameters()
|
|||
backend::SamplerAddressMode::DONT_CARE,
|
||||
backend::SamplerAddressMode::DONT_CARE
|
||||
);
|
||||
|
||||
setSamplerDescriptor(descriptor);
|
||||
_texture->updateSamplerDescriptor(descriptor);
|
||||
}
|
||||
|
||||
void Texture2D::setAntiAliasTexParameters()
|
||||
{
|
||||
|
||||
backend::SamplerDescriptor descriptor(false,
|
||||
backend::SamplerDescriptor descriptor(true,
|
||||
backend::SamplerFilter::LINEAR,
|
||||
backend::SamplerFilter::LINEAR,
|
||||
backend::SamplerFilter::LINEAR,
|
||||
backend::SamplerAddressMode::DONT_CARE,
|
||||
backend::SamplerAddressMode::DONT_CARE
|
||||
);
|
||||
setSamplerDescriptor(descriptor);
|
||||
_texture->updateSamplerDescriptor(descriptor);
|
||||
}
|
||||
|
||||
const char* Texture2D::getStringForFormat() const
|
||||
|
@ -909,12 +908,6 @@ Texture2D* Texture2D::getAlphaTexture() const
|
|||
return _alphaTexture;
|
||||
}
|
||||
|
||||
void Texture2D::setSamplerDescriptor(const backend::SamplerDescriptor &texParams)
|
||||
{
|
||||
_texture->updateSamplerDescriptor(texParams);
|
||||
}
|
||||
|
||||
//TODO: should be reform later
|
||||
void Texture2D::setTexParameters(const Texture2D::TexParams ¶ms)
|
||||
{
|
||||
backend::SamplerDescriptor sd;
|
||||
|
@ -924,7 +917,7 @@ void Texture2D::setTexParameters(const Texture2D::TexParams ¶ms)
|
|||
sd.magFilter = params.magFilter;
|
||||
sd.sAddressMode = params.wrapS;
|
||||
sd.tAddressMode = params.wrapT;
|
||||
setSamplerDescriptor(sd);
|
||||
_texture->updateSamplerDescriptor(sd);
|
||||
}
|
||||
|
||||
// TODO coulsonwang
|
||||
|
|
|
@ -160,6 +160,8 @@ public:
|
|||
backend::SamplerFilter magFilter;
|
||||
backend::SamplerAddressMode wrapS;
|
||||
backend::SamplerAddressMode wrapT;
|
||||
bool mipmapEnabled = true;
|
||||
backend::SamplerFilter mipmapFilter = backend::SamplerFilter::LINEAR;
|
||||
}TexParams;
|
||||
|
||||
public:
|
||||
|
@ -300,9 +302,6 @@ public:
|
|||
//TODO: minggo: is it resaonable?
|
||||
bool initWithBackendTexture(backend::Texture* texture);
|
||||
|
||||
/** Set sampler properties
|
||||
*/
|
||||
void setSamplerDescriptor(const backend::SamplerDescriptor& texParams);
|
||||
|
||||
void setTexParameters(const TexParams ¶ms);
|
||||
|
||||
|
|
Loading…
Reference in New Issue