summaryrefslogtreecommitdiffstats
path: root/progs/egl
diff options
context:
space:
mode:
authorKristian Høgsberg <[email protected]>2010-02-26 15:11:29 -0500
committerKristian Høgsberg <[email protected]>2010-02-26 15:11:29 -0500
commit69a0f375ccc7d455cad94cd31323667bafe08287 (patch)
treef8bf255ad042185511e04d4c76ad34a866111795 /progs/egl
parenta509b8cc24df71599b5e77a8cec22ed6249ea960 (diff)
eglinfo: Wrap extension string
Diffstat (limited to 'progs/egl')
-rw-r--r--progs/egl/eglinfo.c39
1 files changed, 37 insertions, 2 deletions
diff --git a/progs/egl/eglinfo.c b/progs/egl/eglinfo.c
index 37bc22e9fd0..961fd9ccc76 100644
--- a/progs/egl/eglinfo.c
+++ b/progs/egl/eglinfo.c
@@ -156,7 +156,42 @@ PrintModes(EGLDisplay d)
#endif
}
+static void
+PrintExtensions(EGLDisplay d)
+{
+ const char *extensions, *p, *end, *next;
+ int column;
+
+ printf("EGL extensions string:\n");
+ extensions = eglQueryString(d, EGL_EXTENSIONS);
+
+ column = 0;
+ end = extensions + strlen(extensions);
+
+ for (p = extensions; p < end; p = next + 1) {
+ next = strchr(p, ' ');
+ if (next == NULL)
+ next = end;
+
+ if (column > 0 && column + next - p + 1 > 70) {
+ printf("\n");
+ column = 0;
+ }
+ if (column == 0)
+ printf(" ");
+ else
+ printf(" ");
+ column += next - p + 1;
+
+ printf("%.*s", (int) (next - p), p);
+
+ p = next + 1;
+ }
+
+ if (column > 0)
+ printf("\n");
+}
int
main(int argc, char *argv[])
@@ -175,8 +210,8 @@ main(int argc, char *argv[])
#ifdef EGL_VERSION_1_2
printf("EGL client APIs: %s\n", eglQueryString(d, EGL_CLIENT_APIS));
#endif
- printf("EGL extensions string:\n");
- printf(" %s\n", eglQueryString(d, EGL_EXTENSIONS));
+
+ PrintExtensions(d);
PrintConfigs(d);