9#import <AvailabilityMacros.h>
10#import <OpenGL/OpenGL.h>
16 CGLPixelFormatAttribute attributes[] = {
19 (CGLPixelFormatAttribute) kCGLOGLPVersion_3_2_Core,
21 (CGLPixelFormatAttribute)NULL
24 CGLPixelFormatObj pixFormat;
26 CGLChoosePixelFormat(attributes, &pixFormat, &npix);
27 if (
nullptr == pixFormat) {
28 printf(
"CGLChoosePixelFormat failed.");
32 CGLContextObj context;
33 CGLCreateContext(pixFormat,
nullptr, &context);
34 CGLReleasePixelFormat(pixFormat);
37 printf(
"CGLCreateContext failed.");
41 CGLSetCurrentContext(context);
std::string printf(const char *fmt,...) SK_PRINTF_LIKE(1