Ensure program is terminated when swap interval cannot be changed
[gltest.git] / glxbackend.cpp
index ff126eb25ed7fdf5889b357b06aa5ab5291633c6..7841bbe584aeceb3d8c43747a20a8e9694df931b 100644 (file)
@@ -2,6 +2,7 @@
 
 #include <stdio.h>
 #include <assert.h>
+#include <stdlib.h>
 #include <GL/glxext.h>
 #include <string>
 
@@ -80,6 +81,8 @@ void GLXBackend::setSwapInterval(int i) const
                funSwapIntervalExt(display, window, i);
        else if (funSwapIntervalMesa)
                funSwapIntervalMesa(i);
-       else
-               assert(false && "At least one of glXSwapIntervalMESA, glXSwapIntervalEXT must be provided by the system");
+       else {
+               fprintf(stderr, "At least one of glXSwapIntervalMESA, glXSwapIntervalEXT must be provided by the system\n");
+               abort();
+       }
 }