texture border not supported on mobile
This commit is contained in:
@@ -1082,16 +1082,17 @@ bool Canvas::create(int width, int height)
|
||||
#if defined(__IOS__) || defined(__ANDROID__)
|
||||
m_tmp[i].create(width, height, -1, GL_RGBA8);
|
||||
m_tex[i].create(width, height, GL_RGBA8);
|
||||
m_sampler_brush.create();
|
||||
#else
|
||||
m_tmp[i].create(width, height, -1, GL_RGBA32F);
|
||||
m_tex[i].create(width, height, GL_RGBA32F);
|
||||
m_sampler_brush.create(GL_LINEAR, GL_CLAMP_TO_BORDER);
|
||||
#endif
|
||||
m_tex2[i].create(width, height, GL_RGBA8); // TODO: destroy before recreating
|
||||
}
|
||||
m_sampler.create(GL_NEAREST);
|
||||
m_sampler.create(GL_LINEAR);
|
||||
m_sampler_nearest.create(GL_NEAREST);
|
||||
m_sampler_brush.create(GL_LINEAR, GL_CLAMP_TO_BORDER);
|
||||
m_sampler_brush.set_filter(GL_LINEAR_MIPMAP_LINEAR, GL_LINEAR);
|
||||
m_sampler_brush.set_border({ 1, 1, 1, 1 });
|
||||
m_sampler_bg.create(GL_NEAREST);
|
||||
|
||||
@@ -136,7 +136,7 @@ void Sampler::set_filter(GLint filter_min, GLint filter_mag)
|
||||
}
|
||||
void Sampler::set_border(glm::vec4 rgba)
|
||||
{
|
||||
#if USE_SAMPLER
|
||||
#if USE_SAMPLER && !defined(__IOS__) && !defined(__ANDROID__)
|
||||
glSamplerParameterfv(id, GL_TEXTURE_BORDER_COLOR, glm::value_ptr(rgba));
|
||||
#endif // USE_SAMPLER
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user