14QDirectFbGLContext::QDirectFbGLContext(IDirectFBGL *glContext)
15 : m_dfbGlContext(glContext)
18 DFBGLAttributes glAttribs;
19 result = m_dfbGlContext->GetAttributes(glContext, &glAttribs);
20 if (result == DFB_OK) {
21 m_windowFormat.setDepthBufferSize(glAttribs.depth_size);
22 m_windowFormat.setStencilBufferSize(glAttribs.stencil_size);
24 m_windowFormat.setRedBufferSize(glAttribs.red_size);
25 m_windowFormat.setGreenBufferSize(glAttribs.green_size);
26 m_windowFormat.setBlueBufferSize(glAttribs.blue_size);
27 m_windowFormat.setAlphaBufferSize(glAttribs.alpha_size);
29 m_windowFormat.setAccumBufferSize(glAttribs.accum_red_size);
30 m_windowFormat.setAlpha(glAttribs.accum_alpha_size);
32 m_windowFormat.setDoubleBuffer(glAttribs.double_buffer);
33 m_windowFormat.setStereo(glAttribs.stereo);
37void QDirectFbGLContext::makeCurrent()
39 QPlatformOpenGLContext::makeCurrent();
40 m_dfbGlContext->Lock(m_dfbGlContext);
43void QDirectFbGLContext::doneCurrent()
45 QPlatformOpenGLContext::doneCurrent();
46 m_dfbGlContext->Unlock(m_dfbGlContext);
49QFunctionPointer QDirectFbGLContext::getProcAddress(
const char *procName)
52 DFBResult result = m_dfbGlContext->GetProcAddress(m_dfbGlContext, procName, &proc);
54 return (QFunctionPointer) proc;
55 return dlsym(RTLD_DEFAULT, procName);
58void QDirectFbGLContext::swapBuffers()
61 qDebug(
"Swap buffers");
64QPlatformWindowFormat QDirectFbGLContext::platformWindowFormat()
const
66 return m_windowFormat;