Changeset View
Changeset View
Standalone View
Standalone View
libkwineffects/kwinglutils.cpp
Show First 20 Lines • Show All 78 Lines • ▼ Show 20 Line(s) | 75 | { | |||
---|---|---|---|---|---|
79 | int major, minor; | 79 | int major, minor; | ||
80 | eglInitialize(dpy, &major, &minor); | 80 | eglInitialize(dpy, &major, &minor); | ||
81 | eglVersion = MAKE_GL_VERSION(major, minor, 0); | 81 | eglVersion = MAKE_GL_VERSION(major, minor, 0); | ||
82 | const QByteArray string = eglQueryString(dpy, EGL_EXTENSIONS); | 82 | const QByteArray string = eglQueryString(dpy, EGL_EXTENSIONS); | ||
83 | s_eglExtensions = string.split(' '); | 83 | s_eglExtensions = string.split(' '); | ||
84 | eglResolveFunctions(); | 84 | eglResolveFunctions(); | ||
85 | } | 85 | } | ||
86 | 86 | | |||
87 | void initGL(OpenGLPlatformInterface platformInterface) | 87 | void initGL(std::function<resolveFuncPtr(const char*)> resolveFunction) | ||
88 | { | 88 | { | ||
89 | // Get list of supported OpenGL extensions | 89 | // Get list of supported OpenGL extensions | ||
90 | if (hasGLVersion(3, 0)) { | 90 | if (hasGLVersion(3, 0)) { | ||
91 | int count; | 91 | int count; | ||
92 | glGetIntegerv(GL_NUM_EXTENSIONS, &count); | 92 | glGetIntegerv(GL_NUM_EXTENSIONS, &count); | ||
93 | 93 | | |||
94 | for (int i = 0; i < count; i++) { | 94 | for (int i = 0; i < count; i++) { | ||
95 | const QByteArray name = (const char *) glGetStringi(GL_EXTENSIONS, i); | 95 | const QByteArray name = (const char *) glGetStringi(GL_EXTENSIONS, i); | ||
96 | glExtensions << name; | 96 | glExtensions << name; | ||
97 | } | 97 | } | ||
98 | } else | 98 | } else | ||
99 | glExtensions = QByteArray((const char*)glGetString(GL_EXTENSIONS)).split(' '); | 99 | glExtensions = QByteArray((const char*)glGetString(GL_EXTENSIONS)).split(' '); | ||
100 | 100 | | |||
101 | // handle OpenGL extensions functions | 101 | // handle OpenGL extensions functions | ||
102 | glResolveFunctions(platformInterface); | 102 | glResolveFunctions(resolveFunction); | ||
103 | 103 | | |||
104 | GLTexturePrivate::initStatic(); | 104 | GLTexturePrivate::initStatic(); | ||
105 | GLRenderTarget::initStatic(); | 105 | GLRenderTarget::initStatic(); | ||
106 | GLVertexBuffer::initStatic(); | 106 | GLVertexBuffer::initStatic(); | ||
107 | } | 107 | } | ||
108 | 108 | | |||
109 | void cleanupGL() | 109 | void cleanupGL() | ||
110 | { | 110 | { | ||
▲ Show 20 Lines • Show All 2196 Lines • Show Last 20 Lines |