diff options
author | don bright <hugh.m.bright@gmail.com> | 2011-12-09 16:49:55 (GMT) |
---|---|---|
committer | don bright <hugh.m.bright@gmail.com> | 2011-12-09 16:49:55 (GMT) |
commit | a4a64e7c26a0eb523f5b271c9d90f091e5933ebb (patch) | |
tree | 6e247c3f46c23a6c85b4740a2ff99abaa25fe9bd /tests/OffscreenContext.mm | |
parent | 51f24b998ba555d15f924ccd4fb5b46219f6537b (diff) | |
parent | f577f91d25071f5ad1a9fdb6ed7c6dd3aa4c1008 (diff) |
Merge remote-tracking branch 'upstream/master' into cakebaby
Diffstat (limited to 'tests/OffscreenContext.mm')
-rw-r--r-- | tests/OffscreenContext.mm | 26 |
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(); } |