aboutsummaryrefslogtreecommitdiffstats
path: root/emulators
diff options
context:
space:
mode:
authormarino <marino@FreeBSD.org>2014-07-29 03:14:36 +0800
committermarino <marino@FreeBSD.org>2014-07-29 03:14:36 +0800
commit0d22ab595e5fbac8bcc6bc1802764058caa20275 (patch)
tree1f0a6a65805582cc7facbf0b197c2622f1791ee5 /emulators
parentee3443cd7099a3b5920f80471fb174eb9b279796 (diff)
downloadfreebsd-ports-gnome-0d22ab595e5fbac8bcc6bc1802764058caa20275.tar.gz
freebsd-ports-gnome-0d22ab595e5fbac8bcc6bc1802764058caa20275.tar.zst
freebsd-ports-gnome-0d22ab595e5fbac8bcc6bc1802764058caa20275.zip
emulators/higan: Fix GLX support
PR: 190308 Reported by: aksyom (gmail) Fixed by: maintainer (Naram Qashat)
Diffstat (limited to 'emulators')
-rw-r--r--emulators/higan/Makefile2
-rw-r--r--emulators/higan/files/patch-ruby__video__glx.cpp31
2 files changed, 32 insertions, 1 deletions
diff --git a/emulators/higan/Makefile b/emulators/higan/Makefile
index fd8faf60c938..48adf7c0193f 100644
--- a/emulators/higan/Makefile
+++ b/emulators/higan/Makefile
@@ -3,7 +3,7 @@
PORTNAME= higan
PORTVERSION= 0.94
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= emulators
MASTER_SITES= http://byuu.org/files/ \
http://www.cyberbotx.com/higan/
diff --git a/emulators/higan/files/patch-ruby__video__glx.cpp b/emulators/higan/files/patch-ruby__video__glx.cpp
new file mode 100644
index 000000000000..a45d0151a80f
--- /dev/null
+++ b/emulators/higan/files/patch-ruby__video__glx.cpp
@@ -0,0 +1,31 @@
+--- ./ruby/video/glx.cpp.orig 2014-01-20 01:37:14.000000000 -0500
++++ ./ruby/video/glx.cpp 2014-06-02 23:32:39.000000000 -0400
+@@ -128,6 +128,28 @@
+ //require GLX 1.2+ API
+ if(glx.version_major < 1 || (glx.version_major == 1 && glx.version_minor < 2)) return false;
+
++ int major, minor;
++ const char *version = (const char *) glGetString (GL_VERSION);
++ const char *dot = version == NULL ? NULL : strchr (version, '.');
++ const char *major_start = dot;
++
++ /* Sanity check */
++ if (dot == NULL || dot == version || *(dot + 1) == '\0') {
++ major = 0;
++ minor = 0;
++ } else {
++ /* Find the start of the major version in the string */
++ while (major_start > version && *major_start != ' ')
++ --major_start;
++ major = strtol (major_start, NULL, 10);
++ minor = strtol (dot + 1, NULL, 0);
++ }
++
++ if(major < 3 || (major == 3 && minor < 2)) {
++ printf("Error: OpenGL 3.2 is not available. Select another video driver on the Advanced Configuration tab and restart higan.\n");
++ return false;
++ }
++
+ XWindowAttributes window_attributes;
+ XGetWindowAttributes(display, settings.handle, &window_attributes);
+