Qt 4.8
Public Functions | Properties | List of all members
PvrEglScreenSurfaceFunctions Class Reference

#include <pvreglscreen.h>

Inheritance diagram for PvrEglScreenSurfaceFunctions:
QGLScreenSurfaceFunctions

Public Functions

bool createNativeWindow (QWidget *widget, EGLNativeWindowType *native)
 [2] More...
 
 PvrEglScreenSurfaceFunctions (PvrEglScreen *s, int screenNum)
 
- Public Functions inherited from QGLScreenSurfaceFunctions
virtual bool createNativeImage (QImage *image, EGLNativePixmapType *native)
 Creates a native OpenGLES drawable for directly rendering into image and returns it in native. More...
 
virtual bool createNativePixmap (QPixmap *pixmap, EGLNativePixmapType *native)
 Creates a native OpenGLES drawable for directly rendering into pixmap and returns it in native. More...
 

Properties

int displayId
 
PvrEglScreenscreen
 

Detailed Description

Definition at line 51 of file pvreglscreen.h.

Constructors and Destructors

◆ PvrEglScreenSurfaceFunctions()

PvrEglScreenSurfaceFunctions::PvrEglScreenSurfaceFunctions ( PvrEglScreen s,
int  screenNum 
)
inline

Definition at line 54 of file pvreglscreen.h.

55  : screen(s), displayId(screenNum) {}

Functions

◆ createNativeWindow()

bool PvrEglScreenSurfaceFunctions::createNativeWindow ( QWidget widget,
EGLNativeWindowType native 
)
virtual

[2]

[2]

Reimplemented from QGLScreenSurfaceFunctions.

Definition at line 329 of file pvreglscreen.cpp.

Referenced by PvrEglScreenSurfaceFunctions().

330 {
332  QWSWindowSurface *surface =
333  static_cast<QWSWindowSurface *>(widget->windowSurface());
334  if (!surface) {
335  // The widget does not have a surface yet, so give it one.
336  surface = new PvrEglWindowSurface(widget, screen, displayId);
337  widget->setWindowSurface(surface);
338  } else if (surface->key() != QLatin1String("PvrEgl")) {
339  // The application has attached a QGLContext to an ordinary QWidget.
340  // Replace the widget's window surface with a new one that can do GL.
341  QRect geometry = widget->frameGeometry();
342  geometry.moveTo(widget->mapToGlobal(QPoint(0, 0)));
343  surface = new PvrEglWindowSurface(widget, screen, displayId);
344  surface->setGeometry(geometry);
345  widget->setWindowSurface(surface);
347  }
348  PvrEglWindowSurface *nsurface = static_cast<PvrEglWindowSurface*>(surface);
349  *native = (EGLNativeWindowType)(nsurface->nativeDrawable());
350  return true;
351 }
void setWindowSurface(QWindowSurface *surface)
Sets the window surface to be the surface specified.
Definition: qwidget.cpp:12774
The QWSWindowSurface class provides the drawing area for top-level windows in Qt for Embedded Linux...
QRect frameGeometry
geometry of the widget relative to its parent including any window frame
Definition: qwidget.h:159
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
void moveTo(int x, int t)
Moves the rectangle, leaving the top-left corner at the given position (x, y).
Definition: qrect.h:334
NativeWindowType EGLNativeWindowType
Definition: qegl_p.h:116
QWindowSurface * windowSurface() const
Returns the QWindowSurface this widget will be drawn into.
Definition: qwidget.cpp:12819
virtual QString key() const =0
Implement this function to return a string that uniquely identifies the class of this surface...
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
void setAttribute(Qt::WidgetAttribute, bool on=true)
Sets the attribute attribute on this widget if on is true; otherwise clears the attribute.
Definition: qwidget.cpp:11087
QPoint mapToGlobal(const QPoint &) const
Translates the widget coordinate pos to global screen coordinates.
virtual void setGeometry(const QRect &rect)
Sets the currently allocated area to be the given rect.

Properties

◆ displayId

int PvrEglScreenSurfaceFunctions::displayId
private

Definition at line 61 of file pvreglscreen.h.

◆ screen

PvrEglScreen* PvrEglScreenSurfaceFunctions::screen
private

Definition at line 60 of file pvreglscreen.h.


The documentation for this class was generated from the following files: