You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because we have set the antialiasing level to 4 it will draw nothing to the screen because of the following lines of bugged code in EglContext.cpp
EGLConfig EglContext::getBestConfig(EGLDisplay display, unsigned int bitsPerPixel, const ContextSettings& settings)
{
// Set our video settings constraint
const EGLint attributes[] = {
EGL_BUFFER_SIZE, static_cast<EGLint>(bitsPerPixel),
EGL_DEPTH_SIZE, static_cast<EGLint>(settings.depthBits),
EGL_STENCIL_SIZE, static_cast<EGLint>(settings.stencilBits),
EGL_SAMPLE_BUFFERS, static_cast<EGLint>(settings.antialiasingLevel),
EGL_SURFACE_TYPE, EGL_WINDOW_BIT | EGL_PBUFFER_BIT,
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES_BIT,
EGL_NONE
};
EGLint configCount;
EGLConfig configs[1];
// Ask EGL for the best config matching our video settings
eglCheck(eglChooseConfig(display, attributes, configs, 1, &configCount));
// TODO: This should check EGL_CONFORMANT and pick the first conformant configuration.
return configs[0];
}
the bug coming from the getBestConfig function is caused because of incorrectly set attributes, EGL_SAMPLE_BUFFERS is not where we set the multisamples but rather the number of buffers for multisampling, currently EGL only support a value between 0 and 1, anything more then 1 will caused undefined behavior,
patch
EGLConfig EglContext::getBestConfig(EGLDisplay display, unsigned int bitsPerPixel, const ContextSettings& settings)
{
EGLint multiSamplesBuffer = 0;
if(settings.antialiasingLevel > 0)
multiSamplesBuffer = 1;
// Set our video settings constraint
const EGLint attributes[] = {
EGL_BUFFER_SIZE, static_cast<EGLint>(bitsPerPixel),
EGL_DEPTH_SIZE, static_cast<EGLint>(settings.depthBits),
EGL_STENCIL_SIZE, static_cast<EGLint>(settings.stencilBits),
EGL_SAMPLE_BUFFERS, multiSamplesBuffer,
EGL_SAMPLES, static_cast<EGLint>(settings.antialiasingLevel),
EGL_SURFACE_TYPE, EGL_WINDOW_BIT | EGL_PBUFFER_BIT,
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES_BIT,
EGL_NONE
};
EGLint configCount;
EGLConfig configs[1];
// Ask EGL for the best config matching our video settings
eglCheck(eglChooseConfig(display, attributes, configs, 1, &configCount));
// TODO: This should check EGL_CONFORMANT and pick the first conformant configuration.
return configs[0];
}
this patch simply checks if antialiasing is enabled and sets a the samples buffer on or off accordingly, hope this helps anyone with this issue, cheers (=
The text was updated successfully, but these errors were encountered:
Once again a bug in the EGL Context class now effecting antialiasing
This bug effects all versions of SFML supporting android,
to recreate this bug simply use the following code with the current version of sfml
Because we have set the antialiasing level to 4 it will draw nothing to the screen because of the following lines of bugged code in EglContext.cpp
the bug coming from the getBestConfig function is caused because of incorrectly set attributes, EGL_SAMPLE_BUFFERS is not where we set the multisamples but rather the number of buffers for multisampling, currently EGL only support a value between 0 and 1, anything more then 1 will caused undefined behavior,
patch
this patch simply checks if antialiasing is enabled and sets a the samples buffer on or off accordingly, hope this helps anyone with this issue, cheers (=
The text was updated successfully, but these errors were encountered: