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,
|
||||||
backend::SamplerAddressMode::DONT_CARE
|
backend::SamplerAddressMode::DONT_CARE
|
||||||
);
|
);
|
||||||
|
_texture->updateSamplerDescriptor(descriptor);
|
||||||
setSamplerDescriptor(descriptor);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Texture2D::setAntiAliasTexParameters()
|
void Texture2D::setAntiAliasTexParameters()
|
||||||
{
|
{
|
||||||
|
|
||||||
backend::SamplerDescriptor descriptor(false,
|
backend::SamplerDescriptor descriptor(true,
|
||||||
backend::SamplerFilter::LINEAR,
|
backend::SamplerFilter::LINEAR,
|
||||||
backend::SamplerFilter::LINEAR,
|
backend::SamplerFilter::LINEAR,
|
||||||
backend::SamplerFilter::LINEAR,
|
backend::SamplerFilter::LINEAR,
|
||||||
backend::SamplerAddressMode::DONT_CARE,
|
backend::SamplerAddressMode::DONT_CARE,
|
||||||
backend::SamplerAddressMode::DONT_CARE
|
backend::SamplerAddressMode::DONT_CARE
|
||||||
);
|
);
|
||||||
setSamplerDescriptor(descriptor);
|
_texture->updateSamplerDescriptor(descriptor);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* Texture2D::getStringForFormat() const
|
const char* Texture2D::getStringForFormat() const
|
||||||
|
@ -909,12 +908,6 @@ Texture2D* Texture2D::getAlphaTexture() const
|
||||||
return _alphaTexture;
|
return _alphaTexture;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Texture2D::setSamplerDescriptor(const backend::SamplerDescriptor &texParams)
|
|
||||||
{
|
|
||||||
_texture->updateSamplerDescriptor(texParams);
|
|
||||||
}
|
|
||||||
|
|
||||||
//TODO: should be reform later
|
|
||||||
void Texture2D::setTexParameters(const Texture2D::TexParams ¶ms)
|
void Texture2D::setTexParameters(const Texture2D::TexParams ¶ms)
|
||||||
{
|
{
|
||||||
backend::SamplerDescriptor sd;
|
backend::SamplerDescriptor sd;
|
||||||
|
@ -924,7 +917,7 @@ void Texture2D::setTexParameters(const Texture2D::TexParams ¶ms)
|
||||||
sd.magFilter = params.magFilter;
|
sd.magFilter = params.magFilter;
|
||||||
sd.sAddressMode = params.wrapS;
|
sd.sAddressMode = params.wrapS;
|
||||||
sd.tAddressMode = params.wrapT;
|
sd.tAddressMode = params.wrapT;
|
||||||
setSamplerDescriptor(sd);
|
_texture->updateSamplerDescriptor(sd);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO coulsonwang
|
// TODO coulsonwang
|
||||||
|
|
|
@ -160,8 +160,10 @@ public:
|
||||||
backend::SamplerFilter magFilter;
|
backend::SamplerFilter magFilter;
|
||||||
backend::SamplerAddressMode wrapS;
|
backend::SamplerAddressMode wrapS;
|
||||||
backend::SamplerAddressMode wrapT;
|
backend::SamplerAddressMode wrapT;
|
||||||
|
bool mipmapEnabled = true;
|
||||||
|
backend::SamplerFilter mipmapFilter = backend::SamplerFilter::LINEAR;
|
||||||
}TexParams;
|
}TexParams;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/** sets the default pixel format for UIImagescontains alpha channel.
|
/** sets the default pixel format for UIImagescontains alpha channel.
|
||||||
|
|
||||||
|
@ -300,9 +302,6 @@ public:
|
||||||
//TODO: minggo: is it resaonable?
|
//TODO: minggo: is it resaonable?
|
||||||
bool initWithBackendTexture(backend::Texture* texture);
|
bool initWithBackendTexture(backend::Texture* texture);
|
||||||
|
|
||||||
/** Set sampler properties
|
|
||||||
*/
|
|
||||||
void setSamplerDescriptor(const backend::SamplerDescriptor& texParams);
|
|
||||||
|
|
||||||
void setTexParameters(const TexParams ¶ms);
|
void setTexParameters(const TexParams ¶ms);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue