summaryrefslogtreecommitdiffstatsci
path: root/src/surface-glx.cpp
diff options
context:
space:
mode:
authorBryce Harrington <b.harrington@samsung.com>2013-11-14 14:27:02 -0800
committerBryce Harrington <b.harrington@samsung.com>2013-11-14 14:27:02 -0800
commit7030d7cbeb476f6b5c1a3841cb578469dd411ad4 (patch)
tree8fcbac997852fefcd32eb9d15d104e4b6342469c /src/surface-glx.cpp
parent04cccccee996fb33cfcb36debed148688f73e866 (diff)
Add warning messages explaining if graphics state couldn't be set up
Diffstat (limited to 'src/surface-glx.cpp')
-rw-r--r--src/surface-glx.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/surface-glx.cpp b/src/surface-glx.cpp
index 8285f5c..3231ccf 100644
--- a/src/surface-glx.cpp
+++ b/src/surface-glx.cpp
@@ -1,3 +1,4 @@
+#include <err.h>
#include <stdlib.h>
#include <cairo.h>
#include <cairo-gl.h>
@@ -38,11 +39,14 @@ create_source_surface_glx (int width, int height)
Display *dpy;
dpy = XOpenDisplay (NULL);
- if (dpy == NULL)
+ if (dpy == NULL) {
+ warnx ("Failed to open display: %s\n", XDisplayName (0));
return NULL;
+ }
visinfo = glXChooseVisual (dpy, DefaultScreen (dpy), rgba_attribs);
if (visinfo == NULL) {
+ warnx ("Failed to choose glx visual\n");
XCloseDisplay (dpy);
return NULL;
}
@@ -51,12 +55,14 @@ create_source_surface_glx (int width, int height)
XFree (visinfo);
if (ctx == NULL) {
+ warnx ("Could not create glx context\n");
XCloseDisplay (dpy);
return NULL;
}
arg = (closure*) malloc (sizeof (struct closure));
if (!arg) {
+ warnx ("Out of memory\n");
XCloseDisplay (dpy);
return NULL;
}
@@ -68,6 +74,7 @@ create_source_surface_glx (int width, int height)
arg,
cleanup))
{
+ warnx ("Failed to setup cleanup callback\n");
cleanup (arg);
return NULL;
}