MeVisLabToolboxReference
|
00001 // **InsertLicense** code author="Felix Ritter" version="1.0" 00002 00006 00007 #ifndef __macOpenGL_H 00008 #define __macOpenGL_H 00009 #if defined(__APPLE__) 00010 00011 #include <OpenGL/CGLTypes.h> 00012 00013 namespace macx { 00014 00016 class GLContext 00017 { 00018 public: 00019 00021 typedef CGLContextObj GLCtx; 00022 00024 static GLCtx create(); 00025 00027 static GLCtx createFullScreen(); 00028 00030 static void destroy(GLCtx &ctx); 00031 00033 static void activate(GLCtx &ctx); 00034 00036 static GLCtx current(); 00037 }; 00038 00039 } 00040 00042 #define MACX__CREATE_AND_ACTIVATE_GLCONTEXT \ 00043 macx::GLContext::GLCtx __pCtx = macx::GLContext::current(); \ 00044 macx::GLContext::GLCtx __nCtx = macx::GLContext::create(); \ 00045 macx::GLContext::activate(__nCtx); 00046 00048 #define MACX__DESTROY_GLCONTEXT_AND_ACTIVATE_PREVIOUS \ 00049 macx::GLContext::activate(__pCtx); \ 00050 macx::GLContext::destroy(__nCtx); 00051 00052 #endif // __APPLE__ 00053 #endif // __macOpenGL_H