Changeset View
Changeset View
Standalone View
Standalone View
intern/ghost/intern/GHOST_ContextCGL.mm
| Show First 20 Lines • Show All 185 Lines • ▼ Show 20 Lines | GHOST_TSuccess GHOST_ContextCGL::updateDrawingContext() | ||||
| else { | else { | ||||
| return GHOST_kFailure; | return GHOST_kFailure; | ||||
| } | } | ||||
| } | } | ||||
| static void makeAttribList( | static void makeAttribList( | ||||
| std::vector<NSOpenGLPixelFormatAttribute>& attribs, | std::vector<NSOpenGLPixelFormatAttribute>& attribs, | ||||
| bool coreProfile, | bool coreProfile, | ||||
| bool stereoVisual, | bool stereoVisual, | ||||
| int numOfAASamples, | int numOfAASamples, | ||||
| bool needAlpha, | bool needAlpha, | ||||
| bool needStencil, | bool needStencil, | ||||
| bool softwareGL) | bool softwareGL) | ||||
| { | { | ||||
| attribs.clear(); | attribs.clear(); | ||||
| attribs.push_back(NSOpenGLPFAOpenGLProfile); | attribs.push_back(NSOpenGLPFAOpenGLProfile); | ||||
| attribs.push_back(coreProfile ? NSOpenGLProfileVersion3_2Core : NSOpenGLProfileVersionLegacy); | attribs.push_back(coreProfile ? NSOpenGLProfileVersion3_2Core : NSOpenGLProfileVersionLegacy); | ||||
| // Pixel Format Attributes for the windowed NSOpenGLContext | // Pixel Format Attributes for the windowed NSOpenGLContext | ||||
| attribs.push_back(NSOpenGLPFADoubleBuffer); | attribs.push_back(NSOpenGLPFADoubleBuffer); | ||||
| if (softwareGL) { | if (softwareGL) { | ||||
| attribs.push_back(NSOpenGLPFARendererID); | attribs.push_back(NSOpenGLPFARendererID); | ||||
| attribs.push_back(kCGLRendererGenericFloatID); | attribs.push_back(kCGLRendererGenericFloatID); | ||||
| } | } | ||||
| else { | else { | ||||
| ▲ Show 20 Lines • Show All 156 Lines • ▼ Show 20 Lines | #endif | ||||
| if (m_openGLView) { | if (m_openGLView) { | ||||
| [m_openGLView setOpenGLContext:m_openGLContext]; | [m_openGLView setOpenGLContext:m_openGLContext]; | ||||
| [m_openGLContext setView:m_openGLView]; | [m_openGLContext setView:m_openGLView]; | ||||
| } | } | ||||
| if (s_sharedCount == 0) | if (s_sharedCount == 0) | ||||
| s_sharedOpenGLContext = m_openGLContext; | s_sharedOpenGLContext = m_openGLContext; | ||||
| s_sharedCount++; | s_sharedCount++; | ||||
| initClearGL(); | initClearGL(); | ||||
| [m_openGLContext flushBuffer]; | [m_openGLContext flushBuffer]; | ||||
| [pool drain]; | [pool drain]; | ||||
| Show All 23 Lines | |||||