Summary
Description: Unnamed repository; edit this file to name it for gitweb.
Last Change: Wed 2/3/10 13:04
Recent Commits
>
--git a/pts-core/functions/pts-functions.php b/pts-core/functions/pts-functions.php
index 799f9b1..c42a8a5 100644
--- a/pts-core/functions/pts-functions.php
+++ b/pts-core/functions/pts-functions.php
@@ -223,6 +223,7 @@ function pts_sw_string()
$sw_string = "OS: " . operating_system_release() . ", ";
$sw_string .= "Kernel: " . kernel_string() . " (" . kernel_arch() . "), ";
$sw_string .= "X.Org Server: " . graphics_subsystem_version() . ", ";
+ $sw_string .= "OpenGL: " . opengl_version() . ", ";
$sw_string .= "Compiler: " . compiler_version() . " ";
return $sw_string;
diff --git a/pts-core/functions/pts-functions_linux.php b/pts-core/functions/pts-functions_linux.php
index 5b4434b..df2607f 100644
--- a/pts-core/functions/pts-functions_linux.php
+++ b/pts-core/functions/pts-functions_linux.php
@@ -190,5 +190,29 @@ function compiler_version()
return $info;
}
+function opengl_version()
+{
+ $info = shell_exec("glxinfo | grep version");
+
+ if(($pos = strpos($info, "OpenGL version string:")) === FALSE)
+ {
+ $info = "N/A";
+ }
+ else
+ {
+ $info = substr($info, $pos + 23);
+ $info = trim(substr($info, 0, strpos($info, "\n")));
+ }
+
+ if(str_replace(array("NVIDIA", "ATI", "AMD", "Radeon", "Intel"), "", $info) == $info)
+ if(is_file("/proc/dri/0/name"))
+ {
+ $driver_info = file_get_contents("/proc/dri/0/name");
+ $driver_info = substr($driver_info, 0, strpos($driver_info, ' '));
+ $info .= " ($driver_info)";
+ }
+
+ return $info;
+}
Copyright © 2010 by Phoronix Media