You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to implement a eraser, clear subregion of the texture.
PageCanvas is child of QNanoQuickItem and render with QQuickFramebufferObject, what i do is binding the texture then glTexSubImage2D. But it crashs. So where is the right place(QNanoQuickItemPainter?) to do this operation, or i'm using the texture in a wrong way.
void PageCanvas::erase(int x, int y)
{
textureProvider()->texture()->bind();
const int eraserSize = 16;
quint32 subImage[eraserSize * eraserSize] = {};
glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, eraserSize, eraserSize, GL_RGBA, GL_UNSIGNED_BYTE, subImage);
}
The text was updated successfully, but these errors were encountered:
I'm trying to implement a eraser, clear subregion of the texture.
PageCanvas
is child ofQNanoQuickItem
and render with QQuickFramebufferObject, what i do is binding the texture then glTexSubImage2D. But it crashs. So where is the right place(QNanoQuickItemPainter?) to do this operation, or i'm using the texture in a wrong way.The text was updated successfully, but these errors were encountered: