MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / initGl

Method initGl

Engine/AppManagerPrivate.cpp:935–1159  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

933}
934
935void
936AppManagerPrivate::initGl(bool checkRenderingReq)
937{
938 // Private should not lock
939 assert( !openGLFunctionsMutex.tryLock() );
940
941 hasInitializedOpenGLFunctions = true;
942
943#ifdef __NATRON_LINUX__
944 bool glLoaded = false;
945 const OSGLContext_egl_data* eglInfo = nullptr;
946
947 if (appPTR->isOnWayland()) {
948 eglInfo = appPTR->getEGLData();
949 }
950
951 if (eglInfo && eglInfo->getProcAddress) {
952 glLoaded = gladLoadGLLoader(eglInfo->getProcAddress);
953 } else {
954 glLoaded = gladLoadGL();
955 }
956#else
957 bool glLoaded = gladLoadGL();
958#endif
959
960#ifdef GLAD_DEBUG
961 if (glLoaded) {
962#ifdef GL_TRACE_CALLS
963 glad_set_pre_callback(pre_gl_call);
964 glad_set_post_callback(post_gl_call);
965#endif
966
967 // disablepost_gl_call for glBegin and commands that are authorized between glBegin and glEnd
968 // (because glGetError isn't authorized there)
969 // see https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glBegin.xml
970
971 glad_debug_glBegin = glad_glBegin;
972
973 glad_debug_glVertex2s = glad_glVertex2s;
974 glad_debug_glVertex2i = glad_glVertex2i;
975 glad_debug_glVertex2f = glad_glVertex2f;
976 glad_debug_glVertex2d = glad_glVertex2d;
977 glad_debug_glVertex3s = glad_glVertex3s;
978 glad_debug_glVertex3i = glad_glVertex3i;
979 glad_debug_glVertex3f = glad_glVertex3f;
980 glad_debug_glVertex3d = glad_glVertex3d;
981 glad_debug_glVertex4s = glad_glVertex4s;
982 glad_debug_glVertex4i = glad_glVertex4i;
983 glad_debug_glVertex4f = glad_glVertex4f;
984 glad_debug_glVertex4d = glad_glVertex4d;
985 glad_debug_glColor3b = glad_glColor3b;
986 glad_debug_glColor3s = glad_glColor3s;
987 glad_debug_glColor3i = glad_glColor3i;
988 glad_debug_glColor3f = glad_glColor3f;
989 glad_debug_glColor3d = glad_glColor3d;
990 glad_debug_glColor3ub = glad_glColor3ub;
991 glad_debug_glColor3us = glad_glColor3us;
992 glad_debug_glColor3ui = glad_glColor3ui;

Callers 1

Calls 8

glad_set_pre_callbackFunction · 0.85
glad_set_post_callbackFunction · 0.85
isOnWaylandMethod · 0.80
getEGLDataMethod · 0.80
toStdStringMethod · 0.80
gladLoadGLLoaderFunction · 0.50
gladLoadGLFunction · 0.50
tryLockMethod · 0.45

Tested by

no test coverage detected