C++ (Qt)if (!haColors) shader->disableAttributeArray(loc); // так бага нетelse { shader->enableAttributeArray(loc); glVertexAttribPointer(loc, 4, GL_UNSIGNED_BYTE, true, 0, data); // так есть}
painter->beginNativePainting();...painter->endNativePainting();
C++ (Qt)void GraphicsItem::paint ( QPainter * painter, const QStyleOptionGraphicsItem *, QWidget * widget ){ painter->beginNativePainting(); ... // здесь рисую: bind, draw, unbind painter->endNativePainting(); painter->drawRect( QRect( -100, -100, 200, 200 ) ); painter->drawText( 100, 100, QString::fromUtf8( "Hello" ) ); ... painter->beginNativePainting(); ... // здесь рисую: bind, draw, unbind painter->endNativePainting(); ...}