Skip to content

Instantly share code, notes, and snippets.

@madrobby
Created May 1, 2014 17:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save madrobby/156123706bb20c09c851 to your computer and use it in GitHub Desktop.
Save madrobby/156123706bb20c09c851 to your computer and use it in GitHub Desktop.
def decideIfHardwareAccelerationIsAGoodIdea
version = NSProcessInfo.processInfo.operatingSystemVersionString
begin
version = /[0-9]+\.[0-9]+/.match(version).to_s.split('.').map(&:to_i)
NSLog "Turning hardware acceleration on (#{version})"
@hw_accel = version[1] >= 9
rescue
NSLog "Couldn't parse operatingSystemVersionString: #{version}"
@hw_accel = false
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment