clients: Allow compiling with the cairo glesv2 backend
This disables gears and wscreensaver, which use full GL.
This commit is contained in:
+24
-19
@@ -18,7 +18,6 @@ endif
|
||||
|
||||
if BUILD_CLIENTS
|
||||
clients_programs = \
|
||||
gears \
|
||||
flower \
|
||||
screenshot \
|
||||
terminal \
|
||||
@@ -26,8 +25,8 @@ clients_programs = \
|
||||
dnd \
|
||||
smoke \
|
||||
resizor \
|
||||
wscreensaver \
|
||||
eventdemo
|
||||
eventdemo \
|
||||
$(full_gl_client_programs)
|
||||
|
||||
desktop_shell = weston-desktop-shell
|
||||
tablet_shell = weston-tablet-shell
|
||||
@@ -37,7 +36,7 @@ noinst_LIBRARIES = libtoytoolkit.a
|
||||
AM_CFLAGS = $(GCC_CFLAGS)
|
||||
AM_CPPFLAGS = \
|
||||
-DDATADIR='"$(datadir)"' \
|
||||
$(CLIENT_CFLAGS)
|
||||
$(CLIENT_CFLAGS) $(CAIRO_EGL_CFLAGS)
|
||||
|
||||
libtoytoolkit_a_SOURCES = \
|
||||
window.c \
|
||||
@@ -47,10 +46,7 @@ libtoytoolkit_a_SOURCES = \
|
||||
|
||||
toolkit_libs = \
|
||||
libtoytoolkit.a \
|
||||
$(CLIENT_LIBS) -lrt -lm
|
||||
|
||||
gears_SOURCES = gears.c
|
||||
gears_LDADD = $(toolkit_libs)
|
||||
$(CLIENT_LIBS) $(CAIRO_EGL_LIBS) -lrt -lm
|
||||
|
||||
flower_SOURCES = flower.c
|
||||
flower_LDADD = $(toolkit_libs)
|
||||
@@ -73,17 +69,6 @@ smoke_LDADD = $(toolkit_libs)
|
||||
resizor_SOURCES = resizor.c
|
||||
resizor_LDADD = $(toolkit_libs)
|
||||
|
||||
wscreensaver_SOURCES = \
|
||||
wscreensaver.c \
|
||||
wscreensaver.h \
|
||||
desktop-shell-client-protocol.h \
|
||||
desktop-shell-protocol.c \
|
||||
wscreensaver-glue.c \
|
||||
wscreensaver-glue.h \
|
||||
glmatrix.c \
|
||||
matrix3.xpm
|
||||
wscreensaver_LDADD = $(toolkit_libs) -lGLU
|
||||
|
||||
eventdemo_SOURCES = eventdemo.c
|
||||
eventdemo_LDADD = $(toolkit_libs)
|
||||
|
||||
@@ -112,6 +97,26 @@ BUILT_SOURCES = \
|
||||
CLEANFILES = $(BUILT_SOURCES)
|
||||
endif
|
||||
|
||||
if BUILD_FULL_GL_CLIENTS
|
||||
full_gl_client_programs = \
|
||||
gears \
|
||||
wscreensaver
|
||||
|
||||
gears_SOURCES = gears.c
|
||||
gears_LDADD = $(toolkit_libs)
|
||||
|
||||
wscreensaver_SOURCES = \
|
||||
wscreensaver.c \
|
||||
wscreensaver.h \
|
||||
desktop-shell-client-protocol.h \
|
||||
desktop-shell-protocol.c \
|
||||
wscreensaver-glue.c \
|
||||
wscreensaver-glue.h \
|
||||
glmatrix.c \
|
||||
matrix3.xpm
|
||||
wscreensaver_LDADD = $(toolkit_libs) -lGLU
|
||||
endif
|
||||
|
||||
@wayland_scanner_rules@
|
||||
|
||||
if HAVE_POPPLER
|
||||
|
||||
+15
-3
@@ -2743,13 +2743,24 @@ init_egl(struct display *d)
|
||||
EGL_NONE
|
||||
};
|
||||
|
||||
#ifdef USE_CAIRO_GLESV2
|
||||
static const EGLint context_attribs[] = {
|
||||
EGL_CONTEXT_CLIENT_VERSION, 2,
|
||||
EGL_NONE
|
||||
};
|
||||
EGLint api = EGL_OPENGL_ES_API;
|
||||
#else
|
||||
EGLint *context_attribs = NULL;
|
||||
EGLint api = EGL_OPENGL_API;
|
||||
#endif
|
||||
|
||||
d->dpy = eglGetDisplay(d->display);
|
||||
if (!eglInitialize(d->dpy, &major, &minor)) {
|
||||
fprintf(stderr, "failed to initialize display\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!eglBindAPI(EGL_OPENGL_API)) {
|
||||
if (!eglBindAPI(api)) {
|
||||
fprintf(stderr, "failed to bind api EGL_OPENGL_API\n");
|
||||
return -1;
|
||||
}
|
||||
@@ -2766,13 +2777,14 @@ init_egl(struct display *d)
|
||||
return -1;
|
||||
}
|
||||
|
||||
d->rgb_ctx = eglCreateContext(d->dpy, d->rgb_config, EGL_NO_CONTEXT, NULL);
|
||||
d->rgb_ctx = eglCreateContext(d->dpy, d->rgb_config,
|
||||
EGL_NO_CONTEXT, context_attribs);
|
||||
if (d->rgb_ctx == NULL) {
|
||||
fprintf(stderr, "failed to create context\n");
|
||||
return -1;
|
||||
}
|
||||
d->argb_ctx = eglCreateContext(d->dpy, d->argb_config,
|
||||
EGL_NO_CONTEXT, NULL);
|
||||
EGL_NO_CONTEXT, context_attribs);
|
||||
if (d->argb_ctx == NULL) {
|
||||
fprintf(stderr, "failed to create context\n");
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user