done
This commit is contained in:
parent
7c306a2d1e
commit
30c8f4ef20
4 changed files with 21 additions and 16 deletions
22
wayland.c
22
wayland.c
|
|
@ -365,13 +365,17 @@ static void egl_init(struct client_state *state) {
|
|||
EGL_RED_SIZE, 8,
|
||||
EGL_GREEN_SIZE, 8,
|
||||
EGL_BLUE_SIZE, 8,
|
||||
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
|
||||
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT | EGL_OPENGL_ES3_BIT | EGL_OPENGL_BIT,
|
||||
EGL_MIN_SWAP_INTERVAL, 0, // make sure that swapping buffers don't block the thread
|
||||
EGL_NONE
|
||||
};
|
||||
|
||||
static const EGLint context_attribs[] = {
|
||||
EGL_CONTEXT_CLIENT_VERSION, 2,
|
||||
//EGL_CONTEXT_CLIENT_VERSION, 2,
|
||||
EGL_CONTEXT_MAJOR_VERSION, 4,
|
||||
EGL_CONTEXT_MINOR_VERSION, 6,
|
||||
EGL_CONTEXT_OPENGL_PROFILE_MASK,
|
||||
EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT,
|
||||
EGL_NONE
|
||||
};
|
||||
|
||||
|
|
@ -391,11 +395,16 @@ static void egl_init(struct client_state *state) {
|
|||
}
|
||||
printf("EGL major: %d, minor %d\n", major, minor);
|
||||
|
||||
// Desktop GL?
|
||||
if (eglBindAPI(EGL_OPENGL_API) == EGL_FALSE) {
|
||||
printf("eglBindAPI failed\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
EGLint count;
|
||||
eglGetConfigs(state->egl_display, NULL, 0, &count);
|
||||
printf("EGL has %d configs\n", count);
|
||||
|
||||
|
||||
EGLConfig *configs = calloc(count, sizeof *configs);
|
||||
|
||||
EGLint n;
|
||||
|
|
@ -415,13 +424,14 @@ static void egl_init(struct client_state *state) {
|
|||
break;
|
||||
}
|
||||
|
||||
// Desktop GL?
|
||||
eglBindAPI(EGL_OPENGL_API);
|
||||
|
||||
state->egl_context =
|
||||
eglCreateContext(state->egl_display,
|
||||
state->egl_config,
|
||||
EGL_NO_CONTEXT, context_attribs);
|
||||
if (state->egl_context == EGL_NO_CONTEXT) {
|
||||
printf("Failed to create EGL context\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// EGL window
|
||||
struct surface_list *next = state->surface_list;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue