summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2011-12-07 21:20:24 (GMT)
committerMarius Kintel <marius@kintel.net>2011-12-07 21:20:24 (GMT)
commitcc4f6ac1846882adbc5214157e1d7b5a1994a9db (patch)
tree0aced88b1ca0234fb500bf8075c00026fcb56d91
parente3bfaca222d41a54f3d7946d4d3117054bb052ad (diff)
Machine/OS info for Mac
-rw-r--r--tests/OffscreenContext.mm26
1 files changed, 21 insertions, 5 deletions
diff --git a/tests/OffscreenContext.mm b/tests/OffscreenContext.mm
index eb06615..ea46275 100644
--- a/tests/OffscreenContext.mm
+++ b/tests/OffscreenContext.mm
@@ -2,9 +2,11 @@
#include "imageutils.h"
#include "fbo.h"
#include <iostream>
+#include <sstream>
#import <AppKit/AppKit.h> // for NSOpenGL...
-
+#include <CoreServices/CoreServices.h>
+#include <sys/utsname.h>
#define REPORTGLERROR(task) { GLenum tGLErr = glGetError(); if (tGLErr != GL_NO_ERROR) { std::cout << "OpenGL error " << tGLErr << " while " << task << "\n"; } }
@@ -17,13 +19,27 @@ struct OffscreenContext
fbo_t *fbo;
};
-string offscreen_context_getinfo(OffscreenContext *ctx)
+std::string offscreen_context_getinfo(OffscreenContext *ctx)
{
- stringstream out;
+ std::stringstream out;
+
+ struct utsname name;
+ uname(&name);
+
+ SInt32 majorVersion,minorVersion,bugFixVersion;
+
+ Gestalt(gestaltSystemVersionMajor, &majorVersion);
+ Gestalt(gestaltSystemVersionMinor, &minorVersion);
+ Gestalt(gestaltSystemVersionBugFix, &bugFixVersion);
+
+ char *arch = "unknown";
+ if (sizeof(int*) == 4) arch = "32-bit";
+ else if (sizeof(int*) == 8) arch = "64-bit";
+
out << "GL context creator: Cocoa / CGL\n"
<< "PNG generator: Core Foundation\n"
- << "OS info: Mac OSX\n"
- << "Machine: Apple(TM) Mac(TM)\n";
+ << "OS info: Mac OS X " << majorVersion << "." << minorVersion << "." << bugFixVersion << " (" << name.machine << " kernel)\n"
+ << "Machine: " << arch << "\n";
return out.str();
}
contact: Jan Huwald // Impressum