HostWindowDataOpenGL::~HostWindowDataOpenGL() { QGLContext* gc = (QGLContext*) QGLContext::currentContext(); if (gc) { if (m_textureId) gc->deleteTexture(m_textureId); } }
void HostWindowDataOpenGL::initializePixmap(QPixmap& screenPixmap) { QGLContext* gc = (QGLContext*) QGLContext::currentContext(); if (gc) { if (m_textureId) gc->deleteTexture(m_textureId); screenPixmap = QPixmap(m_width, m_height); screenPixmap.fill(QColor(255,255,255,0)); m_textureId = gc->bindTexture(screenPixmap, GL_TEXTURE_2D, kGLInternalFormat, QGLContext::PremultipliedAlphaBindOption); } m_dirty = true; }
static PyObject *meth_QGLContext_deleteTexture(PyObject *sipSelf, PyObject *sipArgs) { PyObject *sipParseErr = NULL; { GLuint a0; QGLContext *sipCpp; if (sipParseArgs(&sipParseErr, sipArgs, "Bu", &sipSelf, sipType_QGLContext, &sipCpp, &a0)) { sipCpp->deleteTexture(a0); Py_INCREF(Py_None); return Py_None; } } /* Raise an exception if the arguments couldn't be parsed. */ sipNoMethod(sipParseErr, sipName_QGLContext, sipName_deleteTexture, doc_QGLContext_deleteTexture); return NULL; }