48 #include <private/qgl_p.h> 52 #ifdef EGL_BIND_TO_TEXTURE_RGBA 53 #define QGL_RENDER_TEXTURE 1 55 #define QGL_RENDER_TEXTURE 0 66 if (shareWidget && shareWidget->d_func()->glcx)
67 shareContext = shareWidget->d_func()->glcx->d_func()->eglContext;
76 #if QGL_RENDER_TEXTURE 77 if (
ctx->configAttrib(EGL_BIND_TO_TEXTURE_RGBA) == EGL_TRUE)
79 else if (
ctx->configAttrib(EGL_BIND_TO_TEXTURE_RGB) == EGL_TRUE)
88 #if QGL_RENDER_TEXTURE 90 configProps.
setValue(EGL_BIND_TO_TEXTURE_RGBA, EGL_TRUE);
96 configProps.
setValue(EGL_BIND_TO_TEXTURE_RGB, EGL_TRUE);
120 attribs.setValue(EGL_HEIGHT, size.
height());
121 #if QGL_RENDER_TEXTURE 124 attribs.setValue(EGL_TEXTURE_TARGET, EGL_TEXTURE_2D);
129 pbuf = eglCreatePbufferSurface(
ctx->display(),
ctx->config(), attribs.properties());
130 #if QGL_RENDER_TEXTURE 134 attribs.removeValue(EGL_TEXTURE_FORMAT);
135 attribs.removeValue(EGL_TEXTURE_TARGET);
136 pbuf = eglCreatePbufferSurface(
ctx->display(),
ctx->config(), attribs.properties());
139 if (
pbuf == EGL_NO_SURFACE) {
145 if (!
ctx->createContext(shareContext)) {
162 #if QGL_RENDER_TEXTURE 164 if (
d->invalid ||
d->textureFormat == EGL_NONE || !
d->ctx)
167 return eglBindTexImage(
d->ctx->display(),
d->pbuf, EGL_BACK_BUFFER);
176 #if QGL_RENDER_TEXTURE 178 if (
d->invalid ||
d->textureFormat == EGL_NONE || !
d->ctx)
180 eglReleaseTexImage(
d->ctx->display(),
d->pbuf, EGL_BACK_BUFFER);
187 #if QGL_RENDER_TEXTURE 190 glGenTextures(1, &texture);
192 if (
d->textureFormat == EGL_TEXTURE_RGB)
208 if (dpy == EGL_NO_DISPLAY)
217 if (eglChooseConfig(dpy, configProps.
properties(),
218 &cfg, 1, &matching) && matching > 0)
void qt_glformat_from_eglconfig(QGLFormat &format, const EGLConfig config)
#define GL_TEXTURE_MIN_FILTER
#define QT_END_NAMESPACE
This macro expands to.
bool removeValue(int name)
const EGLint * properties() const
static bool hasOpenGLPbuffers()
Returns true if the OpenGL pbuffer extension is present on this system; otherwise returns false...
void setValue(int name, int value)
Q_GUI_EXPORT QString errorString(EGLint code=eglGetError())
int width() const
Returns the width.
#define QT_BEGIN_NAMESPACE
This macro expands to.
Q_GUI_EXPORT EGLDisplay display()
void setRenderableType(QEgl::API api)
Q_CORE_EXPORT void qWarning(const char *,...)
The QGLPixelBuffer class encapsulates an OpenGL pbuffer.
bool reduceConfiguration()
bool bindToDynamicTexture(GLuint texture)
Generates and binds a 2D GL texture that is the same size as the pbuffer, and returns the texture's I...
int height() const
Returns the height.
bool init(const QSize &size, const QGLFormat &f, QGLWidget *shareWidget)
GLuint generateDynamicTexture() const
The QSize class defines the size of a two-dimensional object using integer point precision.
#define GL_TEXTURE_MAG_FILTER
void setDeviceType(int devType)
void qt_eglproperties_set_glformat(QEglProperties &eglProperties, const QGLFormat &glFormat)
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
void releaseFromDynamicTexture()
Releases the pbuffer from any previously bound texture.