9#include <QtGui/QOpenGLContext>
10#include <qpa/qplatformopenglcontext.h>
11#include <qpa/qwindowsysteminterface.h>
12#include <QtGui/QScreen>
14#include <QtGui/private/qeglplatformcontext_p.h>
15#include <QtGui/private/qeglconvenience_p.h>
17#include <QtGui/private/qt_egl_p.h>
21#ifdef DIRECTFB_PLATFORM_HOOKS
47 void platformDestroy();
82 , m_eglDisplay(EGL_NO_DISPLAY)
92 if (m_eglDisplay == EGL_NO_DISPLAY)
97void QDirectFbScreenEGL::initializeEGL()
99 m_eglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
100 if (m_eglDisplay == EGL_NO_DISPLAY)
106 eglBindAPI(EGL_OPENGL_ES_API);
107 eglInitialize(m_eglDisplay, &major, &minor);
111void QDirectFbScreenEGL::platformInit()
117void QDirectFbScreenEGL::platformDestroy()
125 , m_eglSurface(EGL_NO_SURFACE)
130 if (m_eglSurface != EGL_NO_SURFACE) {
133 eglDestroySurface(dfbScreen->
eglDisplay(), m_eglSurface);
145 DFBWindowDescription description;
146 memset(&description, 0,
sizeof(DFBWindowDescription));
147 description.flags = DFBWindowDescriptionFlags(DWDESC_WIDTH | DWDESC_HEIGHT|
148 DWDESC_POSX | DWDESC_POSY|
149 DWDESC_PIXELFORMAT | DWDESC_SURFACE_CAPS);
152 description.posx =
window()->
x();
153 description.posy =
window()->
y();
155 description.surface_caps = DSCAPS_GL;
156 description.pixelformat = DSPF_RGB16;
158 IDirectFBDisplayLayer *
layer;
162 DirectFBError(
"QDirectFbWindow: failed to create window",
result);
170 if (m_eglSurface == EGL_NO_SURFACE) {
175 if (m_eglSurface == EGL_NO_SURFACE)
184 return window()->requestedFormat();
196 return window->eglSurface();
213void QDirectFbIntegrationEGL::initializeScreen()
QDirectFbEGLContext(QDirectFbScreenEGL *screen, QOpenGLContext *context)
EGLSurface eglSurfaceForPlatformSurface(QPlatformSurface *surface)
bool hasCapability(Capability cap) const override
QDirectFbScreenEGL(int display)
IDirectFBDisplayLayer * dfbLayer() const
void createDirectFBWindow()
QDirectFbWindowEGL(QWindow *tlw, QDirectFbInput *inputhandler)
QSurfaceFormat format() const
Returns the actual surface format of the window.
QDirectFbInput * m_inputHandler
QDirectFBPointer< IDirectFBWindow > m_dfbWindow
virtual void createDirectFBWindow()
IDirectFBSurface * dfbSurface()
An EGL context implementation.
The QPlatformOpenGLContext class provides an abstraction for native GL contexts.
QOpenGLContext * context() const
T * data() const noexcept
Returns the value of the pointer referenced by this object.
static void handleScreenAdded(QPlatformScreen *screen, bool isPrimary=false)
Should be called by the implementation whenever a new screen is added.
int x
the x position of the window's geometry
int y
the y position of the window's geometry
struct wl_display * display
Combined button and popup list for selecting options.
static QT_BEGIN_NAMESPACE QDirectFBEGLHooks * hooks
QDirectFbScreen * toDfbScreen(QWindow *window)
EGLConfig q_configFromGLFormat(EGLDisplay display, const QSurfaceFormat &format, bool highestPixelFormat, int surfaceType)
typedef EGLSurface(EGLAPIENTRYP PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC)(EGLDisplay dpy
typedef EGLDisplay(EGLAPIENTRYP PFNEGLGETPLATFORMDISPLAYEXTPROC)(EGLenum platform
constexpr const T & qMax(const T &a, const T &b)
GLint GLsizei GLsizei height
GLint GLsizei GLsizei GLenum format
GLenum GLenum GLenum input
bool hasCapability(QPlatformIntegration::Capability) const