Save OS version to scenarios

This commit is contained in:
2015-08-17 23:22:50 -04:00
parent 8008ff6dac
commit a8dd1d3b3a
3 changed files with 12 additions and 2 deletions

View File

@@ -10,6 +10,7 @@
#include <Cocoa/Cocoa.h>
#include <AppKit/NSBitmapImageRep.h>
#include <SFML/Graphics/RenderWindow.hpp>
#include <sstream>
// TODO: I'm sure there's a better way to do this (maybe one that's keyboard layout agnostic)
// The proper way would involve use of the TextEntered event
@@ -89,6 +90,14 @@ char keyToChar(sf::Keyboard::Key key, bool isShift) {
return 0;
}
std::string get_os_version() {
NSProcessInfo* info = [NSProcessInfo processInfo];
std::ostringstream os;
os << "Apple Mac OS X ";
os << [[info operatingSystemVersionString] cStringUsingEncoding:NSASCIIStringEncoding];
return os.str();
}
void makeFrontWindow(sf::Window& win) {
sf::WindowHandle handle = win.getSystemHandle();
id nsHandle = id(handle);