Created
September 4, 2009 04:44
-
-
Save sazameki/180733 to your computer and use it in GitHub Desktop.
Check OpenGL Version
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use these codes below after NSOpenGLView is prepared. | |
#include <OpenGL/gl.h> | |
- (void)doCheck | |
{ | |
NSLog(@"gl_version={%s}", glGetString(GL_VERSION)); | |
NSLog(@"gl_renderer={%s}", glGetString(GL_RENDERER)); | |
NSLog(@"gl_vendor={%s}", glGetString(GL_VENDOR)); | |
NSString *extensionsStr = [NSString stringWithCString:(const char *)glGetString(GL_EXTENSIONS) | |
encoding:NSASCIIStringEncoding]; | |
NSScanner *scanner = [NSScanner scannerWithString:extensionsStr]; | |
NSMutableArray *extensions = [NSMutableArray array]; | |
while (![scanner isAtEnd]) { | |
NSString *anExtension; | |
if ([scanner scanUpToString:@" " intoString:&anExtension]) { | |
NSLog(@"gl_an_ext={%@}", anExtension); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment