Changeset View
Changeset View
Standalone View
Standalone View
intern/ghost/intern/GHOST_ContextGLX.cpp
| Show First 20 Lines • Show All 68 Lines • ▼ Show 20 Lines | : GHOST_Context(stereoVisual, numOfAASamples), | ||||
| m_window(window), | m_window(window), | ||||
| m_contextProfileMask(contextProfileMask), | m_contextProfileMask(contextProfileMask), | ||||
| m_contextMajorVersion(contextMajorVersion), | m_contextMajorVersion(contextMajorVersion), | ||||
| m_contextMinorVersion(contextMinorVersion), | m_contextMinorVersion(contextMinorVersion), | ||||
| m_contextFlags(contextFlags), | m_contextFlags(contextFlags), | ||||
| m_contextResetNotificationStrategy(contextResetNotificationStrategy), | m_contextResetNotificationStrategy(contextResetNotificationStrategy), | ||||
| m_context(None) | m_context(None) | ||||
| { | { | ||||
| assert(m_window != 0); | |||||
| assert(m_display != NULL); | assert(m_display != NULL); | ||||
| } | } | ||||
| GHOST_ContextGLX::~GHOST_ContextGLX() | GHOST_ContextGLX::~GHOST_ContextGLX() | ||||
| { | { | ||||
| if (m_display != NULL) { | if (m_display != NULL) { | ||||
| if (m_context != None) { | if (m_context != None) { | ||||
| ▲ Show 20 Lines • Show All 197 Lines • ▼ Show 20 Lines | if (m_context != NULL) { | ||||
| s_sharedCount++; | s_sharedCount++; | ||||
| glXMakeCurrent(m_display, m_window, m_context); | glXMakeCurrent(m_display, m_window, m_context); | ||||
| // Seems that this has to be called after MakeCurrent, | // Seems that this has to be called after MakeCurrent, | ||||
| // which means we cannot use glX extensions until after we create a context | // which means we cannot use glX extensions until after we create a context | ||||
| initContextGLXEW(); | initContextGLXEW(); | ||||
| if (m_window) { | |||||
| initClearGL(); | initClearGL(); | ||||
| ::glXSwapBuffers(m_display, m_window); | ::glXSwapBuffers(m_display, m_window); | ||||
| } | |||||
| /* re initialize to get the extensions properly */ | /* re initialize to get the extensions properly */ | ||||
| initContextGLXEW(); | initContextGLXEW(); | ||||
| version = glGetString(GL_VERSION); | version = glGetString(GL_VERSION); | ||||
| #if 0 // enable this when Blender switches to 3.3 core profile | #if 0 // enable this when Blender switches to 3.3 core profile | ||||
| if (!version || version[0] < '3' || ((version[0] == '3') && (version[2] < '3'))) { | if (!version || version[0] < '3' || ((version[0] == '3') && (version[2] < '3'))) { | ||||
| ▲ Show 20 Lines • Show All 184 Lines • Show Last 20 Lines | |||||