mirror of
https://github.com/glfw/glfw.git
synced 2025-10-03 21:30:57 +00:00
fix config
This commit is contained in:
parent
0408ee93f1
commit
f23c0213aa
@ -98,33 +98,6 @@ static GLFWbool chooseEGLConfig(const _GLFWctxconfig* ctxconfig,
|
|||||||
const _GLFWfbconfig* desired,
|
const _GLFWfbconfig* desired,
|
||||||
EGLConfig* result)
|
EGLConfig* result)
|
||||||
{
|
{
|
||||||
|
|
||||||
#if defined(_GLFW_EGLHEADLESS)
|
|
||||||
{
|
|
||||||
EGLint attribs[40];
|
|
||||||
int index = 0;
|
|
||||||
setAttrib(EGL_SURFACE_TYPE, EGL_PBUFFER_BIT);
|
|
||||||
setAttrib(EGL_BLUE_SIZE, 8);
|
|
||||||
setAttrib(EGL_GREEN_SIZE, 8);
|
|
||||||
setAttrib(EGL_RED_SIZE, 8);
|
|
||||||
setAttrib(EGL_DEPTH_SIZE, 8);
|
|
||||||
if (ctxconfig->client == GLFW_OPENGL_ES_API)
|
|
||||||
{
|
|
||||||
setAttrib(EGL_RENDERABLE_TYPE, EGL_OPENGL_ES_BIT);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
setAttrib(EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT);
|
|
||||||
}
|
|
||||||
setAttrib(EGL_NONE, EGL_NONE);
|
|
||||||
|
|
||||||
int num_configs;
|
|
||||||
if (!eglChooseConfig(_glfw.egl.display, attribs, result, 1, &num_configs) || num_configs == 0) {
|
|
||||||
return GLFW_FALSE;
|
|
||||||
}
|
|
||||||
return GLFW_TRUE;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
EGLConfig* nativeConfigs;
|
EGLConfig* nativeConfigs;
|
||||||
_GLFWfbconfig* usableConfigs;
|
_GLFWfbconfig* usableConfigs;
|
||||||
const _GLFWfbconfig* closest;
|
const _GLFWfbconfig* closest;
|
||||||
@ -152,9 +125,14 @@ static GLFWbool chooseEGLConfig(const _GLFWctxconfig* ctxconfig,
|
|||||||
if (getEGLConfigAttrib(n, EGL_COLOR_BUFFER_TYPE) != EGL_RGB_BUFFER)
|
if (getEGLConfigAttrib(n, EGL_COLOR_BUFFER_TYPE) != EGL_RGB_BUFFER)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
#if defined(_GLFW_EGLHEADLESS)
|
||||||
|
if (!(getEGLConfigAttrib(n, EGL_SURFACE_TYPE) & EGL_PBUFFER_BIT))
|
||||||
|
continue;
|
||||||
|
#else
|
||||||
// Only consider window EGLConfigs
|
// Only consider window EGLConfigs
|
||||||
if (!(getEGLConfigAttrib(n, EGL_SURFACE_TYPE) & EGL_WINDOW_BIT))
|
if (!(getEGLConfigAttrib(n, EGL_SURFACE_TYPE) & EGL_WINDOW_BIT))
|
||||||
continue;
|
continue;
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(_GLFW_X11)
|
#if defined(_GLFW_X11)
|
||||||
XVisualInfo vi = {0};
|
XVisualInfo vi = {0};
|
||||||
@ -220,7 +198,6 @@ static GLFWbool chooseEGLConfig(const _GLFWctxconfig* ctxconfig,
|
|||||||
free(usableConfigs);
|
free(usableConfigs);
|
||||||
|
|
||||||
return closest != NULL;
|
return closest != NULL;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void makeContextCurrentEGL(_GLFWwindow* window)
|
static void makeContextCurrentEGL(_GLFWwindow* window)
|
||||||
|
Loading…
Reference in New Issue
Block a user