Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qdirectfbglcontext.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
5
6#include <directfbgl.h>
7#include <dlfcn.h>
8
9#include <QDebug>
10
12
13QDirectFbGLContext::QDirectFbGLContext(IDirectFBGL *glContext)
14 : m_dfbGlContext(glContext)
15{
16 DFBResult result;
17 DFBGLAttributes glAttribs;
18 result = m_dfbGlContext->GetAttributes(glContext, &glAttribs);
19 if (result == DFB_OK) {
20 m_windowFormat.setDepthBufferSize(glAttribs.depth_size);
21 m_windowFormat.setStencilBufferSize(glAttribs.stencil_size);
22
23 m_windowFormat.setRedBufferSize(glAttribs.red_size);
24 m_windowFormat.setGreenBufferSize(glAttribs.green_size);
25 m_windowFormat.setBlueBufferSize(glAttribs.blue_size);
26 m_windowFormat.setAlphaBufferSize(glAttribs.alpha_size);
27
28 m_windowFormat.setAccumBufferSize(glAttribs.accum_red_size);
29 m_windowFormat.setAlpha(glAttribs.accum_alpha_size);
30
31 m_windowFormat.setDoubleBuffer(glAttribs.double_buffer);
32 m_windowFormat.setStereo(glAttribs.stereo);
33 }
34}
35
36void QDirectFbGLContext::makeCurrent()
37{
39 m_dfbGlContext->Lock(m_dfbGlContext);
40}
41
42void QDirectFbGLContext::doneCurrent()
43{
45 m_dfbGlContext->Unlock(m_dfbGlContext);
46}
47
48QFunctionPointer QDirectFbGLContext::getProcAddress(const char *procName)
49{
50 void *proc;
51 DFBResult result = m_dfbGlContext->GetProcAddress(m_dfbGlContext, procName, &proc);
52 if (result == DFB_OK)
53 return (QFunctionPointer) proc;
54 return dlsym(RTLD_DEFAULT, procName);
55}
56
57void QDirectFbGLContext::swapBuffers()
58{
59// m_dfbGlContext->Unlock(m_dfbGlContext); //maybe not in doneCurrent()
60 qDebug("Swap buffers");
61}
62
63QPlatformWindowFormat QDirectFbGLContext::platformWindowFormat() const
64{
65 return m_windowFormat;
66}
67
virtual bool makeCurrent(QPlatformSurface *surface)=0
virtual void doneCurrent()=0
Combined button and popup list for selecting options.
#define qDebug
[1]
Definition qlogging.h:164
GLuint64EXT * result
[6]