summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2009-02-16 00:26:22 -0500
committerKristian Høgsberg <krh@redhat.com>2009-02-16 00:26:22 -0500
commit1eff73c75885c4ef7067e16db73df74f1404e7c7 (patch)
tree30070cdac80f03e1bb74f6293c120b27ba546697
parent41a106815bdfe8e852c0291c501017cfb0baa688 (diff)
Use chooser instead of hardcoded fbconfig in gears.c.
-rw-r--r--gears.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/gears.c b/gears.c
index 85a73f1..21f9dde 100644
--- a/gears.c
+++ b/gears.c
@@ -336,6 +336,13 @@ static const struct wl_compositor_listener compositor_listener = {
handle_frame,
};
+static const EGLint config_attribs[] = {
+ EGL_DEPTH_SIZE, 24,
+ EGL_CONFIG_CAVEAT, EGL_NONE,
+ EGL_RED_SIZE, 8,
+ EGL_NONE
+};
+
static struct gears *
gears_create(struct display *display)
{
@@ -366,7 +373,9 @@ gears_create(struct display *display)
if (!eglGetConfigs(gears->display, configs, 64, &count))
die("failed to get configs\n");
- gears->config = configs[24];
+ if (!eglChooseConfig(gears->display, config_attribs, &gears->config, 1, NULL))
+ die("failed to pick a config\n");
+
gears->context = eglCreateContext(gears->display, gears->config, NULL, NULL);
if (gears->context == NULL)
die("failed to create context\n");