View | Details | Raw Unified | Return to bug 190308
Collapse All | Expand All

(-)files/patch-ruby__video__glx.cpp (+31 lines)
Line 0 Link Here
1
--- ./ruby/video/glx.cpp.orig	2014-01-20 01:37:14.000000000 -0500
2
+++ ./ruby/video/glx.cpp	2014-06-02 23:32:39.000000000 -0400
3
@@ -128,6 +128,28 @@
4
     //require GLX 1.2+ API
5
     if(glx.version_major < 1 || (glx.version_major == 1 && glx.version_minor < 2)) return false;
6
 
7
+    int major, minor;
8
+    const char *version = (const char *) glGetString (GL_VERSION);
9
+    const char *dot = version == NULL ? NULL : strchr (version, '.');
10
+    const char *major_start = dot;
11
+
12
+    /* Sanity check */
13
+    if (dot == NULL || dot == version || *(dot + 1) == '\0') {
14
+        major = 0;
15
+        minor = 0;
16
+    } else {
17
+    /* Find the start of the major version in the string */
18
+    while (major_start > version && *major_start != ' ')
19
+           --major_start;
20
+        major = strtol (major_start, NULL, 10);
21
+        minor = strtol (dot + 1, NULL, 0);
22
+    }
23
+
24
+    if(major < 3 || (major == 3 && minor < 2)) {
25
+        printf("Error: OpenGL 3.2 is not available. Select another video driver on the Advanced Configuration tab and restart higan.\n");
26
+        return false;
27
+    }
28
+
29
     XWindowAttributes window_attributes;
30
     XGetWindowAttributes(display, settings.handle, &window_attributes);
31
 

Return to bug 190308