コード例 #1
0
HostWindowDataOpenGL::~HostWindowDataOpenGL()
{
	QGLContext* gc = (QGLContext*) QGLContext::currentContext();
	if (gc) {
		if (m_textureId)
			gc->deleteTexture(m_textureId);
	}
}
コード例 #2
0
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;
}
コード例 #3
0
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;
}