Texture.update()抛出异常

时间:2019-06-03 18:12:38

标签: c++ sfml

它说

 Assertion failed: x + window.getSize().x <= m_size.x

:-\
大小和x \ y是正确的 一切都在最后一行中断。我需要它来进行选择和复制/粘贴工具

        bufferRect.width = abs(curPos.x - point1.x);
        bufferRect.height = abs(curPos.y - point1.y);
        int width = bufferRect.width;
        int height = bufferRect.height;
        int x = bufferRect.left;
        int y = bufferRect.top;
        std::cout << "width is "<< bufferRect.width << std::endl;
        std::cout << "height is " << bufferRect.height << std::endl;
        std::cout << "left and top are " << bufferRect.left << " + " << bufferRect.top << std::endl;

        bufferTexture.create(width, height);
        bufferTexture.update(mainWindow,x ,y );

0 个答案:

没有答案