[DO-981] qt package (!15)
Co-authored-by: aleksandr.vodyanov <aleksandr.vodyanov@avroid.tech> Reviewed-on: https://git.avroid.tech/Conan/conan_build/pulls/15
This commit is contained in:
31
recipes/opengl/all/test_package/osx.mm
Normal file
31
recipes/opengl/all/test_package/osx.mm
Normal file
@@ -0,0 +1,31 @@
|
||||
#include "TargetConditionals.h"
|
||||
|
||||
#if TARGET_OS_TV || TARGET_OS_WATCH || TARGET_OS_IPHONE
|
||||
#else
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <AppKit/AppKit.h>
|
||||
#endif
|
||||
|
||||
bool init_context()
|
||||
{
|
||||
#if TARGET_OS_TV || TARGET_OS_WATCH || TARGET_OS_IPHONE
|
||||
return true;
|
||||
#else
|
||||
NSOpenGLPixelFormatAttribute pixelFormatAttributes[] =
|
||||
{
|
||||
NSOpenGLPFAColorSize, 24,
|
||||
NSOpenGLPFAAlphaSize, 8,
|
||||
NSOpenGLPFADoubleBuffer,
|
||||
0
|
||||
};
|
||||
NSOpenGLPixelFormat *pixelFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:pixelFormatAttributes];
|
||||
if (!pixelFormat)
|
||||
return false;
|
||||
|
||||
NSOpenGLContext *context = [[NSOpenGLContext alloc] initWithFormat:pixelFormat shareContext:nil];
|
||||
if (!context)
|
||||
return false;
|
||||
[context makeCurrentContext];
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
Reference in New Issue
Block a user